From 358520678126b420e071341d79559b63dc2f2261 Mon Sep 17 00:00:00 2001 From: kkyusuftk Date: Tue, 24 Sep 2024 02:21:58 +0530 Subject: [PATCH 01/14] feat: passing personalisation to overlay --- clevertap.js | 18 +- clevertap.js.map | 2 +- clevertap.min.js | 2 +- package-lock.json | 4 +- src/modules/visualBuilder/pageBuilder.js | 22 +- yarn.lock | 9186 +++++++++++----------- 6 files changed, 4623 insertions(+), 4611 deletions(-) diff --git a/clevertap.js b/clevertap.js index fd644fec..56312430 100644 --- a/clevertap.js +++ b/clevertap.js @@ -4594,7 +4594,9 @@ if (event.data.message === 'Dashboard') { var _event$data$variant, _event$data$details; - initialiseCTBuilder(event.data.url, (_event$data$variant = event.data.variant) !== null && _event$data$variant !== void 0 ? _event$data$variant : null, (_event$data$details = event.data.details) !== null && _event$data$details !== void 0 ? _event$data$details : {}); + // handle personalisation + window.evtMaster = event.data.personalisation.evtMaster; + initialiseCTBuilder(event.data.url, (_event$data$variant = event.data.variant) !== null && _event$data$variant !== void 0 ? _event$data$variant : null, (_event$data$details = event.data.details) !== null && _event$data$details !== void 0 ? _event$data$details : {}, event.data.personalisation); } else if (event.data.message === 'Overlay') { renderVisualBuilder(event.data, true); } @@ -4604,12 +4606,13 @@ * @param {string} url - The URL to initialize the builder. * @param {string} variant - The variant of the builder. * @param {Object} details - The details object. + * @param {Object} personalisation - The personalisation object */ - const initialiseCTBuilder = (url, variant, details) => { + const initialiseCTBuilder = (url, variant, details, personalisation) => { if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details)); + document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details, personalisation)); } else { onContentLoad(url, variant, details); } @@ -4621,7 +4624,7 @@ * Handles content load for Clevertap builder. */ - function onContentLoad(url, variant, details) { + function onContentLoad(url, variant, details, personalisation) { if (!contentLoaded) { document.body.innerHTML = ''; container = document.createElement('div'); @@ -4631,7 +4634,7 @@ container.style.display = 'flex'; document.body.appendChild(container); const overlayPath = OVERLAY_PATH; - loadOverlayScript(overlayPath, url, variant, details).then(() => { + loadOverlayScript(overlayPath, url, variant, details, personalisation).then(() => { console.log('Overlay script loaded successfully.'); contentLoaded = true; }).catch(error => { @@ -4663,7 +4666,7 @@ */ - function loadOverlayScript(overlayPath, url, variant, details) { + function loadOverlayScript(overlayPath, url, variant, details, personalisation) { return new Promise((resolve, reject) => { var script = document.createElement('script'); script.type = 'module'; @@ -4675,7 +4678,8 @@ id: '#overlayDiv', url, variant, - details + details, + personalisation }); resolve(); } else { diff --git a/clevertap.js.map b/clevertap.js.map index c74f797d..48e753d7 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nconst initialiseCTBuilder = (url, variant, details) => {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details))\n } else {\n onContentLoad(url, variant, details)\n }\n}\n\nlet container\nlet contentLoaded = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n if (!contentLoaded) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n let elementDisplayed = false\n\n if (siteUrl !== window.location.href.split('?')[0]) return\n\n const processElement = (element, selector) => {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else if (selectors[selector].json) {\n dispatchJsonData(targetingMsgJson, selectors[selector])\n } else {\n updateFormData(element, selectors[selector].form)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n Object.keys(selectors).forEach(selector => {\n const element = document.querySelector(selector)\n if (element) {\n processElement(element, selector)\n elementDisplayed = true\n } else {\n tryFindingElement(selector)\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","script","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;E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D;EACD;;QC3yBGyL,SAAS,GAAG,IAAI2gC,SAAJ,CAAczuC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => onContentLoad(url, variant, details, personalisation))\n } else {\n onContentLoad(url, variant, details)\n }\n}\n\nlet container\nlet contentLoaded = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n document.body.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n loadTypeKit()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Loads TypeKit script.\n */\nfunction loadTypeKit () {\n const config = {\n kitId: 'eqj6nom',\n scriptTimeout: 3000,\n async: true\n }\n\n const docElement = document.documentElement\n const timeoutId = setTimeout(function () {\n docElement.className = docElement.className.replace(/\\bwf-loading\\b/g, '') + ' wf-inactive'\n }, config.scriptTimeout)\n const typeKitScript = document.createElement('script')\n let scriptLoaded = false\n const firstScript = document.getElementsByTagName('script')[0]\n let scriptReadyState\n\n docElement.className += ' wf-loading'\n typeKitScript.src = 'https://use.typekit.net/' + config.kitId + '.js'\n typeKitScript.async = true\n typeKitScript.onload = typeKitScript.onreadystatechange = function () {\n scriptReadyState = this.readyState\n if (scriptLoaded || (scriptReadyState && scriptReadyState !== 'complete' && scriptReadyState !== 'loaded')) return\n scriptLoaded = true\n clearTimeout(timeoutId)\n try {\n // eslint-disable-next-line no-undef\n Typekit.load(config)\n } catch (e) {}\n }\n\n firstScript.parentNode.insertBefore(typeKitScript, firstScript)\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n let elementDisplayed = false\n\n if (siteUrl !== window.location.href.split('?')[0]) return\n\n const processElement = (element, selector) => {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else if (selectors[selector].json) {\n dispatchJsonData(targetingMsgJson, selectors[selector])\n } else {\n updateFormData(element, selectors[selector].form)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n Object.keys(selectors).forEach(selector => {\n const element = document.querySelector(selector)\n if (element) {\n processElement(element, selector)\n elementDisplayed = true\n } else {\n tryFindingElement(selector)\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","position","overlayPath","loadOverlayScript","then","catch","loadCSS","loadTypeKit","link","rel","script","onload","Overlay","Error","onerror","kitId","scriptTimeout","docElement","documentElement","timeoutId","className","typeKitScript","scriptLoaded","firstScript","scriptReadyState","onreadystatechange","Typekit","load","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAYA,MAAZ,EAAoB;EAClB,0DAAeA,MAAf;EACD;;EAED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,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAI6gC,SAAJ,CAAc3uC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 64bf2ec8..19be2c5c 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",q="WZRK_INBOX",W=1e3,K="wzrk_fetch",G=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],H=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return H(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(H(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Ue extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Fe}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!H(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),G.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const Ve=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),He(e)),Ge=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),He=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+Ge.charAt(n)+Ge.charAt(s)+Ge.charAt(r)+Ge.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=qe(e,"tries",t),e=i(this,$e)[$e](e),e=qe(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&H(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),qe(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?qe(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();s.includes(t)||s.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?r(e):i(this,lt)[lt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported value type");r(t)}le.globalProfileMap[e]=s,ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)||{}),!le.globalProfileMap.hasOwnProperty(e))return void i(this,lt)[lt].error("The property ".concat(e," does not exist."));const n=t=>{const i=le.globalProfileMap[e].indexOf(t);-1!==i&&le.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported propVal type");n(t)}0===le.globalProfileMap[e].length&&delete le.globalProfileMap[e],ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),(null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete le.globalProfileMap[e]:i(this,lt)[lt].error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===F||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=qe(a,"type",A),a=qe(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=qe(t,"type",A),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=qe(s,"type",A),s=qe(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ut(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ut(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ut(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=qt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{Vt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(q)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(q,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ut=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(q,i)},Ft=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(V)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Vt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},qt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(V)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Jt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",$t="wve-anti-flicker-hide",Yt="wve-flicker-style",Qt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)Xt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{});else"Overlay"===e.data.message&&oi(e.data,!0)}},Xt=(e,t,i)=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>ii(e,t,i))):ii(e,t,i)};let ei,ti=!1;function ii(e,t,i){if(!ti){document.body.innerHTML="",ei=document.createElement("div"),ei.id="overlayDiv",ei.style.position="relative",ei.style.display="flex",document.body.appendChild(ei);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully."),ti=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=Jt,document.head.appendChild(o),function(){const e={kitId:"eqj6nom",scriptTimeout:3e3,async:!0},t=document.documentElement,i=setTimeout((function(){t.className=t.className.replace(/\bwf-loading\b/g,"")+" wf-inactive"}),e.scriptTimeout),o=document.createElement("script");let n=!1;const s=document.getElementsByTagName("script")[0];let r;t.className+=" wf-loading",o.src="https://use.typekit.net/"+e.kitId+".js",o.async=!0,o.onload=o.onreadystatechange=function(){if(r=this.readyState,!(n||r&&"complete"!==r&&"loaded"!==r)){n=!0,clearTimeout(i);try{Typekit.load(e)}catch(e){}}},s.parentNode.insertBefore(o,s)}()}var o}const oi=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];let s=!1;if(o!==window.location.href.split("?")[0])return;const r=(t,i)=>{n[i].html?t.outerHTML=n[i].html:n[i].json?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,n[i]):((e,t)=>{if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const i=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>window.open(i,"_blank").focus():()=>{window.location.href=i}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}})(t,n[i].form)};Object.keys(n).forEach((e=>{const t=document.querySelector(e);t?(r(t,e),s=!0):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e);o?(r(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)})),s&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function ni(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,s=0;function r(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add($t))),setTimeout((()=>{e.forEach((e=>{e.classList.remove($t),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),s++,(0===Object.keys(o).length||s>20)&&(s=0,clearInterval(n))}),100))}!function(){const e=Yt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,r(t))})).observe(document.body,{childList:!0,subtree:!0})}(),r(t)}))}const si=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(si,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(He(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),i.preview&&i["custom-editor"]&&(u.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=new Event("CT_campaign_rendered");document.dispatchEvent(m),i["custom-editor"]&&(v=k(e,v)),u.srcdoc=v;const y=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},w=navigator.userAgent.toLowerCase();if(-1!==w.indexOf("safari"))if(w.indexOf("chrome")>-1)u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),300)}else u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,M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AA,IAAI,CAACoX,OAAL,GAAe3E,UAAf;;EACA,MAAIgQ,OAAJ,EAAa;EACX,UAAM1R,IAAI,GAAG/U,MAAM,CAAC+U,IAAP,CAAY0R,OAAZ,CAAb;EACA1R,IAAAA,IAAI,CAACC,OAAL,CAAazT,GAAG,IAAI;EAClByC,MAAAA,IAAI,CAACohC,EAAL,CAAQ7jC,GAAR,IAAeklB,OAAO,CAACllB,GAAD,CAAtB;EACD,KAFD;EAGD;;EACD,MAAI0E,GAAG,CAACF,QAAR,EAAkB;EAChB/B,IAAAA,IAAI,CAACohC,EAAL,GAAU,EAAE,GAAGphC,IAAI,CAACohC,EAAV;EAAc,SAAGn/B,GAAG,CAACF;EAArB,KAAV;EACD;;EACD/B,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcsX,QAAd,CAAuBtX,IAAvB;;EACA,QAAMuX,cAAc,GAAG7K,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACAoX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBrV,QAAtB,CAAtB;EACAqV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAIkgC,SAAJ,CAAchuC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n let elementDisplayed = false\n\n if (siteUrl !== window.location.href.split('?')[0]) return\n\n const processElement = (element, selector) => {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else if (selectors[selector].json) {\n dispatchJsonData(targetingMsgJson, selectors[selector])\n } else {\n updateFormData(element, selectors[selector].form)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n Object.keys(selectors).forEach(selector => {\n const element = document.querySelector(selector)\n if (element) {\n processElement(element, selector)\n elementDisplayed = true\n } else {\n tryFindingElement(selector)\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAK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AAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcsX,QAAd,CAAuBtX,IAAvB;;EACA,QAAMuX,cAAc,GAAG7K,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACAoX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBrV,QAAtB,CAAtB;EACAqV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAIkgC,SAAJ,CAAchuC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 6cdd8f62..5b623308 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",q="WZRK_INBOX",W=1e3,K="wzrk_fetch",H=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],G=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return G(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(G(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Ue extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Fe}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!G(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),H.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const Ve=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ge(e)),He=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ge=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+He.charAt(n)+He.charAt(s)+He.charAt(r)+He.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=qe(e,"tries",t),e=i(this,$e)[$e](e),e=qe(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&G(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),qe(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?qe(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();s.includes(t)||s.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?r(e):i(this,lt)[lt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported value type");r(t)}le.globalProfileMap[e]=s,ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)||{}),!le.globalProfileMap.hasOwnProperty(e))return void i(this,lt)[lt].error("The property ".concat(e," does not exist."));const n=t=>{const i=le.globalProfileMap[e].indexOf(t);-1!==i&&le.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported propVal type");n(t)}0===le.globalProfileMap[e].length&&delete le.globalProfileMap[e],ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),(null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete le.globalProfileMap[e]:i(this,lt)[lt].error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===F||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=qe(a,"type",A),a=qe(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=qe(t,"type",A),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=qe(s,"type",A),s=qe(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Gt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ut(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ut(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Ht,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Ht,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ut(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=qt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{Vt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(q)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(q,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ut=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(q,i)},Ft=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(V)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Vt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},qt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(V)||{}).length>0,Ht='\n\n\n',Gt='\n\n\n',Jt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",$t="wve-anti-flicker-hide",Yt="wve-flicker-style",Qt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Xt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&ni(e.data,!0)}},Xt=(e,t,i,o)=>{"complete"===document.readyState?oi(e,t,i,o):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&oi(e,t,i,o)}))};let ei,ti=!1,ii=!1;function oi(e,t,i,o){if(!ti){window.Shopify&&(ii=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",ei=document.createElement("div"),ei.id="overlayDiv",ei.style.position="relative",ei.style.display="flex",document.body.appendChild(ei);(function(e,t,i,o,n,s){return new Promise(((r,a)=>{var l=document.createElement("script");l.type="module",l.src=e,l.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:n,personalisation:s}),r()):a(new Error("ContentLayout not found in overlay.js"))},l.onerror=function(e){a(e)},document.head.appendChild(l)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i,ii,o).then((()=>{console.log("Overlay script loaded successfully."),ti=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.href=Jt,document.head.appendChild(n)}var n}const ni=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];let s=!1;if(o!==window.location.href.split("?")[0])return;const r=(t,i)=>{n[i].html?t.outerHTML=n[i].html:n[i].json?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,n[i]):((e,t)=>{if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const i=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>window.open(i,"_blank").focus():()=>{window.location.href=i}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}})(t,n[i].form)};Object.keys(n).forEach((e=>{const t=document.querySelector(e);t?(r(t,e),s=!0):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e);o?(r(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)})),s&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function si(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,s=0;function r(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add($t))),setTimeout((()=>{e.forEach((e=>{e.classList.remove($t),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),s++,(0===Object.keys(o).length||s>20)&&(s=0,clearInterval(n))}),100))}!function(){const e=Yt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,r(t))})).observe(document.body,{childList:!0,subtree:!0})}(),r(t)}))}const ri=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(ri,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ge(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),i.preview&&i["custom-editor"]&&(u.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=new Event("CT_campaign_rendered");document.dispatchEvent(m),i["custom-editor"]&&(v=k(e,v)),u.srcdoc=v;const y=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},w=navigator.userAgent.toLowerCase();if(-1!==w.indexOf("safari"))if(w.indexOf("chrome")>-1)u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),300)}else u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i="\n "); + var appendScriptForCustomEvent = function appendScriptForCustomEvent(targetingMsgJson, html) { + var script = "\n "); return html.replace(/(<\s*\/\s*body)/, "".concat(script, "\n$1")); }; - let _callBackCalled = false; + var _callBackCalled = false; - const showFooterNotification = targetingMsgJson => { - let onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable + var showFooterNotification = function showFooterNotification(targetingMsgJson) { + var onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { - const notificationCallback = window.clevertap.notificationCallback; + var notificationCallback = window.clevertap.notificationCallback; if (!_callBackCalled) { - const inaObj = {}; + var inaObj = {}; inaObj.msgContent = targetingMsgJson.msgContent; inaObj.msgId = targetingMsgJson.wzrk_id; @@ -5499,9 +6095,9 @@ inaObj.kv = targetingMsgJson.display.kv; } - window.clevertap.raiseNotificationClicked = () => { + window.clevertap.raiseNotificationClicked = function () { if (onClick !== '' && onClick != null) { - const jsFunc = targetingMsgJson.display.jsFunc; + var jsFunc = targetingMsgJson.display.jsFunc; onClick += getCookieParams(); // invoke js function call if (jsFunc != null) { @@ -5520,7 +6116,7 @@ } }; - window.clevertap.raiseNotificationViewed = () => { + window.clevertap.raiseNotificationViewed = function () { incrementImpression(targetingMsgJson); }; @@ -5532,13 +6128,13 @@ renderFooterNotification(targetingMsgJson); if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { - const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; - const inaObj = {}; - inaObj.msgContent = targetingMsgJson.msgContent; - inaObj.msgId = targetingMsgJson.wzrk_id; + var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; + var _inaObj = {}; + _inaObj.msgContent = targetingMsgJson.msgContent; + _inaObj.msgId = targetingMsgJson.wzrk_id; if (targetingMsgJson.wzrk_pivot) { - inaObj.pivotId = targetingMsgJson.wzrk_pivot; + _inaObj.pivotId = targetingMsgJson.wzrk_pivot; } var msgCTkv = []; @@ -5546,61 +6142,66 @@ for (var wzrkPrefixKey in targetingMsgJson) { // ADD WZRK PREFIX KEY VALUE PAIRS if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { - const wzrkJson = { - [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] - }; + var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); + msgCTkv.push(wzrkJson); } } if (msgCTkv.length > 0) { - inaObj.msgCTkv = msgCTkv; + _inaObj.msgCTkv = msgCTkv; } if (targetingMsgJson.display.kv != null) { - inaObj.kv = targetingMsgJson.display.kv; + _inaObj.kv = targetingMsgJson.display.kv; } // PUBLIC API TO RECORD CLICKED EVENT - window.clevertap.raisePopupNotificationClicked = notificationData => { + window.clevertap.raisePopupNotificationClicked = function (notificationData) { if (!notificationData || !notificationData.msgId) { return; } - const eventData = {}; + var eventData = {}; eventData.type = 'event'; eventData.evtName = NOTIFICATION_CLICKED; - eventData.evtData = { - [WZRK_ID]: notificationData.msgId - }; + eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); if (targetingMsgJson.wzrk_pivot) { - eventData.evtData = { ...eventData.evtData, + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { wzrk_pivot: notificationData.pivotId - }; + }); } // WZRK PREFIX KEY VALUE PAIRS if (notificationData.msgCTkv) { - for (var wzrkPrefixObj of notificationData.msgCTkv) { - eventData.evtData = { ...eventData.evtData, - ...wzrkPrefixObj - }; + var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var wzrkPrefixObj = _step.value; + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } _request.processEvent(eventData); }; - popupCallback(inaObj); + popupCallback(_inaObj); } } }; - let exitintentObj; + var exitintentObj; - const showExitIntent = (event, targetObj) => { - let targetingMsgJson; + var showExitIntent = function showExitIntent(event, targetObj) { + var targetingMsgJson; if (event != null && event.clientY > 0) { return; @@ -5613,7 +6214,7 @@ } if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) { - const element = document.getElementById('intentPreview'); + var element = document.getElementById('intentPreview'); element.remove(); document.getElementById('intentOpacityDiv').remove(); } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist @@ -5632,16 +6233,16 @@ return; } - const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; $ct.campaignDivMap[campaignId] = 'intentPreview'; - let legacy = false; - const opacityDiv = document.createElement('div'); + var legacy = false; + var opacityDiv = document.createElement('div'); opacityDiv.id = 'intentOpacityDiv'; - const opacity = targetingMsgJson.display.opacity || 0.7; - const rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + var opacity = targetingMsgJson.display.opacity || 0.7; + var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); document.body.appendChild(opacityDiv); - const msgDiv = document.createElement('div'); + var msgDiv = document.createElement('div'); msgDiv.id = 'intentPreview'; if (targetingMsgJson.display.proto == null) { @@ -5652,15 +6253,15 @@ } document.body.appendChild(msgDiv); - const iframe = document.createElement('iframe'); - const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; + var iframe = document.createElement('iframe'); + var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe-intent'; - const onClick = targetingMsgJson.display.onClick; - let pointerCss = ''; + var onClick = targetingMsgJson.display.onClick; + var pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; @@ -5670,15 +6271,15 @@ iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; } - let html; // direct html + var html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - const css = '' + ''; - let bgColor, textColor, btnBg, btColor; + var css = '' + ''; + var bgColor, textColor, btnBg, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -5692,30 +6293,30 @@ btColor = '#ffffff'; } - const titleText = targetingMsgJson.msgContent.title; - const descriptionText = targetingMsgJson.msgContent.description; - let ctaText = ''; + var titleText = targetingMsgJson.msgContent.title; + var descriptionText = targetingMsgJson.msgContent.description; + var ctaText = ''; if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { ctaText = "'; } - let imageTd = ''; + var imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = "
 + titleText + ' /></div>';
         }
 
-        const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; - const body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; + var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'intentPreview');"; + var title = "
" + "×" + "
" + "
" + titleText + '
'; + var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); // Dispatch event for interstitial/exit intent close - const closeCampaign = new Event('CT_campaign_rendered'); + var closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); if (targetingMsgJson.display['custom-editor']) { @@ -5724,8 +6325,8 @@ iframe.srcdoc = html; - iframe.onload = () => { - const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); + iframe.onload = function () { + var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); }; }; @@ -5744,8 +6345,8 @@ return; } - const processNativeDisplayArr = arrInAppNotifs => { - Object.keys(arrInAppNotifs).map(key => { + var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { + Object.keys(arrInAppNotifs).map(function (key) { var elementId, id; if (arrInAppNotifs[key].display.divId) { @@ -5763,12 +6364,12 @@ }); }; - const addLoadListener = arrInAppNotifs => { - window.addEventListener('load', () => { - let count = 0; + var addLoadListener = function addLoadListener(arrInAppNotifs) { + window.addEventListener('load', function () { + var count = 0; if (count < 20) { - const t = setInterval(() => { + var t = setInterval(function () { processNativeDisplayArr(arrInAppNotifs); if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { @@ -5783,10 +6384,10 @@ }; if (msg.inapp_notifs != null) { - const arrInAppNotifs = {}; + var arrInAppNotifs = {}; - for (let index = 0; index < msg.inapp_notifs.length; index++) { - const targetNotif = msg.inapp_notifs[index]; + for (var index = 0; index < msg.inapp_notifs.length; index++) { + var targetNotif = msg.inapp_notifs[index]; if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { showFooterNotification(targetNotif); @@ -5798,7 +6399,7 @@ // if display['wtarget_type']==2 then web native display if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel - const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); + var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); if (element !== null) { targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); @@ -5823,7 +6424,7 @@ } } - const mergeEventMap = newEvtMap => { + var mergeEventMap = function mergeEventMap(newEvtMap) { if ($ct.globalEventsMap == null) { $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); @@ -5833,10 +6434,10 @@ } } - for (const key in newEvtMap) { + for (var key in newEvtMap) { if (newEvtMap.hasOwnProperty(key)) { - const oldEvtObj = $ct.globalEventsMap[key]; - const newEvtObj = newEvtMap[key]; + var oldEvtObj = $ct.globalEventsMap[key]; + var newEvtObj = newEvtMap[key]; if ($ct.globalEventsMap[key] != null) { if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { @@ -5849,18 +6450,18 @@ } }; - const handleInboxNotifications = () => { + var handleInboxNotifications = function handleInboxNotifications() { if (msg.inbox_preview) { processInboxNotifs(msg); return; } if (msg.inbox_notifs) { - const msgArr = []; + var msgArr = []; - for (let index = 0; index < msg.inbox_notifs.length; index++) { - if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) { - msgArr.push(msg.inbox_notifs[index]); + for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { + if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { + msgArr.push(msg.inbox_notifs[_index]); } } @@ -5880,9 +6481,9 @@ if ($ct.inbox === null) { msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); - initializeWebInbox(_logger).then(() => { + initializeWebInbox(_logger).then(function () { handleInboxNotifications(); - }).catch(e => {}); + }).catch(function (e) {}); } else { handleInboxNotifications(); } @@ -5893,18 +6494,18 @@ return; } - const staleDataUpdate = (staledata, campType) => { - const campObj = getCampaignObject(); - const globalObj = campObj[campType].global; + var staleDataUpdate = function staleDataUpdate(staledata, campType) { + var campObj = getCampaignObject(); + var globalObj = campObj[campType].global; if (globalObj != null && campType) { - for (const idx in staledata) { + for (var idx in staledata) { if (staledata.hasOwnProperty(idx)) { delete globalObj[staledata[idx]]; if (StorageManager.read(CAMP_COOKIE_G)) { - const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); - const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); + var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { delete guidCampObj[guid][campType][staledata[idx]]; @@ -5921,10 +6522,10 @@ if (StorageManager._isLocalStorageSupported()) { try { if (msg.evpr != null) { - const eventsMap = msg.evpr.events; - const profileMap = msg.evpr.profile; - const syncExpiry = msg.evpr.expires_in; - const now = getNow(); + var eventsMap = msg.evpr.events; + var profileMap = msg.evpr.profile; + var syncExpiry = msg.evpr.expires_in; + var now = getNow(); StorageManager.setMetaProp('lsTime', now); StorageManager.setMetaProp('exTs', syncExpiry); mergeEventMap(eventsMap); @@ -5958,11 +6559,12 @@ var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); - class User { - constructor(_ref) { - let { - isPersonalisationActive - } = _ref; + var User = /*#__PURE__*/function () { + function User(_ref) { + var isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, User); + Object.defineProperty(this, _isPersonalisationActive$2, { writable: true, value: void 0 @@ -5970,35 +6572,40 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; } - getTotalVisits() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } - - let visitCount = StorageManager.getMetaProp('sc'); + _createClass(User, [{ + key: "getTotalVisits", + value: function getTotalVisits() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - if (visitCount == null) { - visitCount = 1; - } + var visitCount = StorageManager.getMetaProp('sc'); - return visitCount; - } + if (visitCount == null) { + visitCount = 1; + } - getLastVisit() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; + return visitCount; } + }, { + key: "getLastVisit", + value: function getLastVisit() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - const prevSession = StorageManager.getMetaProp('ps'); + var prevSession = StorageManager.getMetaProp('ps'); - if (prevSession != null) { - return new Date(prevSession * 1000); + if (prevSession != null) { + return new Date(prevSession * 1000); + } } - } + }]); - } + return User; + }(); - const logLevels = { + var logLevels = { DISABLE: 0, ERROR: 1, INFO: 2, @@ -6012,8 +6619,10 @@ var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); - class Logger { - constructor(logLevel) { + var Logger = /*#__PURE__*/function () { + function Logger(logLevel) { + _classCallCheck(this, Logger); + Object.defineProperty(this, _isLegacyDebug, { get: _get_isLegacyDebug, set: void 0 @@ -6030,56 +6639,64 @@ this.wzrkError = {}; } - get logLevel() { - return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; - } - - set logLevel(logLevel) { - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; - } - - error(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { - _classPrivateFieldLooseBase(this, _log)[_log]('error', message); + _createClass(Logger, [{ + key: "error", + value: function error(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { + _classPrivateFieldLooseBase(this, _log)[_log]('error', message); + } } - } - - info(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { - _classPrivateFieldLooseBase(this, _log)[_log]('log', message); + }, { + key: "info", + value: function info(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { + _classPrivateFieldLooseBase(this, _log)[_log]('log', message); + } } - } - - debug(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); + }, { + key: "debug", + value: function debug(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); + } } - } - - debugPE(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); + }, { + key: "debugPE", + value: function debugPE(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); + } } - } - - reportError(code, description) { - this.wzrkError.c = code; - this.wzrkError.d = description; - this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); - } + }, { + key: "reportError", + value: function reportError(code, description) { + this.wzrkError.c = code; + this.wzrkError.d = description; + this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } + }, { + key: "logLevel", + get: function get() { + return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; + }, + set: function set(logLevel) { + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + }]); - } + return Logger; + }(); var _log2 = function _log2(level, message) { if (window.console) { try { - const ts = new Date().getTime(); + var ts = new Date().getTime(); console[level]("CleverTap [".concat(ts, "]: ").concat(message)); } catch (e) {} } }; - var _get_isLegacyDebug = function () { + var _get_isLegacyDebug = function _get_isLegacyDebug() { return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; }; @@ -6089,13 +6706,14 @@ var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); - class SessionManager { + var SessionManager = /*#__PURE__*/function () { // SCOOKIE_NAME - constructor(_ref) { - let { - logger, - isPersonalisationActive - } = _ref; + function SessionManager(_ref) { + var logger = _ref.logger, + isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, SessionManager); + Object.defineProperty(this, _logger$5, { writable: true, value: void 0 @@ -6115,112 +6733,120 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; } - get sessionId() { - return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; - } - - set sessionId(sessionId) { - _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; - } - - getSessionCookieObject() { - let scookieStr = StorageManager.readCookie(this.cookieName); - let obj = {}; + _createClass(SessionManager, [{ + key: "getSessionCookieObject", + value: function getSessionCookieObject() { + var scookieStr = StorageManager.readCookie(this.cookieName); + var obj = {}; - if (scookieStr != null) { - // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera - scookieStr = scookieStr.replace(singleQuoteRegex, '"'); - obj = JSON.parse(scookieStr); + if (scookieStr != null) { + // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera + scookieStr = scookieStr.replace(singleQuoteRegex, '"'); + obj = JSON.parse(scookieStr); - if (!isObject(obj)) { - obj = {}; - } else { - if (typeof obj.t !== 'undefined') { - // check time elapsed since last request - const lastTime = obj.t; - const now = getNow(); - - if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { - // adding 60 seconds to compensate for in-journey requests - // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read - // hence we shouldn't use it. - obj = {}; + if (!isObject(obj)) { + obj = {}; + } else { + if (typeof obj.t !== 'undefined') { + // check time elapsed since last request + var lastTime = obj.t; + var now = getNow(); + + if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { + // adding 60 seconds to compensate for in-journey requests + // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read + // hence we shouldn't use it. + obj = {}; + } } } } - } - this.scookieObj = obj; - return obj; - } - - setSessionCookieObject(obj) { - const objStr = JSON.stringify(obj); - StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); - } - - manageSession(session) { - // first time. check if current session id in localstorage is same - // if not same then prev = current and current = this new session - if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { - const currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both - - if (typeof currentSessionInLS === 'undefined') { - StorageManager.setMetaProp('ps', session); - StorageManager.setMetaProp('cs', session); - StorageManager.setMetaProp('sc', 1); - } else if (currentSessionInLS !== session) { - // not same as session in local storage. new session - StorageManager.setMetaProp('ps', currentSessionInLS); - StorageManager.setMetaProp('cs', session); - let sessionCount = StorageManager.getMetaProp('sc'); + this.scookieObj = obj; + return obj; + } + }, { + key: "setSessionCookieObject", + value: function setSessionCookieObject(obj) { + var objStr = JSON.stringify(obj); + StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); + } + }, { + key: "manageSession", + value: function manageSession(session) { + // first time. check if current session id in localstorage is same + // if not same then prev = current and current = this new session + if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { + var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + + if (typeof currentSessionInLS === 'undefined') { + StorageManager.setMetaProp('ps', session); + StorageManager.setMetaProp('cs', session); + StorageManager.setMetaProp('sc', 1); + } else if (currentSessionInLS !== session) { + // not same as session in local storage. new session + StorageManager.setMetaProp('ps', currentSessionInLS); + StorageManager.setMetaProp('cs', session); + var sessionCount = StorageManager.getMetaProp('sc'); + + if (typeof sessionCount === 'undefined') { + sessionCount = 0; + } - if (typeof sessionCount === 'undefined') { - sessionCount = 0; + StorageManager.setMetaProp('sc', sessionCount + 1); } - StorageManager.setMetaProp('sc', sessionCount + 1); + this.sessionId = session; } - - this.sessionId = session; - } - } - - getTimeElapsed() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; } + }, { + key: "getTimeElapsed", + value: function getTimeElapsed() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - if (this.scookieObj != null) { - // TODO: check logic? - this.scookieObj = this.getSessionCookieObject(); - } + if (this.scookieObj != null) { + // TODO: check logic? + this.scookieObj = this.getSessionCookieObject(); + } - const sessionStart = this.scookieObj.s; + var sessionStart = this.scookieObj.s; - if (sessionStart != null) { - const ts = getNow(); - return Math.floor(ts - sessionStart); + if (sessionStart != null) { + var ts = getNow(); + return Math.floor(ts - sessionStart); + } } - } + }, { + key: "getPageCount", + value: function getPageCount() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - getPageCount() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } + if (this.scookieObj != null) { + // TODO: check logic + this.scookieObj = this.getSessionCookieObject(); + } - if (this.scookieObj != null) { - // TODO: check logic - this.scookieObj = this.getSessionCookieObject(); + return this.scookieObj.p; } + }, { + key: "sessionId", + get: function get() { + return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; + }, + set: function set(sessionId) { + _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + } + }]); - return this.scookieObj.p; - } - - } + return SessionManager; + }(); - let seqNo = 0; - let requestTime = 0; + var seqNo = 0; + var requestTime = 0; var _logger$6 = _classPrivateFieldLooseKey("logger"); @@ -6236,15 +6862,16 @@ var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); - class RequestManager { - constructor(_ref) { - let { - logger, - account, - device, - session, - isPersonalisationActive - } = _ref; + var RequestManager = /*#__PURE__*/function () { + function RequestManager(_ref) { + var logger = _ref.logger, + account = _ref.account, + device = _ref.device, + session = _ref.session, + isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, RequestManager); + Object.defineProperty(this, _addToLocalEventMap, { value: _addToLocalEventMap2 }); @@ -6283,222 +6910,234 @@ RequestDispatcher.account = account; } - processBackupEvents() { - const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); + _createClass(RequestManager, [{ + key: "processBackupEvents", + value: function processBackupEvents() { + var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); - if (typeof backupMap === 'undefined' || backupMap === null) { - return; - } + if (typeof backupMap === 'undefined' || backupMap === null) { + return; + } - this.processingBackup = true; + this.processingBackup = true; - for (const idx in backupMap) { - if (backupMap.hasOwnProperty(idx)) { - const backupEvent = backupMap[idx]; + for (var idx in backupMap) { + if (backupMap.hasOwnProperty(idx)) { + var backupEvent = backupMap[idx]; - if (typeof backupEvent.fired === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); + if (typeof backupEvent.fired === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); - if (typeof backupEvent.q !== 'undefined') { - RequestDispatcher.fireRequest(backupEvent.q); - } + if (typeof backupEvent.q !== 'undefined') { + RequestDispatcher.fireRequest(backupEvent.q); + } - backupEvent.fired = true; + backupEvent.fired = true; + } } } - } - - StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); - this.processingBackup = false; - } - - addSystemDataToObject(dataObject, ignoreTrim) { - // ignore trim for chrome notifications; undefined everywhere else - if (typeof ignoreTrim === 'undefined') { - dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - } - - if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { - dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; - } - - dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { - dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); + this.processingBackup = false; } + }, { + key: "addSystemDataToObject", + value: function addSystemDataToObject(dataObject, ignoreTrim) { + // ignore trim for chrome notifications; undefined everywhere else + if (typeof ignoreTrim === 'undefined') { + dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + } - const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { + dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; + } - dataObject.s = obj.s; // session cookie + dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { + dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + } - let proto = document.location.protocol; - proto = proto.replace(':', ''); - dataObject.af = { ...dataObject.af, - lib: 'web-sdk-v1.9.6', - protocol: proto, - ...$ct.flutterVersion - }; // app fields + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - if (sessionStorage.hasOwnProperty('WZRK_D')) { - dataObject.debug = true; - } + dataObject.s = obj.s; // session cookie - return dataObject; - } + dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count - addFlags(data) { - // check if cookie should be cleared. - _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); + var proto = document.location.protocol; + proto = proto.replace(':', ''); + dataObject.af = _objectSpread2(_objectSpread2({}, dataObject.af), {}, { + lib: 'web-sdk-v1.9.6', + protocol: proto + }, $ct.flutterVersion); // app fields - if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { - data.rc = true; + if (sessionStorage.hasOwnProperty('WZRK_D')) { + dataObject.debug = true; + } - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); + return dataObject; } + }, { + key: "addFlags", + value: function addFlags(data) { + // check if cookie should be cleared. + _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { - const lastSyncTime = StorageManager.getMetaProp('lsTime'); - const expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server + if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { + data.rc = true; - if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { - data.dsync = true; - return; + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); } - const now = getNow(); // last sync time has expired - get fresh data from server + if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { + var lastSyncTime = StorageManager.getMetaProp('lsTime'); + var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server - if (lastSyncTime + expirySeconds < now) { - data.dsync = true; - } - } - } // saves url to backup cache and fires the request + if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { + data.dsync = true; + return; + } - /** - * - * @param {string} url - * @param {boolean} override whether the request can go through or not - * @param {Boolean} sendOULFlag - true in case of a On User Login request - */ + var now = getNow(); // last sync time has expired - get fresh data from server + if (lastSyncTime + expirySeconds < now) { + data.dsync = true; + } + } + } // saves url to backup cache and fires the request - saveAndFireRequest(url, override, sendOULFlag, evtName) { - const now = getNow(); - url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); - const data = url + '&i=' + now + '&sn=' + seqNo; - StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return + /** + * + * @param {string} url + * @param {boolean} override whether the request can go through or not + * @param {Boolean} sendOULFlag - true in case of a On User Login request + */ - if ($ct.offline) return; // if there is no override - // and an OUL request is not in progress - // then process the request as it is - // else block the request - // note - $ct.blockRequest should ideally be used for override + }, { + key: "saveAndFireRequest", + value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { + var now = getNow(); + url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); + var data = url + '&i=' + now + '&sn=' + seqNo; + StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return + + if ($ct.offline) return; // if there is no override + // and an OUL request is not in progress + // then process the request as it is + // else block the request + // note - $ct.blockRequest should ideally be used for override + + if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { + if (now === requestTime) { + seqNo++; + } else { + requestTime = now; + seqNo = 0; + } - if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { - if (now === requestTime) { - seqNo++; + window.oulReqN = $ct.globalCache.REQ_N; + RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); } else { - requestTime = now; - seqNo = 0; + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - - window.oulReqN = $ct.globalCache.REQ_N; - RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); - } else { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - } - - unregisterTokenForGuid(givenGUID) { - const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - - if (payload) { - const data = {}; - data.type = 'data'; - - if (isValueValid(givenGUID)) { - data.g = givenGUID; - } + }, { + key: "unregisterTokenForGuid", + value: function unregisterTokenForGuid(givenGUID) { + var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - data.action = 'unregister'; - data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + if (payload) { + var data = {}; + data.type = 'data'; - const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - - data.s = obj.s; // session cookie + if (isValueValid(givenGUID)) { + data.g = givenGUID; + } - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + data.action = 'unregister'; + data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - RequestDispatcher.fireRequest(pageLoadUrl, true); - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); - } // REGISTER TOKEN + data.s = obj.s; // session cookie + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - this.registerToken(payload); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - registerToken(payload) { - if (!payload) return; // add gcookie etc to the payload + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + RequestDispatcher.fireRequest(pageLoadUrl, true); + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); + } // REGISTER TOKEN - payload = this.addSystemDataToObject(payload, true); - payload = JSON.stringify(payload); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + this.registerToken(payload); + } + }, { + key: "registerToken", + value: function registerToken(payload) { + if (!payload) return; // add gcookie etc to the payload - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); - RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage + payload = this.addSystemDataToObject(payload, true); + payload = JSON.stringify(payload); - StorageManager.save(WEBPUSH_LS_KEY, 'ok'); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - processEvent(data) { - _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); + RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage - data = this.addSystemDataToObject(data, undefined); - this.addFlags(data); - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + StorageManager.save(WEBPUSH_LS_KEY, 'ok'); + } + }, { + key: "processEvent", + value: function processEvent(data) { + _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + data = this.addSystemDataToObject(data, undefined); + this.addFlags(data); + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - post(url, body) { - return fetch(url, { - method: 'post', - headers: { - 'Content-Type': 'application/json' - }, - body: body - }).then(response => { - if (response.ok) { - return response.json(); - } + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); + } + }, { + key: "post", + value: function post(url, body) { + var _this = this; + + return fetch(url, { + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: body + }).then(function (response) { + if (response.ok) { + return response.json(); + } - throw response; - }).then(data => { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Sync data successful', data); + throw response; + }).then(function (data) { + _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Sync data successful', data); - return data; - }).catch(e => { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + return data; + }).catch(function (e) { + _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Error in syncing variables', e); - throw e; - }); - } + throw e; + }); + } + }]); - } + return RequestManager; + }(); var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { if (StorageManager._isLocalStorageSupported()) { @@ -6510,8 +7149,8 @@ } } - const nowTs = getNow(); - let evtDetail = $ct.globalEventsMap[evtName]; + var nowTs = getNow(); + var evtDetail = $ct.globalEventsMap[evtName]; if (typeof evtDetail !== 'undefined') { evtDetail[2] = nowTs; @@ -6538,70 +7177,85 @@ var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); - class Privacy extends Array { - constructor(_ref, values) { - let { - request, - account, - logger - } = _ref; - super(); - Object.defineProperty(this, _processPrivacyArray, { + var Privacy = /*#__PURE__*/function (_Array) { + _inherits(Privacy, _Array); + + var _super = _createSuper(Privacy); + + function Privacy(_ref, values) { + var _this; + + var request = _ref.request, + account = _ref.account, + logger = _ref.logger; + + _classCallCheck(this, Privacy); + + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { value: _processPrivacyArray2 }); - Object.defineProperty(this, _request$4, { + Object.defineProperty(_assertThisInitialized(_this), _request$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _account$3, { + Object.defineProperty(_assertThisInitialized(_this), _account$3, { writable: true, value: void 0 }); - Object.defineProperty(this, _oldValues$3, { + Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { writable: true, value: void 0 }); - Object.defineProperty(this, _logger$7, { + Object.defineProperty(_assertThisInitialized(_this), _logger$7, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7] = logger; - _classPrivateFieldLooseBase(this, _request$4)[_request$4] = request; - _classPrivateFieldLooseBase(this, _account$3)[_account$3] = account; - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = values; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$7)[_logger$7] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$3)[_account$3] = account; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; + return _this; } - push() { - for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { - privacyArr[_key] = arguments[_key]; - } + _createClass(Privacy, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { + privacyArr[_key] = arguments[_key]; + } - if ($ct.isPrivacyArrPushed) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); - } else { - $ct.privacyArray.push(...privacyArr); - } + if ($ct.isPrivacyArrPushed) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); + } else { + var _$ct$privacyArray; - return 0; - } + (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); + } - _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); + return 0; } + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); + } - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; - } + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; + } + }]); - } + return Privacy; + }( /*#__PURE__*/_wrapNativeSuper(Array)); var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { if (Array.isArray(privacyArr) && privacyArr.length > 0) { - const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, - ...curr - }), {}); - let data = {}; - const profileObj = {}; + var privacyObj = privacyArr.reduce(function (prev, curr) { + return _objectSpread2(_objectSpread2({}, prev), curr); + }, {}); + var data = {}; + var profileObj = {}; var optOut = false; if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { @@ -6615,8 +7269,8 @@ } if (privacyObj.hasOwnProperty(USEIP_KEY)) { - const useIP = privacyObj[USEIP_KEY]; - const shouldUseIP = typeof useIP === 'boolean' ? useIP : false; + var useIP = privacyObj[USEIP_KEY]; + var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); } @@ -6624,9 +7278,9 @@ data.type = 'profile'; data.profile = profileObj; data = _classPrivateFieldLooseBase(this, _request$4)[_request$4].addSystemDataToObject(data, undefined); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -6667,104 +7321,118 @@ var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); - class NotificationHandler extends Array { - constructor(_ref, values) { - let { - logger, - session, - request, - account - } = _ref; - super(); - Object.defineProperty(this, _handleNotificationRegistration, { + var NotificationHandler = /*#__PURE__*/function (_Array) { + _inherits(NotificationHandler, _Array); + + var _super = _createSuper(NotificationHandler); + + function NotificationHandler(_ref, values) { + var _this; + + var logger = _ref.logger, + session = _ref.session, + request = _ref.request, + account = _ref.account; + + _classCallCheck(this, NotificationHandler); + + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { value: _handleNotificationRegistration2 }); - Object.defineProperty(this, _removeWizAlertJS, { + Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { value: _removeWizAlertJS2 }); - Object.defineProperty(this, _addWizAlertJS, { + Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { value: _addWizAlertJS2 }); - Object.defineProperty(this, _setUpChromeFirefoxNotifications, { + Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { value: _setUpChromeFirefoxNotifications2 }); - Object.defineProperty(this, _setUpSafariNotifications, { + Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { value: _setUpSafariNotifications2 }); - Object.defineProperty(this, _setApplicationServerKey, { + Object.defineProperty(_assertThisInitialized(_this), _setApplicationServerKey, { value: _setApplicationServerKey2 }); - Object.defineProperty(this, _setUpWebPushNotifications, { + Object.defineProperty(_assertThisInitialized(_this), _setUpWebPushNotifications, { value: _setUpWebPushNotifications2 }); - Object.defineProperty(this, _setUpWebPush, { + Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { value: _setUpWebPush2 }); - Object.defineProperty(this, _oldValues$4, { + Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _logger$8, { + Object.defineProperty(_assertThisInitialized(_this), _logger$8, { writable: true, value: void 0 }); - Object.defineProperty(this, _request$5, { + Object.defineProperty(_assertThisInitialized(_this), _request$5, { writable: true, value: void 0 }); - Object.defineProperty(this, _account$4, { + Object.defineProperty(_assertThisInitialized(_this), _account$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _wizAlertJSPath, { + Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { writable: true, value: void 0 }); - Object.defineProperty(this, _fcmPublicKey, { + Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; - _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = null; - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = values; - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8] = logger; - _classPrivateFieldLooseBase(this, _request$5)[_request$5] = request; - _classPrivateFieldLooseBase(this, _account$4)[_account$4] = account; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; + return _this; } - push() { - for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { - displayArgs[_key] = arguments[_key]; - } - - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); + _createClass(NotificationHandler, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { + displayArgs[_key] = arguments[_key]; + } - return 0; - } + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + return 0; } + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + } - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; - } - - _enableWebPush(enabled, applicationServerKey) { - $ct.webPushEnabled = enabled; - - if (applicationServerKey != null) { - _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; } + }, { + key: "_enableWebPush", + value: function _enableWebPush(enabled, applicationServerKey) { + $ct.webPushEnabled = enabled; + + if (applicationServerKey != null) { + _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); + } - if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); - } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); + } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + } } - } + }]); - } + return NotificationHandler; + }( /*#__PURE__*/_wrapNativeSuper(Array)); var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { if ($ct.webPushEnabled && displayArgs.length > 0) { @@ -6790,6 +7458,8 @@ }; var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { + var _this2 = this; + // ensure that proper arguments are passed if (typeof apnsWebPushId === 'undefined') { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that APNS Web Push ID is supplied'); @@ -6800,70 +7470,82 @@ } if ('safari' in window && 'pushNotification' in window.safari) { - window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, subscription => { + window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { if (subscription.permission === 'granted') { - const subscriptionData = JSON.parse(JSON.stringify(subscription)); + var subscriptionData = JSON.parse(JSON.stringify(subscription)); subscriptionData.endpoint = subscription.deviceToken; subscriptionData.browser = 'Safari'; StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(_this2, _request$5)[_request$5].registerToken(subscriptionData); - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); + _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); } else if (subscription.permission === 'denied') { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); + _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); } }); } }; var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { - let registrationScope = ''; + var _this3 = this; + + var registrationScope = ''; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(serviceWorkerPath).then(registration => { + navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. // hence add a timeout and hope serviceWroker is ready within that time. - return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); } registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS // OR getRegistrations PROMISE IF ITS FIREFOX - const rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; - const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); + var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; + var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); if (isServiceWorkerAtRoot) { return navigator.serviceWorker.ready; } else { if (navigator.userAgent.indexOf('Chrome') !== -1) { - return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); } else { return navigator.serviceWorker.getRegistrations(); } } - }).then(serviceWorkerRegistration => { + }).then(function (serviceWorkerRegistration) { // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { - serviceWorkerRegistration = serviceWorkerRegistration.filter(i => i.scope === registrationScope)[0]; + serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { + return i.scope === registrationScope; + })[0]; } - const subscribeObj = { + var subscribeObj = { userVisibleOnly: true }; - if (_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] != null) { - subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey]); + if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { + subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); } - serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(subscription => { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC + serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { + _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC - const subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token + var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token if (navigator.userAgent.indexOf('Chrome') !== -1) { subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); @@ -6875,39 +7557,39 @@ StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(_this3, _request$5)[_request$5].registerToken(subscriptionData); if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { subscriptionCallback(); } - }).catch(error => { + }).catch(function (error) { // unsubscribe from webpush if error - serviceWorkerRegistration.pushManager.getSubscription().then(subscription => { + serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { if (subscription !== null) { - subscription.unsubscribe().then(successful => { + subscription.unsubscribe().then(function (successful) { // You've successfully unsubscribed - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Unsubscription successful'); + _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Unsubscription successful'); window.clevertap.notifications.push({ skipDialog: true }); - }).catch(e => { + }).catch(function (e) { // Unsubscription failed - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); + _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); }); } }); - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error subscribing: ' + error); + _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error subscribing: ' + error); }); - }).catch(err => { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('error registering service worker: ' + err); + }).catch(function (err) { + _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('error registering service worker: ' + err); }); } }; var _addWizAlertJS2 = function _addWizAlertJS2() { - const scriptTag = document.createElement('script'); + var scriptTag = document.createElement('script'); scriptTag.setAttribute('type', 'text/javascript'); scriptTag.setAttribute('id', 'wzrk-alert-js'); scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body @@ -6917,31 +7599,33 @@ }; var _removeWizAlertJS2 = function _removeWizAlertJS2() { - const scriptTag = document.getElementById('wzrk-alert-js'); + var scriptTag = document.getElementById('wzrk-alert-js'); scriptTag.parentNode.removeChild(scriptTag); }; var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { + var _this4 = this; + // make sure everything is specified - let titleText; - let bodyText; - let okButtonText; - let rejectButtonText; - let okButtonColor; - let skipDialog; - let askAgainTimeInSeconds; - let okCallback; - let rejectCallback; - let subscriptionCallback; - let serviceWorkerPath; - let httpsPopupPath; - let httpsIframePath; - let apnsWebPushId; - let apnsWebPushServiceUrl; + var titleText; + var bodyText; + var okButtonText; + var rejectButtonText; + var okButtonColor; + var skipDialog; + var askAgainTimeInSeconds; + var okCallback; + var rejectCallback; + var subscriptionCallback; + var serviceWorkerPath; + var httpsPopupPath; + var httpsIframePath; + var apnsWebPushId; + var apnsWebPushServiceUrl; if (displayArgs.length === 1) { if (isObject(displayArgs[0])) { - const notifObj = displayArgs[0]; + var notifObj = displayArgs[0]; titleText = notifObj.titleText; bodyText = notifObj.bodyText; okButtonText = notifObj.okButtonText; @@ -6981,7 +7665,7 @@ return; } - const isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications + var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Make sure you are https or localhost to register for notifications'); @@ -6991,19 +7675,19 @@ if (navigator.userAgent.indexOf('Chrome') !== -1) { - const chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); + var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - const firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); + var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Safari') !== -1) { - const safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); + var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return; @@ -7049,7 +7733,7 @@ } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds - const now = new Date().getTime() / 1000; + var now = new Date().getTime() / 1000; if (StorageManager.getMetaProp('notif_last_time') == null) { StorageManager.setMetaProp('notif_last_time', now); @@ -7069,13 +7753,13 @@ if (isHTTP) { // add the https iframe - const httpsIframe = document.createElement('iframe'); + var httpsIframe = document.createElement('iframe'); httpsIframe.setAttribute('style', 'display:none;'); httpsIframe.setAttribute('src', httpsIframePath); document.body.appendChild(httpsIframe); - window.addEventListener('message', event => { + window.addEventListener('message', function (event) { if (event.data != null) { - let obj = {}; + var obj = {}; try { obj = JSON.parse(event.data); @@ -7086,7 +7770,7 @@ if (obj.state != null) { if (obj.from === 'ct' && obj.state === 'not') { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { + _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7094,7 +7778,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, enabled => { + }, function (enabled) { // callback function if (enabled) { // the user accepted on the dialog box @@ -7110,7 +7794,7 @@ } } - _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7118,7 +7802,7 @@ } }, false); } else { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7126,7 +7810,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, enabled => { + }, function (enabled) { // callback function if (enabled) { // the user accepted on the dialog box @@ -7134,14 +7818,14 @@ okCallback(); } - _classPrivateFieldLooseBase(this, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + _classPrivateFieldLooseBase(_this4, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); } else { if (typeof rejectCallback === 'function') { rejectCallback(); } } - _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7149,7 +7833,7 @@ var _variableStore = _classPrivateFieldLooseKey("variableStore"); - class Variable { + var Variable = /*#__PURE__*/function () { /** * Creates an instance of the Variable class. * @@ -7162,10 +7846,11 @@ * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally). * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes. */ - constructor(_ref) { - let { - variableStore - } = _ref; + function Variable(_ref) { + var variableStore = _ref.variableStore; + + _classCallCheck(this, Variable); + Object.defineProperty(this, _variableStore, { writable: true, value: void 0 @@ -7179,138 +7864,151 @@ _classPrivateFieldLooseBase(this, _variableStore)[_variableStore] = variableStore; } - getValue() { - return this.value; - } - - getdefaultValue() { - return this.defaultValue; - } - /** - * Defines a new variable with the provided name, default value, and variable store. - * @static - * @param {string} name - The name of the variable. - * @param {*} defaultValue - The default value of the variable. - * @param {VariableStore} variableStore - The VariableStore instance for registration. - * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. - */ - - - static define(name, defaultValue, variableStore) { - if (!name || typeof name !== 'string') { - console.error('Empty or invalid name parameter provided.'); - return null; + _createClass(Variable, [{ + key: "getValue", + value: function getValue() { + return this.value; } - - if (name.startsWith('.') || name.endsWith('.')) { - console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); - return null; + }, { + key: "getdefaultValue", + value: function getdefaultValue() { + return this.defaultValue; } + /** + * Defines a new variable with the provided name, default value, and variable store. + * @static + * @param {string} name - The name of the variable. + * @param {*} defaultValue - The default value of the variable. + * @param {VariableStore} variableStore - The VariableStore instance for registration. + * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. + */ - const typeOfDefaultValue = typeof defaultValue; + }, { + key: "update", - if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { - console.error('Only primitive types (string, number, boolean) are accepted as value'); - return null; - } + /** + * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. + * @param {*} newValue - The new value to be assigned to the variable. + */ + value: function update(newValue) { + var oldValue = this.value; + this.value = newValue; + + if (newValue === null && oldValue === null) { + return; + } - const existing = variableStore.getVariable(name); + if (newValue !== null && newValue === oldValue && this.hadStarted) { + return; + } - if (existing) { - return existing; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + this.hadStarted = true; + this.triggerValueChanged(); + } } + /** + * Invokes all registered callbacks when the variable value changes. + */ - const varInstance = new Variable({ - variableStore - }); + }, { + key: "triggerValueChanged", + value: function triggerValueChanged() { + var _this = this; - try { - varInstance.name = name; - varInstance.defaultValue = defaultValue; - varInstance.value = defaultValue; - varInstance.type = typeOfDefaultValue; - variableStore.registerVariable(varInstance); - varInstance.update(defaultValue); - } catch (error) { - console.error(error); + this.valueChangedCallbacks.forEach(function (onValueChanged) { + onValueChanged(_this); + }); } + /** + * Adds a callback function to the array and triggers it immediately if variable requests have completed. + * @param {Function} onValueChanged - The callback function to be added. + */ - return varInstance; - } - /** - * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. - * @param {*} newValue - The new value to be assigned to the variable. - */ - + }, { + key: "addValueChangedCallback", + value: function addValueChangedCallback(onValueChanged) { + if (!onValueChanged) { + console.log('Invalid callback parameter provided.'); + return; + } - update(newValue) { - const oldValue = this.value; - this.value = newValue; + this.valueChangedCallbacks.push(onValueChanged); - if (newValue === null && oldValue === null) { - return; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + onValueChanged(this); + } } + /** + * Removes a callback function from the array. + * @param {Function} onValueChanged - The callback function to be removed. + */ - if (newValue !== null && newValue === oldValue && this.hadStarted) { - return; - } + }, { + key: "removeValueChangedCallback", + value: function removeValueChangedCallback(onValueChanged) { + var index = this.valueChangedCallbacks.indexOf(onValueChanged); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - this.hadStarted = true; - this.triggerValueChanged(); + if (index !== -1) { + this.valueChangedCallbacks.splice(index, 1); + } } - } - /** - * Invokes all registered callbacks when the variable value changes. - */ + /** + * Resets the `hadStarted` flag to false. + */ + }, { + key: "clearStartFlag", + value: function clearStartFlag() { + this.hadStarted = false; + } + }], [{ + key: "define", + value: function define(name, defaultValue, variableStore) { + if (!name || typeof name !== 'string') { + console.error('Empty or invalid name parameter provided.'); + return null; + } - triggerValueChanged() { - this.valueChangedCallbacks.forEach(onValueChanged => { - onValueChanged(this); - }); - } - /** - * Adds a callback function to the array and triggers it immediately if variable requests have completed. - * @param {Function} onValueChanged - The callback function to be added. - */ + if (name.startsWith('.') || name.endsWith('.')) { + console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); + return null; + } + var typeOfDefaultValue = _typeof(defaultValue); - addValueChangedCallback(onValueChanged) { - if (!onValueChanged) { - console.log('Invalid callback parameter provided.'); - return; - } + if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { + console.error('Only primitive types (string, number, boolean) are accepted as value'); + return null; + } - this.valueChangedCallbacks.push(onValueChanged); + var existing = variableStore.getVariable(name); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - onValueChanged(this); - } - } - /** - * Removes a callback function from the array. - * @param {Function} onValueChanged - The callback function to be removed. - */ + if (existing) { + return existing; + } + var varInstance = new Variable({ + variableStore: variableStore + }); - removeValueChangedCallback(onValueChanged) { - const index = this.valueChangedCallbacks.indexOf(onValueChanged); + try { + varInstance.name = name; + varInstance.defaultValue = defaultValue; + varInstance.value = defaultValue; + varInstance.type = typeOfDefaultValue; + variableStore.registerVariable(varInstance); + varInstance.update(defaultValue); + } catch (error) { + console.error(error); + } - if (index !== -1) { - this.valueChangedCallbacks.splice(index, 1); + return varInstance; } - } - /** - * Resets the `hadStarted` flag to false. - */ - - - clearStartFlag() { - this.hadStarted = false; - } + }]); - } + return Variable; + }(); var _logger$9 = _classPrivateFieldLooseKey("logger"); @@ -7334,14 +8032,15 @@ var _runVariablesChangedCallback = _classPrivateFieldLooseKey("runVariablesChangedCallback"); - class VariableStore { - constructor(_ref) { - let { - logger, - request, - account, - event - } = _ref; + var VariableStore = /*#__PURE__*/function () { + function VariableStore(_ref) { + var logger = _ref.logger, + request = _ref.request, + account = _ref.account, + event = _ref.event; + + _classCallCheck(this, VariableStore); + Object.defineProperty(this, _runVariablesChangedCallback, { value: _runVariablesChangedCallback2 }); @@ -7401,178 +8100,211 @@ */ - registerVariable(varInstance) { - const { - name - } = varInstance; - _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; - console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); - } - /** - * Retrieves a variable by its name. - * @param {string} name - The name of the variable to retrieve. - * @returns {Object} - The variable instance. - */ - - - getVariable(name) { - return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; - } - - hasVarsRequestCompleted() { - return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; - } - /** - * Synchronizes variables with the server. - * @param {Function} onSyncSuccess - Callback function on successful synchronization. - * @param {Function} onSyncFailure - Callback function on synchronization failure. - * @throws Will throw an error if the account token is missing. - * @returns {Promise} - The result of the synchronization request. - */ + _createClass(VariableStore, [{ + key: "registerVariable", + value: function registerVariable(varInstance) { + var name = varInstance.name; + _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; + console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); + } + /** + * Retrieves a variable by its name. + * @param {string} name - The name of the variable to retrieve. + * @returns {Object} - The variable instance. + */ + }, { + key: "getVariable", + value: function getVariable(name) { + return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; + } + }, { + key: "hasVarsRequestCompleted", + value: function hasVarsRequestCompleted() { + return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; + } + /** + * Synchronizes variables with the server. + * @param {Function} onSyncSuccess - Callback function on successful synchronization. + * @param {Function} onSyncFailure - Callback function on synchronization failure. + * @throws Will throw an error if the account token is missing. + * @returns {Promise} - The result of the synchronization request. + */ - syncVariables(onSyncSuccess, onSyncFailure) { - if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { - const m = 'Account token is missing.'; + }, { + key: "syncVariables", + value: function syncVariables(onSyncSuccess, onSyncFailure) { + var _this = this; - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { + var m = 'Account token is missing.'; - return Promise.reject(new Error(m)); - } + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); - const payload = { - type: 'varsPayload', - vars: {} - }; + return Promise.reject(new Error(m)); + } - for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - payload.vars[name] = { - defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, - type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type + var payload = { + type: 'varsPayload', + vars: {} }; - } // Check if payload.vars is empty - - if (Object.keys(payload.vars).length === 0) { - const m = 'No variables are defined.'; - - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + payload.vars[name] = { + defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, + type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type + }; + } // Check if payload.vars is empty - return Promise.reject(new Error(m)); - } - let meta = {}; - meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); - meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; - meta.type = 'meta'; - const body = JSON.stringify([meta, payload]); + if (Object.keys(payload.vars).length === 0) { + var _m = 'No variables are defined.'; - const url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(_m); - return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(r => { - if (onSyncSuccess && typeof onSyncSuccess === 'function') { - onSyncSuccess(r); + return Promise.reject(new Error(_m)); } - return r; - }).catch(e => { - if (onSyncFailure && typeof onSyncFailure === 'function') { - onSyncFailure(e); - } + var meta = {}; + meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); + meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; + meta.type = 'meta'; + var body = JSON.stringify([meta, payload]); - if (e.status === 400) { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); - } else if (e.status === 401) { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('This is not a test profile'); - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Sync variable failed'); - } + var url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; - throw e; - }); - } - /** - * Fetches variables from the server. - * @param {Function} onFetchCallback - Callback function on fetch completion. - */ + return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(function (r) { + if (onSyncSuccess && typeof onSyncSuccess === 'function') { + onSyncSuccess(r); + } + return r; + }).catch(function (e) { + if (onSyncFailure && typeof onSyncFailure === 'function') { + onSyncFailure(e); + } - fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { - t: 4 - }); + if (e.status === 400) { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); + } else if (e.status === 401) { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('This is not a test profile'); + } else { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Sync variable failed'); + } - if (onFetchCallback && typeof onFetchCallback === 'function') { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; + throw e; + }); } - } + /** + * Fetches variables from the server. + * @param {Function} onFetchCallback - Callback function on fetch completion. + */ - mergeVariables(vars) { - console.log('msg vars is ', vars); - _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; - StorageManager.saveToLSorCookie(VARIABLES, vars); - _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; + }, { + key: "fetchVariables", + value: function fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { + t: 4 + }); - for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - if (vars.hasOwnProperty(name)) { - _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); + if (onFetchCallback && typeof onFetchCallback === 'function') { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; } } + }, { + key: "mergeVariables", + value: function mergeVariables(vars) { + console.log('msg vars is ', vars); + _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; + StorageManager.saveToLSorCookie(VARIABLES, vars); + _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); - } - - _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); - } - - addVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); + for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + if (vars.hasOwnProperty(name)) { + _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); + } + } - if (this.hasVarsRequestCompleted()) { - callback(); + if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); } - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); + + _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); } - } + }, { + key: "addVariablesChangedCallback", + value: function addVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); - addOneTimeVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - if (this.hasVarsRequestCompleted()) { - callback(); + if (this.hasVarsRequestCompleted()) { + callback(); + } } else { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); } } - } - - removeVariablesChangedCallback(callback) { - const index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - - if (index !== -1) { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + }, { + key: "addOneTimeVariablesChangedCallback", + value: function addOneTimeVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + if (this.hasVarsRequestCompleted()) { + callback(); + } else { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); + } + } } - } + }, { + key: "removeVariablesChangedCallback", + value: function removeVariablesChangedCallback(callback) { + var index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - removeOneTimeVariablesChangedCallback(callback) { - const index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + } + } + }, { + key: "removeOneTimeVariablesChangedCallback", + value: function removeOneTimeVariablesChangedCallback(callback) { + var index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); - if (index !== -1) { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); + } } - } + }]); - } + return VariableStore; + }(); var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { - for (var callback of _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]) { - callback(); + var _iterator = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var callback = _step.value; + callback(); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } - for (var callBack of _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]) { - callBack(); + var _iterator2 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var callBack = _step2.value; + callBack(); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].length = 0; @@ -7616,40 +8348,50 @@ var _sendLocationData = _classPrivateFieldLooseKey("sendLocationData"); - class CleverTap { - get spa() { - return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; - } - - set spa(value) { - const isSpa = value === true; - - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // if clevertap.spa is changed after init has been called then update the click listeners - if (isSpa) { - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + var CleverTap = /*#__PURE__*/function () { + _createClass(CleverTap, [{ + key: "spa", + get: function get() { + return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; + }, + set: function set(value) { + var isSpa = value === true; + + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // if clevertap.spa is changed after init has been called then update the click listeners + if (isSpa) { + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } } - } - _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; - } + _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; + } + }, { + key: "dismissSpamControl", + get: function get() { + return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; + }, + set: function set(value) { + var dismissSpamControl = value === true; + _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; + $ct.dismissSpamControl = dismissSpamControl; + } + }]); - get dismissSpamControl() { - return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; - } + function CleverTap() { + var _clevertap$account, + _clevertap$account2, + _clevertap$account3, + _clevertap$account4, + _this = this, + _clevertap$account5; - set dismissSpamControl(value) { - const dismissSpamControl = value === true; - _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; - $ct.dismissSpamControl = dismissSpamControl; - } + var clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - constructor() { - var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5; + _classCallCheck(this, CleverTap); - let clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; Object.defineProperty(this, _sendLocationData, { value: _sendLocationData2 }); @@ -7725,7 +8467,7 @@ _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 0; this._isPersonalisationActive = this._isPersonalisationActive.bind(this); - this.raiseNotificationClicked = () => {}; + this.raiseNotificationClicked = function () {}; _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] = new Logger(logLevels.INFO); _classPrivateFieldLooseBase(this, _account$6)[_account$6] = new Account((_clevertap$account = clevertap.account) === null || _clevertap$account === void 0 ? void 0 : _clevertap$account[0], clevertap.region || ((_clevertap$account2 = clevertap.account) === null || _clevertap$account2 === void 0 ? void 0 : _clevertap$account2[1]), clevertap.targetDomain || ((_clevertap$account3 = clevertap.account) === null || _clevertap$account3 === void 0 ? void 0 : _clevertap$account3[2]), clevertap.token || ((_clevertap$account4 = clevertap.account) === null || _clevertap$account4 === void 0 ? void 0 : _clevertap$account4[3])); @@ -7792,56 +8534,54 @@ isPersonalisationActive: this._isPersonalisationActive }); this.session = { - getTimeElapsed: () => { - return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getTimeElapsed(); + getTimeElapsed: function getTimeElapsed() { + return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getTimeElapsed(); }, - getPageCount: () => { - return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getPageCount(); + getPageCount: function getPageCount() { + return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getPageCount(); } }; - this.logout = () => { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('logout called'); + this.logout = function () { + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('logout called'); StorageManager.setInstantDeleteFlagInK(); }; - this.clear = () => { - this.onUserLogin.clear(); + this.clear = function () { + _this.onUserLogin.clear(); }; - this.getCleverTapID = () => { - return _classPrivateFieldLooseBase(this, _device$3)[_device$3].getGuid(); + this.getCleverTapID = function () { + return _classPrivateFieldLooseBase(_this, _device$3)[_device$3].getGuid(); }; - this.getAccountID = () => { - return _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + this.getAccountID = function () { + return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].id; }; - this.getSCDomain = () => { - return _classPrivateFieldLooseBase(this, _account$6)[_account$6].finalTargetDomain; + this.getSCDomain = function () { + return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].finalTargetDomain; }; - this.setLibrary = (libName, libVersion) => { - $ct.flutterVersion = { - [libName]: libVersion - }; + this.setLibrary = function (libName, libVersion) { + $ct.flutterVersion = _defineProperty({}, libName, libVersion); }; // Set the Signed Call sdk version and fire request - this.setSCSDKVersion = ver => { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion = ver; - const data = {}; + this.setSCSDKVersion = function (ver) { + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion = ver; + var data = {}; data.af = { - scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion + scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion }; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(_this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a])); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + _classPrivateFieldLooseBase(_this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; if (hasWebInboxSettingsInLS()) { @@ -7850,53 +8590,53 @@ } // Get Inbox Message Count - this.getInboxMessageCount = () => { - const msgCount = getInboxMessages(); + this.getInboxMessageCount = function () { + var msgCount = getInboxMessages(); return Object.keys(msgCount).length; }; // Get Inbox Unread Message Count - this.getInboxMessageUnreadCount = () => { + this.getInboxMessageUnreadCount = function () { if ($ct.inbox) { return $ct.inbox.unviewedCounter; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get All Inbox messages - this.getAllInboxMessages = () => { + this.getAllInboxMessages = function () { return getInboxMessages(); }; // Get only Unread messages - this.getUnreadInboxMessages = () => { + this.getUnreadInboxMessages = function () { if ($ct.inbox) { return $ct.inbox.unviewedMessages; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get message object belonging to the given message id only. Message id should be a String - this.getInboxMessageForId = messageId => { - const messages = getInboxMessages(); + this.getInboxMessageForId = function (messageId) { + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { return messages[messageId]; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; // Delete message from the Inbox. Message id should be a String // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list // Then remove the message from local storage and update cookie - this.deleteInboxMessage = messageId => { - const messages = getInboxMessages(); + this.deleteInboxMessage = function (messageId) { + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (messages[messageId].viewed === 0) { $ct.inbox.unviewedCounter--; @@ -7909,7 +8649,7 @@ delete messages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. Message id should be a String @@ -7918,12 +8658,12 @@ - renderNotificationViewed */ - this.markReadInboxMessage = messageId => { - const unreadMsg = $ct.inbox.unviewedMessages; - const messages = getInboxMessages(); + this.markReadInboxMessage = function (messageId) { + var unreadMsg = $ct.inbox.unviewedMessages; + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -7945,16 +8685,16 @@ delete $ct.inbox.unviewedMessages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. messageIds should be a an array of string */ - this.markReadInboxMessagesForIds = messageIds => { + this.markReadInboxMessagesForIds = function (messageIds) { if (Array.isArray(messageIds)) { for (var id = 0; id < messageIds.length; id++) { - this.markReadInboxMessage(messageIds[id]); + _this.markReadInboxMessage(messageIds[id]); } } }; @@ -7964,14 +8704,14 @@ */ - this.markReadAllInboxMessage = () => { - const unreadMsg = $ct.inbox.unviewedMessages; - const messages = getInboxMessages(); + this.markReadAllInboxMessage = function () { + var unreadMsg = $ct.inbox.unviewedMessages; + var messages = getInboxMessages(); if (Object.keys(unreadMsg).length > 0) { - const msgIds = Object.keys(unreadMsg); - msgIds.forEach(key => { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); + var msgIds = Object.keys(unreadMsg); + msgIds.forEach(function (key) { + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -7989,77 +8729,71 @@ $ct.inbox.unviewedCounter = 0; $ct.inbox.unviewedMessages = {}; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('All messages are already read'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('All messages are already read'); } }; - this.toggleInbox = e => { + this.toggleInbox = function (e) { var _$ct$inbox; return (_$ct$inbox = $ct.inbox) === null || _$ct$inbox === void 0 ? void 0 : _$ct$inbox.toggleInbox(e); }; // method for notification viewed - this.renderNotificationViewed = detail => { + this.renderNotificationViewed = function (detail) { processNotificationEvent(NOTIFICATION_VIEWED, detail); }; // method for notification clicked - this.renderNotificationClicked = detail => { + this.renderNotificationClicked = function (detail) { processNotificationEvent(NOTIFICATION_CLICKED, detail); }; - const processNotificationEvent = (eventName, eventDetail) => { + var processNotificationEvent = function processNotificationEvent(eventName, eventDetail) { if (!eventDetail || !eventDetail.msgId) { return; } - const data = {}; + var data = {}; data.type = 'event'; data.evtName = eventName; - data.evtData = { - [WZRK_ID]: eventDetail.msgId - }; + data.evtData = _defineProperty({}, WZRK_ID, eventDetail.msgId); if (eventDetail.pivotId) { - data.evtData = { ...data.evtData, + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { wzrk_pivot: eventDetail.pivotId - }; + }); } if (eventDetail.wzrk_slideNo) { - data.evtData = { ...data.evtData, + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { wzrk_slideNo: eventDetail.wzrk_slideNo - }; + }); } // Adding kv pair to event data if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) { - for (const key in eventDetail.kv) { + for (var key in eventDetail.kv) { if (key.startsWith(WZRK_PREFIX)) { - data.evtData = { ...data.evtData, - [key]: eventDetail.kv[key] - }; + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, key, eventDetail.kv[key])); } } } // Adding msgCTkv to event data if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) { - for (const key in eventDetail.msgCTkv) { - if (key.startsWith(WZRK_PREFIX)) { - data.evtData = { ...data.evtData, - [key]: eventDetail.msgCTkv[key] - }; + for (var _key in eventDetail.msgCTkv) { + if (_key.startsWith(WZRK_PREFIX)) { + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, _key, eventDetail.msgCTkv[_key])); } } } - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processEvent(data); + _classPrivateFieldLooseBase(_this, _request$7)[_request$7].processEvent(data); }; - this.setLogLevel = l => { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel = Number(l); + this.setLogLevel = function (l) { + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].logLevel = Number(l); if (l === 3) { sessionStorage.WZRK_D = ''; @@ -8073,60 +8807,60 @@ */ - this.handleIncrementValue = (key, value) => { - this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); + this.handleIncrementValue = function (key, value) { + _this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); }; - this.handleDecrementValue = (key, value) => { - this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); + this.handleDecrementValue = function (key, value) { + _this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); }; - this.setMultiValuesForKey = (key, value) => { + this.setMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueSet(key, value, COMMAND_SET); + _this.profile._handleMultiValueSet(key, value, COMMAND_SET); } else { console.error('setMultiValuesForKey should be called with a value of type array'); } }; - this.addMultiValueForKey = (key, value) => { + this.addMultiValueForKey = function (key, value) { if (typeof value === 'string' || typeof value === 'number') { - this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValueForKey should be called with a value of type string or number.'); } }; - this.addMultiValuesForKey = (key, value) => { + this.addMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValuesForKey should be called with a value of type array.'); } }; - this.removeMultiValueForKey = (key, value) => { + this.removeMultiValueForKey = function (key, value) { if (typeof value === 'string' || typeof value === 'number') { - this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValueForKey should be called with a value of type string or number.'); } }; - this.removeMultiValuesForKey = (key, value) => { + this.removeMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValuesForKey should be called with a value of type array.'); } }; - this.removeValueForKey = key => { - this.profile._handleMultiValueDelete(key, COMMAND_DELETE); + this.removeValueForKey = function (key) { + _this.profile._handleMultiValueDelete(key, COMMAND_DELETE); }; - const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => { - handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(this, _account$6)[_account$6], _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + var _handleEmailSubscription = function _handleEmailSubscription(subscription, reEncoded, fetchGroups) { + handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(_this, _account$6)[_account$6], _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); }; /** * @@ -8209,57 +8943,57 @@ } } - const api = _classPrivateFieldLooseBase(this, _api)[_api]; + var api = _classPrivateFieldLooseBase(this, _api)[_api]; api.logout = this.logout; api.clear = this.clear; - api.closeIframe = (campaignId, divIdIgnored) => { - closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(this, _session$3)[_session$3].sessionId); + api.closeIframe = function (campaignId, divIdIgnored) { + closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(_this, _session$3)[_session$3].sessionId); }; - api.enableWebPush = (enabled, applicationServerKey) => { - this.notifications._enableWebPush(enabled, applicationServerKey); + api.enableWebPush = function (enabled, applicationServerKey) { + _this.notifications._enableWebPush(enabled, applicationServerKey); }; - api.tr = msg => { + api.tr = function (msg) { _tr(msg, { - device: _classPrivateFieldLooseBase(this, _device$3)[_device$3], - session: _classPrivateFieldLooseBase(this, _session$3)[_session$3], - request: _classPrivateFieldLooseBase(this, _request$7)[_request$7], - logger: _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] + device: _classPrivateFieldLooseBase(_this, _device$3)[_device$3], + session: _classPrivateFieldLooseBase(_this, _session$3)[_session$3], + request: _classPrivateFieldLooseBase(_this, _request$7)[_request$7], + logger: _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a] }); }; - api.setEnum = enumVal => { - setEnum(enumVal, _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + api.setEnum = function (enumVal) { + setEnum(enumVal, _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); }; - api.is_onloadcalled = () => { - return _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1; + api.is_onloadcalled = function () { + return _classPrivateFieldLooseBase(_this, _onloadcalled)[_onloadcalled] === 1; }; - api.subEmail = reEncoded => { + api.subEmail = function (reEncoded) { _handleEmailSubscription('1', reEncoded); }; - api.getEmail = (reEncoded, withGroups) => { + api.getEmail = function (reEncoded, withGroups) { _handleEmailSubscription('-1', reEncoded, withGroups); }; - api.unSubEmail = reEncoded => { + api.unSubEmail = function (reEncoded) { _handleEmailSubscription('0', reEncoded); }; - api.unsubEmailGroups = reEncoded => { + api.unsubEmailGroups = function (reEncoded) { $ct.unsubGroups = []; - const elements = document.getElementsByClassName('ct-unsub-group-input-item'); + var elements = document.getElementsByClassName('ct-unsub-group-input-item'); - for (let i = 0; i < elements.length; i++) { - const element = elements[i]; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; if (element.name) { - const data = { + var data = { name: element.name, isUnsubscribed: element.checked }; @@ -8270,29 +9004,29 @@ _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.setSubscriptionGroups = value => { + api.setSubscriptionGroups = function (value) { $ct.unsubGroups = value; }; - api.getSubscriptionGroups = () => { + api.getSubscriptionGroups = function () { return $ct.unsubGroups; }; - api.changeSubscriptionGroups = (reEncoded, updatedGroups) => { + api.changeSubscriptionGroups = function (reEncoded, updatedGroups) { api.setSubscriptionGroups(updatedGroups); _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.isGlobalUnsubscribe = () => { + api.isGlobalUnsubscribe = function () { return $ct.globalUnsubscribe; }; - api.setIsGlobalUnsubscribe = value => { + api.setIsGlobalUnsubscribe = function (value) { $ct.globalUnsubscribe = value; }; - api.setUpdatedCategoryLong = profile => { + api.setUpdatedCategoryLong = function (profile) { if (profile[categoryLongKey]) { $ct.updatedCategoryLong = profile[categoryLongKey]; } @@ -8309,243 +9043,261 @@ } // starts here - init(accountId, region, targetDomain, token) { - let antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - - if (Object.keys(antiFlicker).length > 0) { - addAntiFlicker(antiFlicker); - } - - if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // already initailsed - return; - } + _createClass(CleverTap, [{ + key: "init", + value: function init(accountId, region, targetDomain, token) { + var _this2 = this; - checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], accountId); - StorageManager.removeCookie('WZRK_P', window.location.hostname); + var antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { - if (!accountId) { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); + if (Object.keys(antiFlicker).length > 0) { + addAntiFlicker(antiFlicker); + } + if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // already initailsed return; } - _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; - } - - _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], accountId); + StorageManager.removeCookie('WZRK_P', window.location.hostname); - if (region) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; - } - - if (targetDomain) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; - } + if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { + if (!accountId) { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); - if (token) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; - } + return; + } - const currLocation = location.href; - const urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; + } - if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { - return; - } + _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; - $ct.isPrivacyArrPushed = true; + if (region) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; + } - if ($ct.privacyArray.length > 0) { - this.privacy.push($ct.privacyArray); - } + if (targetDomain) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; + } - _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); + if (token) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; + } - this.pageChanged(); - const backupInterval = setInterval(() => { - if (_classPrivateFieldLooseBase(this, _device$3)[_device$3].gcookie) { - clearInterval(backupInterval); + var currLocation = location.href; + var urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { + return; } - }, 3000); - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { - // listen to click on the document and check if URL has changed. - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - // remove existing click listeners if any - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } + $ct.isPrivacyArrPushed = true; - _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; - } // process the option array provided to the clevertap object - // after its been initialized + if ($ct.privacyArray.length > 0) { + this.privacy.push($ct.privacyArray); + } + _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); - pageChanged() { - const currLocation = window.location.href; - const urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count + this.pageChanged(); + var backupInterval = setInterval(function () { + if (_classPrivateFieldLooseBase(_this2, _device$3)[_device$3].gcookie) { + clearInterval(backupInterval); - const obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); + _classPrivateFieldLooseBase(_this2, _request$7)[_request$7].processBackupEvents(); + } + }, 3000); - let pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; - obj.p = ++pgCount; + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { + // listen to click on the document and check if URL has changed. + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + // remove existing click listeners if any + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } - _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count + _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; + } // process the option array provided to the clevertap object + // after its been initialized + }, { + key: "pageChanged", + value: function pageChanged() { + var _this3 = this; - let data = {}; - let referrerDomain = getDomain(document.referrer); + var currLocation = window.location.href; + var urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count - if (window.location.hostname !== referrerDomain) { - const maxLen = 120; + var obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); - if (referrerDomain !== '') { - referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; - data.referrer = referrerDomain; - } + var pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; + obj.p = ++pgCount; - let utmSource = urlParams.utm_source || urlParams.wzrk_source; + _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count - if (typeof utmSource !== 'undefined') { - utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; - data.us = utmSource; // utm_source - } - let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; + var data = {}; + var referrerDomain = getDomain(document.referrer); - if (typeof utmMedium !== 'undefined') { - utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; - data.um = utmMedium; // utm_medium - } + if (window.location.hostname !== referrerDomain) { + var maxLen = 120; - let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; + if (referrerDomain !== '') { + referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; + data.referrer = referrerDomain; + } - if (typeof utmCampaign !== 'undefined') { - utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; - data.uc = utmCampaign; // utm_campaign - } // also independently send wzrk_medium to the backend + var utmSource = urlParams.utm_source || urlParams.wzrk_source; + if (typeof utmSource !== 'undefined') { + utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; + data.us = utmSource; // utm_source + } - if (typeof urlParams.wzrk_medium !== 'undefined') { - const wm = urlParams.wzrk_medium; + var utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; - if (wm.match(/^email$|^social$|^search$/)) { - data.wm = wm; // wzrk_medium + if (typeof utmMedium !== 'undefined') { + utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; + data.um = utmMedium; // utm_medium } - } - } - data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); - data.cpg = currLocation; - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + var utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + if (typeof utmCampaign !== 'undefined') { + utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; + data.uc = utmCampaign; // utm_campaign + } // also independently send wzrk_medium to the backend - _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 + if (typeof urlParams.wzrk_medium !== 'undefined') { + var wm = urlParams.wzrk_medium; - if (parseInt(data.pg) === 1) { - _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); - } + if (wm.match(/^email$|^social$|^search$/)) { + data.wm = wm; // wzrk_medium + } + } + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); + data.cpg = currLocation; + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - if (parseInt(data.pg) === 1) { - this.event.push(WZRK_FETCH, { - t: 4 - }); - } + _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 - _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; - setTimeout(() => { - if (pgCount <= 3) { - // send ping for up to 3 pages - _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); - } - if (_classPrivateFieldLooseBase(this, _isPingContinuous)[_isPingContinuous]()) { - setInterval(() => { - _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); - }, CONTINUOUS_PING_FREQ_IN_MILLIS); + if (parseInt(data.pg) === 1) { + _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); } - }, FIRST_PING_FREQ_IN_MILLIS); - } - _isPersonalisationActive() { - return StorageManager._isLocalStorageSupported() && this.enablePersonalization; - } + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - // eslint-disable-next-line accessor-pairs - set popupCallback(callback) { - this.popupCallbacks[this.popupCurrentWzrkId] = callback; - } - /** - * - * @param {object} payload - */ + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + if (parseInt(data.pg) === 1) { + this.event.push(WZRK_FETCH, { + t: 4 + }); + } - // offline mode + _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; + setTimeout(function () { + if (pgCount <= 3) { + // send ping for up to 3 pages + _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); + } - /** - * events will be recorded and queued locally when passed with true - * but will not be sent to the server until offline is disabled by passing false - * @param {boolean} arg - */ - setOffline(arg) { - if (typeof arg !== 'boolean') { - console.error('setOffline should be called with a value of type boolean'); - return; + if (_classPrivateFieldLooseBase(_this3, _isPingContinuous)[_isPingContinuous]()) { + setInterval(function () { + _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); + }, CONTINUOUS_PING_FREQ_IN_MILLIS); + } + }, FIRST_PING_FREQ_IN_MILLIS); } - - $ct.offline = arg; // if offline is disabled - // process events from cache - - if (!arg) { - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + }, { + key: "_isPersonalisationActive", + value: function _isPersonalisationActive() { + return StorageManager._isLocalStorageSupported() && this.enablePersonalization; } - } - - getSDKVersion() { - return 'web-sdk-v1.9.6'; - } - - defineVariable(name, defaultValue) { - return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); - } + }, { + key: "setOffline", + // offline mode - syncVariables(onSyncSuccess, onSyncFailure) { - if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { - return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); - } else { - const m = 'App log level is not set to 4'; + /** + * events will be recorded and queued locally when passed with true + * but will not be sent to the server until offline is disabled by passing false + * @param {boolean} arg + */ + value: function setOffline(arg) { + if (typeof arg !== 'boolean') { + console.error('setOffline should be called with a value of type boolean'); + return; + } - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); + $ct.offline = arg; // if offline is disabled + // process events from cache - return Promise.reject(new Error(m)); + if (!arg) { + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + } } - } + }, { + key: "getSDKVersion", + value: function getSDKVersion() { + return 'web-sdk-v1.9.6'; + } + }, { + key: "defineVariable", + value: function defineVariable(name, defaultValue) { + return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); + } + }, { + key: "syncVariables", + value: function syncVariables(onSyncSuccess, onSyncFailure) { + if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { + return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); + } else { + var m = 'App log level is not set to 4'; - fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); - } + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); - addVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); - } + return Promise.reject(new Error(m)); + } + } + }, { + key: "fetchVariables", + value: function fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); + } + }, { + key: "addVariablesChangedCallback", + value: function addVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); + } + }, { + key: "addOneTimeVariablesChangedCallback", + value: function addOneTimeVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); + } + }, { + key: "popupCallback", + // eslint-disable-next-line accessor-pairs + set: function set(callback) { + this.popupCallbacks[this.popupCurrentWzrkId] = callback; + } + /** + * + * @param {object} payload + */ - addOneTimeVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); - } + }]); - } + return CleverTap; + }(); var _processOldValues2 = function _processOldValues2() { this.onUserLogin._processOldValues(); @@ -8560,8 +9312,8 @@ }; var _debounce2 = function _debounce2(func) { - let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; - let timeout; + var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + var timeout; return function () { clearTimeout(timeout); timeout = setTimeout(func, delay); @@ -8569,9 +9321,11 @@ }; var _checkPageChanged2 = function _checkPageChanged2() { - const debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](() => { - if (_classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] !== location.href) { - this.pageChanged(); + var _this4 = this; + + var debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](function () { + if (_classPrivateFieldLooseBase(_this4, _previousUrl)[_previousUrl] !== location.href) { + _this4.pageChanged(); } }); @@ -8579,9 +9333,9 @@ }; var _pingRequest2 = function _pingRequest2() { - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - let data = {}; + var data = {}; data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); @@ -8601,9 +9355,9 @@ var _sendLocationData2 = function _sendLocationData2(payload) { // Send the updated value to LC - let data = {}; + var data = {}; data.af = {}; - const profileObj = {}; + var profileObj = {}; data.type = 'profile'; if (profileObj.tz == null) { @@ -8613,25 +9367,23 @@ data.profile = profileObj; if (payload) { - const keys = Object.keys(payload); - keys.forEach(key => { + var keys = Object.keys(payload); + keys.forEach(function (key) { data.af[key] = payload[key]; }); } if ($ct.location) { - data.af = { ...data.af, - ...$ct.location - }; + data.af = _objectSpread2(_objectSpread2({}, data.af), $ct.location); } data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, true); _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -8639,7 +9391,7 @@ _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; - const clevertap = new CleverTap(window.clevertap); + var clevertap = new CleverTap(window.clevertap); window.clevertap = window.wizrocket = clevertap; return clevertap; diff --git a/clevertap.js.map b/clevertap.js.map index cc1472b6..cf1450d7 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n let elementDisplayed = false\n\n if (siteUrl !== window.location.href.split('?')[0]) return\n\n const processElement = (element, selector) => {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else if (selectors[selector].json) {\n dispatchJsonData(targetingMsgJson, selectors[selector])\n } else {\n updateFormData(element, selectors[selector].form)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n Object.keys(selectors).forEach(selector => {\n const element = document.querySelector(selector)\n if (element) {\n processElement(element, selector)\n elementDisplayed = true\n } else {\n tryFindingElement(selector)\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EA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AR,EAAkB;EAChB/B,IAAAA,IAAI,CAACohC,EAAL,GAAU,EAAE,GAAGphC,IAAI,CAACohC,EAAV;EAAc,SAAGn/B,GAAG,CAACF;EAArB,KAAV;EACD;;EACD/B,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcsX,QAAd,CAAuBtX,IAAvB;;EACA,QAAMuX,cAAc,GAAG7K,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACAoX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBrV,QAAtB,CAAtB;EACAqV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAIkgC,SAAJ,CAAchuC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = isPreview ? formStyle.text.text : formStyle.text.replacements\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details[0] : targetingMsgJson.display.details[0]\n const siteUrl = Object.keys(details)[0]\n const selectors = details[siteUrl]\n let elementDisplayed = false\n\n if (siteUrl !== window.location.href.split('?')[0]) return\n\n const processElement = (element, selector) => {\n if (selectors[selector].html) {\n element.outerHTML = selectors[selector].html\n } else if (selectors[selector].json) {\n dispatchJsonData(targetingMsgJson, selectors[selector])\n } else {\n updateFormData(element, selectors[selector].form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n Object.keys(selectors).forEach(selector => {\n const element = document.querySelector(selector)\n if (element) {\n processElement(element, selector)\n elementDisplayed = true\n } else {\n tryFindingElement(selector)\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","replacements","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","siteUrl","selectors","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjEP;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKI,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB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AAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI+/B,SAAJ,CAAc1tC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 5b623308..58783c63 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",q="WZRK_INBOX",W=1e3,K="wzrk_fetch",H=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],G=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return G(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(G(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Ue extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Fe}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!G(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),H.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const Ve=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ge(e)),He=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ge=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+He.charAt(n)+He.charAt(s)+He.charAt(r)+He.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=qe(e,"tries",t),e=i(this,$e)[$e](e),e=qe(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&G(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),qe(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?qe(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();s.includes(t)||s.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?r(e):i(this,lt)[lt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported value type");r(t)}le.globalProfileMap[e]=s,ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)||{}),!le.globalProfileMap.hasOwnProperty(e))return void i(this,lt)[lt].error("The property ".concat(e," does not exist."));const n=t=>{const i=le.globalProfileMap[e].indexOf(t);-1!==i&&le.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported propVal type");n(t)}0===le.globalProfileMap[e].length&&delete le.globalProfileMap[e],ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),(null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete le.globalProfileMap[e]:i(this,lt)[lt].error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===F||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=qe(a,"type",A),a=qe(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=qe(t,"type",A),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=qe(s,"type",A),s=qe(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Gt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ut(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ut(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Ht,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Ht,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ut(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=qt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{Vt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(q)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(q,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ut=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(q,i)},Ft=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(V)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Vt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},qt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(V)||{}).length>0,Ht='\n\n\n',Gt='\n\n\n',Jt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",$t="wve-anti-flicker-hide",Yt="wve-flicker-style",Qt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Xt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&ni(e.data,!0)}},Xt=(e,t,i,o)=>{"complete"===document.readyState?oi(e,t,i,o):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&oi(e,t,i,o)}))};let ei,ti=!1,ii=!1;function oi(e,t,i,o){if(!ti){window.Shopify&&(ii=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",ei=document.createElement("div"),ei.id="overlayDiv",ei.style.position="relative",ei.style.display="flex",document.body.appendChild(ei);(function(e,t,i,o,n){return new Promise(((s,r)=>{var a=document.createElement("script");a.type="module",a.src=e,a.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:ii,personalisation:n}),s()):r(new Error("ContentLayout not found in overlay.js"))},a.onerror=function(e){r(e)},document.head.appendChild(a)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i,o).then((()=>{console.log("Overlay script loaded successfully."),ti=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.href=Jt,document.head.appendChild(n)}var n}const ni=(e,t)=>{const i=t?e.details[0]:e.display.details[0],o=Object.keys(i)[0],n=i[o];let s=!1;if(o!==window.location.href.split("?")[0])return;const r=(t,i)=>{n[i].html?t.outerHTML=n[i].html:n[i].json?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,n[i]):((e,t)=>{if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const i=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>window.open(i,"_blank").focus():()=>{window.location.href=i}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}})(t,n[i].form)};Object.keys(n).forEach((e=>{const t=document.querySelector(e);t?(r(t,e),s=!0):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e);o?(r(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)})),s&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function si(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,s=0;function r(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add($t))),setTimeout((()=>{e.forEach((e=>{e.classList.remove($t),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),s++,(0===Object.keys(o).length||s>20)&&(s=0,clearInterval(n))}),100))}!function(){const e=Yt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,r(t))})).observe(document.body,{childList:!0,subtree:!0})}(),r(t)}))}const ri=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(ri,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ge(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),i.preview&&i["custom-editor"]&&(u.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=new Event("CT_campaign_rendered");document.dispatchEvent(m),i["custom-editor"]&&(v=k(e,v)),u.srcdoc=v;const y=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},w=navigator.userAgent.toLowerCase();if(-1!==w.indexOf("safari"))if(w.indexOf("chrome")>-1)u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),300)}else u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE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;EACD,KAFD;EAGD;;EACD,MAAI0E,GAAG,CAACF,QAAR,EAAkB;EAChB/B,IAAAA,IAAI,CAACkhC,EAAL,GAAU,EAAE,GAAGlhC,IAAI,CAACkhC,EAAV;EAAc,SAAGj/B,GAAG,CAACF;EAArB,KAAV;EACD;;EACD/B,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcsX,QAAd,CAAuBtX,IAAvB;;EACA,QAAMuX,cAAc,GAAG7K,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACAoX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBrV,QAAtB,CAAtB;EACAqV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAIggC,SAAJ,CAAc9tC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text.replacements\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","replacements","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjEP;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKI,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ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P;;EACA,4DAAc+W,QAAd,CAAuB/W,IAAvB;;EACA,MAAMgX,cAAc,GAAG5K,YAAY,CAACtM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI6O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI+/B,SAAJ,CAAc1tC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index a055b195..99249204 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var s=t("accountId"),r=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,r,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,s)[s]}set id(e){i(this,s)[s]=e}get region(){return i(this,r)[r]}set region(e){i(this,r)[r]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const h=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),u=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",v="WZRK_CHARGED_ID",b="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",P="WZRK_ARP",S="WZRK_L",I="global",O="optOut",_="useIP",E="WZRK_X",A="push",L=31536e3,M="wzrk_",T="wzrk_id",R="Notification Viewed",j="Notification Clicked",D="WZRK_FPU",z="WZRK_PSD",B="$incr",N="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",q="WZRK_INBOX",W=1e3,K="wzrk_fetch",H=["Stayed","UTM Visited","App Launched","Notification Sent",R,j],G=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Z=e=>"object"==typeof e&&e instanceof Date,$=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},Y=e=>!isNaN(parseFloat(e))&&isFinite(e),Q=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,X=e=>null!=e&&"undefined"!==e,ee=(e,t)=>{if("object"!=typeof e){let i;return G(e)?(i=te(e,u),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=ee(e[i],t);let n;n=te(i,h),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},te=(e,t)=>e.replace(t,""),ie=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},oe=()=>Math.floor((new Date).getTime()/1e3),ne=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(re(e))return"$D_"+e},re=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],s=new Date(n,o,i);return s.getDate()==i&&s.getMonth()==o&&s.getFullYear()==n};class ae{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",s="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(s="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+s+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?r[o]+a:"."+r[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){s=a,le.broadDomain=s;break}}}else this.createCookie(e,t,i,s)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(S);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(S,o),i.debug("stored in ".concat(S," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(S);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(S,i))}}const le={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}};var ce=t("keyOrder"),de=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,de,{value:ue}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=ae.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,de)[de](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,de)[de](e,this.cache):n.length===this.max&&(this.cache=i(this,de)[de](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}ae.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var ue=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let s;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:s=i);return o.splice(s,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},pe=t("logger"),ge=t("request"),fe=t("device"),ve=t("session");class be{constructor(e){let{logger:t,request:o,device:n,session:s}=e;Object.defineProperty(this,pe,{writable:!0,value:void 0}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,pe)[pe]=t,i(this,ge)[ge]=o,i(this,fe)[fe]=n,i(this,ve)[ve]=s}s(e,t,o,n,s){let r=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),ae.removeBackup(n,i(this,pe)[pe]),n>le.globalCache.REQ_N)return;if(X(i(this,fe)[fe].gcookie)||e&&(a=!0),!X(i(this,fe)[fe].gcookie)||o||"boolean"==typeof s){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Z(e[t])&&(e[t]=ne(e[t]))}return!0}return!1},Re=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Z(e[i])&&(e[i]=ne(e[i]))}if(G(e[f])||Q(e[f])){const i=e[f]+"";if(void 0===Me&&(Me=ae.readFromLSorCookie(v)),void 0!==Me&&Me.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Me=i,ae.saveToLSorCookie(v,i)}return!0}return!1};var je=t("logger"),De=t("oldValues"),ze=t("request"),Be=t("isPersonalisationActive"),Ne=t("processEventArray");class Ue extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,Ne,{value:Fe}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,De)[De]=t,i(this,ze)[ze]=n,i(this,Be)[Be]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!G(t)){i(this,je)[je].error(xe);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),H.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=te(t,h),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!Re(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,ze)[ze].processEvent(o)}};const Ve=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const s=/\+/g,r=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(s," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=r.exec(o);n;)t[a(n[1])]=a(n[2]),n=r.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),We=()=>window.location.hostname,Ke=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ge(e)),He=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ge=e=>{if(null==e)return"";var t,i,o,n,s,r,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},s={},r="",a="",l="",c=2,d=3,h=2,u="",p=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++),n[a]=d++,l=String(r)}if(""!==l){if(Object.prototype.hasOwnProperty.call(s,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}c--,0==c&&(c=Math.pow(2,h),h++),delete s[l]}else for(i=n[l],t=0;t>=1;c--,0==c&&(c=Math.pow(2,h),h++)}for(i=2,t=0;t>=1;for(;;){if(p<<=1,15==g){u+=f(p);break}g++}return u})(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,n=t>>2,s=(3&t)<<4|i>>4,r=(15&i)<<2|o>>6,a=63&o,isNaN(i)?r=a=64:isNaN(o)&&(a=64),l=l+He.charAt(n)+He.charAt(s)+He.charAt(r)+He.charAt(a);return l};var Je=t("fireRequest"),Ze=t("dropRequestDueToOptOut"),$e=t("addUseIPToRequest"),Ye=t("addARPToRequest");class Qe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=W,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),W;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=W,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Qe.logger=void 0,Qe.device=void 0,Qe.account=void 0,Object.defineProperty(Qe,Je,{value:function(e,t,o,n,s){var r,a;if(i(this,Ze)[Ze]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(X(this.device.gcookie)||(le.blockRequest=!0),s&&s===K)!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!X(this.device.gcookie)&&le.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(X(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,Ye)[Ye](e,o)),e=qe(e,"tries",t),e=i(this,$e)[$e](e),e=qe(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Qe,Ze,{value:function(){return!le.isOptInRequest&&X(this.device.gcookie)&&G(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(le.isOptInRequest=!1,!1)}}),Object.defineProperty(Qe,$e,{value:function(e){var t=ae.getMetaProp(_);return"boolean"!=typeof t&&(t=!1),qe(e,_,t?"true":"false")}}),Object.defineProperty(Qe,Ye,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",Ke(JSON.stringify(t),this.logger))}return ae._isLocalStorageSupported()&&void 0!==localStorage.getItem(P)&&null!==localStorage.getItem(P)?qe(e,"arp",Ke(JSON.stringify(ae.readFromLSorCookie(P)),this.logger)):e}});const Xe=()=>{let e={};if(ae._isLocalStorageSupported()){let t=ae.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},et=e=>{if(ae._isLocalStorageSupported()){const t={...Xe(),...e},i=JSON.stringify(t);ae.save(y,encodeURIComponent(i)),tt()}},tt=()=>{if(ae._isLocalStorageSupported()){let i=ae.read(b);if(X(i))try{i=JSON.parse(decodeURIComponent(ae.read(b)));const o=ae.read(w)?JSON.parse(decodeURIComponent(ae.read(w))):{};if(i&&ae._isLocalStorageSupported()){var e={},t=Xe();Object.keys(t).forEach((n=>{const s=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},r=t[n].global,a=ie(),l=t[n][a];if(void 0!==r){const e=Object.keys(r);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==r&&void 0!==r[a]&&(n=r[a]),i=[a,o,n],s[a]=i}}}e={...e,[n]:s}})),o[i]=e,ae.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},it=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));let t={};if(ae._isLocalStorageSupported()){let i={};t=Xe();const o=ae.read(w),n=o?decodeURIComponent(o):null,s=n?JSON.parse(n):null,r=e&&null!=o&&s&&s[e]&&s[e].wp?Object.values(s[e].wp):[],a=e&&null!=o&&s&&s[e]&&s[e].wi?Object.values(s[e].wi):[],l=ie();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:r,witlc:a},i}},ot=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Pe)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Ie)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&(Y(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Z(n)||(o=!1,i.error(Ee)),Z(n)&&(e[t]=ne(n))):Z(n)&&(e[t]=ne(n)),"Phone"!==t||$(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),Y(n)?e.Phone=+n:(o=!1,i.error(Le+". Removed."))):(o=!1,i.error(Le+". Removed."))),o||delete e[t]}return o},nt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(ae._isLocalStorageSupported()){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x),null==le.globalProfileMap&&(le.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(le.globalProfileMap.hasOwnProperty(i)&&!t)continue;le.globalProfileMap[i]=e[i]}null!=le.globalProfileMap._custom&&delete le.globalProfileMap._custom,ae.saveToLSorCookie(x,le.globalProfileMap)}},at=(e,t,i)=>{if(null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const t=Xe();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",et(t)}if(null!=le.campaignDivMap){const t=le.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}};var lt=t("logger"),ct=t("request"),dt=t("account"),ht=t("oldValues"),ut=t("isPersonalisationActive"),pt=t("processProfileArray");class gt extends Array{constructor(e,t){let{logger:o,request:n,account:s,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,pt,{value:ft}),Object.defineProperty(this,lt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),i(this,lt)[lt]=o,i(this,ct)[ct]=n,i(this,dt)[dt]=s,i(this,ht)[ht]=t,i(this,ut)[ut]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();s.includes(t)||s.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?r(e):i(this,lt)[lt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported value type");r(t)}le.globalProfileMap[e]=s,ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)||{}),!le.globalProfileMap.hasOwnProperty(e))return void i(this,lt)[lt].error("The property ".concat(e," does not exist."));const n=t=>{const i=le.globalProfileMap[e].indexOf(t);-1!==i&&le.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,lt)[lt].error("Unsupported propVal type");n(t)}0===le.globalProfileMap[e].length&&delete le.globalProfileMap[e],ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==le.globalProfileMap&&(le.globalProfileMap=ae.readFromLSorCookie(x)),(null==le||null===(o=le.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete le.globalProfileMap[e]:i(this,lt)[lt].error("The property ".concat(e," does not exist.")),ae.saveToLSorCookie(x,le.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const s={};n.type="profile",s[e]={[o]:o===F||t},null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=s,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const r=Ke(JSON.stringify(n),i(this,lt)[lt]);let a=i(this,dt)[dt].dataPostURL;a=qe(a,"type",A),a=qe(a,"d",r),i(this,ct)[ct].saveAndFireRequest(a,le.blockRequest)}}var ft=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,s={};if(null!=o.Site){if(n=o.Site,$(n)||!ot(n,{logger:i(this,lt)[lt]}))return}else if(null!=o.Facebook){const e=o.Facebook;$(e)||e.error||(n=nt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];$(e)||e.error||(n=st(e,{logger:i(this,lt)[lt]}))}if(null!=n&&!$(n)){s.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),s.profile=n,rt(n,!0),s=i(this,ct)[ct].addSystemDataToObject(s,void 0),i(this,ct)[ct].addFlags(s);const e=Ke(JSON.stringify(s),i(this,lt)[lt]);let t=i(this,dt)[dt].dataPostURL;t=qe(t,"type",A),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,le.blockRequest)}}},vt=t("request"),bt=t("logger"),mt=t("account"),yt=t("session"),wt=t("oldValues"),Ct=t("device"),kt=t("processOUL"),xt=t("handleCookieFromCache"),Pt=t("deleteUser"),St=t("processLoginArray");class It extends Array{constructor(e,t){let{request:o,account:n,session:s,logger:r,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Pt,{value:Et}),Object.defineProperty(this,xt,{value:_t}),Object.defineProperty(this,kt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,mt)[mt]=n,i(this,yt)[yt]=s,i(this,bt)[bt]=r,i(this,wt)[wt]=t,i(this,Ct)[Ct]=a}clear(){i(this,bt)[bt].debug("clear called. Reset flag has been set."),i(this,Pt)[Pt](),ae.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=ae.readFromLSorCookie(m);const n=ae.readFromLSorCookie(b);let s;if(null==o)o={},s=e;else{s=o.id;let r=!1,a=!1;if(null==s&&(s=e[0],r=!0),null==le.LRU_CACHE&&ae._isLocalStorageSupported()&&(le.LRU_CACHE=new he(100)),r)null!=n&&(le.LRU_CACHE.set(s,n),le.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(le.LRU_CACHE.cache[i]){s=i,a=!0;break}}if(a){s!==le.LRU_CACHE.getLastKey()?i(this,xt)[xt]():(t=!1,ae.saveToLSorCookie(D,t));const e=le.LRU_CACHE.get(s);le.LRU_CACHE.set(s,e),ae.saveToLSorCookie(b,e),i(this,Ct)[Ct].gcookie=e;const o=le.LRU_CACHE.getSecondLastKey();if(ae.readFromLSorCookie(D)&&-1!==o){const e=le.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else r?null!=n&&(i(this,Ct)[Ct].gcookie=n,ae.saveToLSorCookie(b,n),t=!1):this.clear(),ae.saveToLSorCookie(D,!1),s=e[0]}o.id=s,ae.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const s=e[n];let r,a={};if(null!=s.Site){if(r=s.Site,$(r)||!ot(r,{logger:i(this,bt)[bt]}))return}else if(null!=s.Facebook){const e=s.Facebook;$(e)||e.error||(r=nt(e))}else if(null!=s["Google Plus"]){const e=s["Google Plus"];$(e)&&!e.error&&(r=st(e,{logger:i(this,bt)[bt]}))}if(null!=r&&!$(r)){a.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=r;const e=[];ae._isLocalStorageSupported()&&(r.Identity&&e.push(r.Identity),r.Email&&e.push(r.Email),r.GPID&&e.push("GP:"+r.GPID),r.FBID&&e.push("FB:"+r.FBID),e.length>0&&o(e)),rt(r,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=Ke(JSON.stringify(a),i(this,bt)[bt]);let s=i(this,mt)[mt].dataPostURL;s=qe(s,"type",A),s=qe(s,"d",n),i(this,vt)[vt].saveAndFireRequest(s,le.blockRequest,t)}}},_t=function(){le.blockRequest=!1,console.debug("Block request is false"),ae._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(y,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,yt)[yt].setSessionCookieObject("")},Et=function(){le.blockRequest=!0,i(this,bt)[bt].debug("Block request is true"),le.globalCache={gcookie:null,REQ_N:0,RESP_N:0},ae._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),ae.removeCookie(b,le.broadDomain),ae.removeCookie(y,We()),ae.removeCookie(m,We()),ae.removeCookie(i(this,yt)[yt].cookieName,le.broadDomain),ae.removeCookie(P,le.broadDomain),i(this,Ct)[Ct].gcookie=null,i(this,yt)[yt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){ae.setInstantDeleteFlagInK();try{i(this,kt)[kt]([t])}catch(e){i(this,bt)[bt].debug(e)}}else i(this,bt)[bt].error("Profile object is in incorrect format")}};class Lt extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class Mt extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}class Tt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&ae._isLocalStorageSupported()){const i=Xe();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",et(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Rt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Gt;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class jt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:ae.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Nt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Ut(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const s="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=s,e.date=i-n,e.viewed=0,t[s]=e,o[s]=e,this.unviewedMessages[s]=e,this.unviewedCounter++})),Ut(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Ht,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Ht,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},s=i.children[0],r=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(s);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(r),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Rt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let s=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;s>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),s--}const r=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=r?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Nt();i[e]=t,Ut(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(le.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),s=i.getPropertyValue("--inbox-left"),r=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||s||r)){const t=qt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Nt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:s,categoriesTabColor:r,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:h,headerCategoryHeight:u}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:s,buttonTextColor:r,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const Dt=e=>{e.inbox_preview?le.inbox.incomingMessagesForPreview=e.inbox_notifs:le.inbox.incomingMessages=e},zt=e=>{Vt(),le.inbox=new jt({logger:e}),document.body.appendChild(le.inbox)},Bt=e=>{const t=ae.readFromLSorCookie(q)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,ae.saveToLSorCookie(q,i),i}return t},Nt=()=>{const e=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(e))return{};const t=Bt(e);return t.hasOwnProperty(e)?t[e]:{}},Ut=e=>{const t=JSON.parse(decodeURIComponent(ae.read(b)));if(!X(t))return;const i={...Bt(t),[t]:e};ae.saveToLSorCookie(q,i)},Ft=e=>new Promise(((t,i)=>{if("complete"===document.readyState)zt(e),t();else{const i=ae.readFromLSorCookie(V)||{},o=()=>{null===le.inbox&&zt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const s=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(s),t()):n>=20&&(clearInterval(s),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Vt=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",jt),customElements.define("ct-inbox-message",Rt))},qt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,s=window.innerWidth+o,r=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,h=a.right+o,u=a.top+n,p=a.bottom,g=a.height,f=a.width;let v,b,m=!1;const y=16;if(p+t<=r){const e=r-(p+t);b=e>=y?p+y:p+e}else if(u-t>=n){const e=u-t;b=e>=y?u-t-y:u-t-e}else m=!0,b=c+g/2-t/2,br&&(b=r-t);if(m){const e=h+i;if(e<=s){v=h+(e+y<=s?y:s-e)}else{const e=d-i;v=e-(e-y>=o?y:e-o)}}else v=l+f/2-i/2,vs&&(v=h-i>=o?h-i:s-i);return{xPos:v,yPos:b}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},Kt=()=>Object.keys(ae.readFromLSorCookie(V)||{}).length>0,Ht='\n\n\n',Gt='\n\n\n',Jt="https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css",Zt="wve-anti-flicker-show",$t="wve-anti-flicker-hide",Yt="wve-flicker-style",Qt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)Xt(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{});else"Overlay"===e.data.message&&ni(e.data,!0)}},Xt=(e,t,i)=>{"complete"===document.readyState?oi(e,t,i):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&oi(e,t,i)}))};let ei,ti=!1,ii=!1;function oi(e,t,i){if(!ti){window.Shopify&&(ii=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",ei=document.createElement("div"),ei.id="overlayDiv",ei.style.position="relative",ei.style.display="flex",document.body.appendChild(ei);(function(e,t,i,o){return new Promise(((n,s)=>{var r=document.createElement("script");r.type="module",r.src=e,r.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:ii}),n()):s(new Error("ContentLayout not found in overlay.js"))},r.onerror=function(e){s(e)},document.head.appendChild(r)}))})("https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully."),ti=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=Jt,document.head.appendChild(o)}var o}const ni=(e,t)=>{console.log(e.details);const i=t?e.details:e.display.details;let o=!1;const n=(t,i)=>{var o;i.values&&(i.values.html?t.outerHTML=i.values.html:(null===(o=i.values)||void 0===o?void 0:o.json)?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,i.values):((e,t)=>{if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const i=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>window.open(i,"_blank").focus():()=>{window.location.href=i}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}})(t,i.values.form))};i.forEach((e=>{e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((e=>{const t=document.querySelector(e.selector);t?(n(t,e),o=!0):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e.selector);o?(n(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)}))})),o&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function si(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,s=0;function r(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add($t))),setTimeout((()=>{e.forEach((e=>{e.classList.remove($t),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),s++,(0===Object.keys(o).length||s>20)&&(s=0,clearInterval(n))}),100))}!function(){const e=Yt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,r(t))})).observe(document.body,{childList:!0,subtree:!0})}(),r(t)}))}const ri=(e,t)=>{let{device:i,session:o,request:n,logger:s}=t;const r=i,a=o,l=n,c=s;let d=0;const h=t=>{const i=t.wzrk_id.split("_")[0],o=ie(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(ae._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={};const e=Xe();s=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(s.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,r=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(r=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var h=s[a.sessionId];if(h){const e=h[i],o=h.tc;if("dnd"===e&&!le.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else h={},s[a.sessionId]=h;var u=s[o];if(null!=u){const e=u[i],t=u.tc;if(c>0&&t>=c&&d<0)return!1;if(r>0&&e>=r)return!1}else u={},s[o]=u;var p=s.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},s.global=p}if(null!=t.display.delay&&t.display.delay>0){const i=t.display.delay;return t.display.delay=0,setTimeout(ri,1e3*i,e,{device:r,session:a,request:l,logger:c}),!1}n(h,i,d),n(u,i,d),n(p,i,d);let g="wp";3===t.display.wtarget_type&&(g="wi");const f={};f[a.sessionId]=h,f[o]=u,f.global=p,et({[g]:f})},u=()=>{const e=r.getGuid(),t=a.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ge(e+"|"+t.p+"|"+t.s))},p=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},g=(e,t,i,o,n)=>{f(t),((e,t,i,o,n)=>{if(""!==e&&null!=e){let o,s;n?o=i:null!==i&&(s=i.getElementsByClassName("jsCT_CTA"),null!=s&&1===s.length&&(o=s[0]));const r=t.display.jsFunc,l=t.display.preview;null==l&&(e+=u()),null!=o&&(o.onclick=()=>{if(null!=r)return null==l&&Qe.fireRequest(e),p(r,t),void at("-1",0,a.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}})(e,t,i,0,n)},f=e=>{const t={type:"event"};t.evtName=R,t.evtData={[T]:e.wzrk_id},e.wzrk_pivot&&(t.evtData={...t.evtData,wzrk_pivot:e.wzrk_pivot}),l.processEvent(t)},v=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Lt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},m=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",Mt);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},y=e=>{const t=e.wzrk_id.split("_")[0],i=e.display;if(2===i.wtarget_type&&1===e.msgContent.type){const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});return void document.dispatchEvent(i)}if(1===i.layout)return O(void 0,e);if(3===i.layout){const t="wzrkImageOnlyDiv";if(!1===h(e))return;if(le.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Tt),(e=>{const t=document.createElement("ct-web-popup-imageonly");t.session=a,t.target=e;const i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)})(e)}if(!1===h(e))return;const o="wizParDiv"+i.layout;if(le.dismissSpamControl&&null!=document.getElementById(o)){document.getElementById(o).remove()}if(null!=document.getElementById(o))return;le.campaignDivMap[t]=o;const n=2===i.layout,s=document.createElement("div");s.id=o;const r=window.innerHeight,l=window.innerWidth;let c=!1;if(n)s.setAttribute("style",i.iFrameStyle);else{var d=10;let e=5*l/100,t=d+5*r/100,o=30*l/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(o=85*l/100+20,e=5*l/100,t=5*r/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(o=50*l/100+20,e=5*l/100,t=5*r/100,n="width:50%;"),null==i.proto?(c=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+o+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",n+i.iFrameStyle)}document.body.appendChild(s);const u=document.createElement("iframe"),p=!1===i.br?"0":"8";u.frameborder="0px",u.marginheight="0px",u.marginwidth="0px",u.scrolling="no",u.id="wiz-iframe";const f=e.display.onClick;let v,b="";if(""!==f&&null!=f&&(b="cursor:pointer;"),i.preview&&i["custom-editor"]&&(u.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)v=e.msgContent.html,v=v.replace(/##campaignId##/g,t),v=v.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const i='";let n,s,r,a,l;"dark"===e.display.theme?(n="#2d2d2e",s="#eaeaea",r="#353535",a="#353535",l="#ffffff"):(n="#ffffff",s="#000000",a="#f4f4f4",r="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let h="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(h="");v=i+("
×
"+h+"
"+c+"
")+("
"+d+"
")}u.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(u);const m=new Event("CT_campaign_rendered");document.dispatchEvent(m),i["custom-editor"]&&(v=k(e,v)),u.srcdoc=v;const y=()=>{d=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||n||(d+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=d+"px"},w=navigator.userAgent.toLowerCase();if(-1!==w.indexOf("safari"))if(w.indexOf("chrome")>-1)u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)};else{let t=u.contentDocument||u.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}}),300)}else u.onload=()=>{y();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");g(f,e,t,0,c)}},k=(e,t)=>{const i="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","replacements","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAtB;EACD,KAFD;EAGD;;EACD,MAAIqE,GAAG,CAACF,QAAR,EAAkB;EAChB5B,IAAAA,IAAI,CAAC0gC,EAAL,qCAAe1gC,IAAI,CAAC0gC,EAApB,GAA2B5+B,GAAG,CAACF,QAA/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc8W,qBAAd,CAAoC9W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAc+W,QAAd,CAAuB/W,IAAvB;;EACA,MAAMgX,cAAc,GAAG5K,YAAY,CAACtM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI6O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI+/B,SAAJ,CAAc1tC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n console.log('updateFormData called with', selector.values.form, isPreview)\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjEP;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKI,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;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/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc8W,qBAAd,CAAoC9W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAc+W,QAAd,CAAuB/W,IAAvB;;EACA,MAAMgX,cAAc,GAAG5K,YAAY,CAACtM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI6O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI8/B,SAAJ,CAAcztC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 99249204..f835532a 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}var w=0;function k(e){return"__private_"+w+++"_"+e}function C(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var x,P="clevertap-prod.com",S="https:",O=k("accountId"),I=k("region"),_=k("targetDomain"),E=k("dcSdkversion"),A=k("token"),L=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:""}),Object.defineProperty(this,_,{writable:!0,value:P}),Object.defineProperty(this,E,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=n,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return n(e,[{key:"id",get:function(){return C(this,O)[O]},set:function(e){C(this,O)[O]=e}},{key:"region",get:function(){return C(this,I)[I]},set:function(e){C(this,I)[I]=e}},{key:"dcSDKVersion",get:function(){return C(this,E)[E]},set:function(e){C(this,E)[E]=e}},{key:"targetDomain",get:function(){return C(this,_)[_]},set:function(e){C(this,_)[_]=e}},{key:"token",get:function(){return C(this,A)[A]},set:function(e){C(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===P?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),M=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),T=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),R=new RegExp("'","g"),j="clear",D="Charged ID",z="WZRK_CHARGED_ID",B="WZRK_G",N="WZRK_K",U="WZRK_CAMP",F="WZRK_CAMP_G",V="WZRK_EV",q="WZRK_META",W="WZRK_PR",K="WZRK_ARP",H="WZRK_L",G="global",J="optOut",Z="useIP",$="WZRK_X",Y="push",Q=31536e3,X="2",ee="wzrk_",te="wzrk_id",ie="Notification Viewed",ne="Notification Clicked",oe="WZRK_FPU",re="WZRK_PSD",ae="$incr",se="$decr",le="$set",ce="$add",de="$remove",ue="$delete",pe="WZRK_INBOX_CONFIG",he="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ge=["Stayed","UTM Visited","App Launched","Notification Sent",ie,ne],ye=function(e){return"string"==typeof e||e instanceof String},be=function(e){return"[object Object]"===Object.prototype.toString.call(e)},me=function(t){return"object"===e(t)&&t instanceof Date},we=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},ke=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ce=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},xe=function(e){return null!=e&&"undefined"!==e},Pe=function t(i,n){var o;if("object"!==e(i))return ye(i)?(o=Se(i,T)).length>1024&&(o=o.substring(0,1024),n.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=i,o;for(var r in i)if(i.hasOwnProperty(r)){var a=t(i[r],n),s=void 0;(s=Se(r,M)).length>1024&&(s=s.substring(0,1024),n.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete i[r],i[s]=a}return i},Se=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ie=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ee=function(e){if(Ae(e))return"$D_"+e},Ae=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var i=t[3],n=t[2]-1,o=t[1],r=new Date(o,n,i);return r.getDate()==i&&r.getMonth()==n&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return n(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}},{key:"createCookie",value:function(e,t,i,n){var o="",r="";if(i){var a=new Date;a.setTime(a.getTime()+1e3*i),o="; expires="+a.toGMTString()}n&&(r="; domain="+n),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,i,a),this.readCookie(e)==t){o=a,Me.broadDomain=o;break}}else this.createCookie(e,t,i,o)}else this.createCookie(e,t,i,n)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var i=this.readFromLSorCookie(q);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(q,i)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(N);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(N,e)}},{key:"backupEvent",value:function(e,t,i){var n=this.readFromLSorCookie(H);void 0===n&&(n={}),n[t]={q:e},this.saveToLSorCookie(H,n),i.debug("stored in ".concat(H," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var i=this.readFromLSorCookie(H);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(H,i))}}]),e}(),Me={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}},Te=k("keyOrder"),Re=k("deleteFromObject"),je=function(){function e(i){t(this,e),Object.defineProperty(this,Re,{value:De}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=i;var n=Le.readFromLSorCookie($);if(n){var o={};for(var r in C(this,Te)[Te]=[],n=n.cache)n.hasOwnProperty(r)&&(o[n[r][0]]=n[r][1],C(this,Te)[Te].push(n[r][0]));this.cache=o}else this.cache={},C(this,Te)[Te]=[]}return n(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=C(this,Re)[Re](e,this.cache),this.cache[e]=t,C(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var i=this.cache[e],n=C(this,Te)[Te];null!=i?this.cache=C(this,Re)[Re](e,this.cache):n.length===this.max&&(this.cache=C(this,Re)[Re](n[0],this.cache)),this.cache[e]=t,C(this,Te)[Te][C(this,Te)[Te]-1]!==e&&C(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],i=C(this,Te)[Te];for(var n in i)if(i.hasOwnProperty(n)){var o=[];o.push(i[n]),o.push(e[i[n]]),t.push(o)}Le.saveToLSorCookie($,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=C(this,Te)[Te];for(var i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}},{key:"getSecondLastKey",value:function(){var e=C(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=C(this,Te)[Te].length;if(e)return C(this,Te)[Te][e-1]}}]),e}(),De=function(e,t){var i,n=JSON.parse(JSON.stringify(C(this,Te)[Te])),o={};for(var r in n)n.hasOwnProperty(r)&&(n[r]!==e?o[n[r]]=t[n[r]]:i=r);return n.splice(i,1),C(this,Te)[Te]=JSON.parse(JSON.stringify(n)),o},ze=k("logger"),Be=k("request"),Ne=k("device"),Ue=k("session"),Fe=function(){function e(i){var n=i.logger,o=i.request,r=i.device,a=i.session;t(this,e),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),C(this,ze)[ze]=n,C(this,Be)[Be]=o,C(this,Ne)[Ne]=r,C(this,Ue)[Ue]=a}return n(e,[{key:"s",value:function(e,t,i,n,o){var r=!1,a=!1;if(window.isOULInProgress&&(i||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),Le.removeBackup(n,C(this,ze)[ze]),!(n>Me.globalCache.REQ_N)){if(xe(C(this,Ne)[Ne].gcookie)||e&&(a=!0),!xe(C(this,Ne)[Ne].gcookie)||i||"boolean"==typeof o){var s=C(this,Ue)[Ue].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(n)&&(!be(e[i][n])||!it(e[i][n])))return!1}else{if(be(e[i])||Array.isArray(e[i]))return!1;me(e[i])&&(e[i]=_e(e[i]))}if(ye(e[D])||Ce(e[D])){var o=e[D]+"";if(void 0===x&&(x=Le.readFromLSorCookie(z)),void 0!==x&&x.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;x=o,Le.saveToLSorCookie(z,o)}return!0}return!1},ot=k("logger"),rt=k("oldValues"),at=k("request"),st=k("isPersonalisationActive"),lt=k("processEventArray"),ct=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=i.call(this),Object.defineProperty(h(r),lt,{value:dt}),Object.defineProperty(h(r),ot,{writable:!0,value:void 0}),Object.defineProperty(h(r),rt,{writable:!0,value:void 0}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),C(h(r),ot)[ot]=a,C(h(r),rt)[rt]=n,C(h(r),at)[at]=s,C(h(r),st)[st]=l,r}return n(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0;){var t=e.shift();if(ye(t))if(t.length>1024&&(t=t.substring(0,1024),C(this,ot)[ot].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),ge.includes(t))C(this,ot)[ot].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var i={type:"event"};if(i.evtName=Se(t,M),0!==e.length){var n=e.shift();if(be(n)){if("Charged"===t){if(!nt(n,C(this,ot)[ot])){C(this,ot)[ot].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!it(n)){C(this,ot)[ot].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=n}else e.unshift(n)}C(this,at)[at].processEvent(i)}else C(this,ot)[ot].error(Ge)}},ut=function(e){var t={},i=e.indexOf("?");if(i>1){var n,o=e.substring(i+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=a.exec(o);n;)t[s(n[1])]=s(n[2]),n=a.exec(o)}return t},pt=function(e,t,i){return e+"&"+t+"="+encodeURIComponent(i)},ht=function(){return window.location.hostname},ft=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),gt(e)},vt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),gt=function(e){if(null==e)return"";var t,i,n,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,i,n,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,f=0,v=String.fromCharCode;for(n=0;n>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(h<<=1,15==f){p+=v(h);break}f++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),n=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,n=255&e.charCodeAt((c+1)/2)):i=n=NaN),c+=3,o=t>>2,r=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),l=l+vt.charAt(o)+vt.charAt(r)+vt.charAt(a)+vt.charAt(s);return l},yt=k("fireRequest"),bt=k("dropRequestDueToOptOut"),mt=k("addUseIPToRequest"),wt=k("addARPToRequest"),kt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return n(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,i,n){C(this,yt)[yt](e,1,t,i,n)}}]),e}();kt.logger=void 0,kt.device=void 0,kt.account=void 0,Object.defineProperty(kt,yt,{value:function(e,t,i,n,o){var r,a,s=this;if(C(this,bt)[bt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(xe(this.device.gcookie)||(Me.blockRequest=!0),o&&o===ve)!xe(this.device.gcookie)&&Me.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(kt,bt,{value:function(){return!Me.isOptInRequest&&xe(this.device.gcookie)&&ye(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(Me.isOptInRequest=!1,!1)}}),Object.defineProperty(kt,mt,{value:function(e){var t=Le.getMetaProp(Z);return"boolean"!=typeof t&&(t=!1),pt(e,Z,t?"true":"false")}}),Object.defineProperty(kt,wt,{value:function(e,t){if(!0===t){var i={skipResARP:!0};return pt(e,"arp",ft(JSON.stringify(i),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(K)&&null!==localStorage.getItem(K)?pt(e,"arp",ft(JSON.stringify(Le.readFromLSorCookie(K)),this.logger)):e}});var Ct,xt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(U);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(R,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},Pt=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},xt()),e),i=JSON.stringify(t);Le.save(U,encodeURIComponent(i)),St()}},St=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(xe(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(F)?JSON.parse(decodeURIComponent(Le.read(F))):{};if(e&&Le._isLocalStorageSupported()){var i={},n=xt();Object.keys(n).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=n[r].global,c=Oe(),d=n[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var f=0,v=0,g=u[p];if("tc"===g)continue;void 0!==d&&void 0!==d[g]&&(f=d[g]),void 0!==l&&void 0!==l[g]&&(v=l[g]),h=[g,f,v],s[g]=h}}}i=a(a({},i),{},o({},r,s))})),t[e]=i,Le.save(F,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=xt();var i=Le.read(F),n=i?decodeURIComponent(i):null,o=n?JSON.parse(n):null,r=e&&null!=i&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=i&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},It=function(e,t){var i=t.logger,n=!1;if(be(e))for(var o in e)if(e.hasOwnProperty(o)){n=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(n=!1,i.error(Je)),"Employed"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error(Ze)),"Married"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(n=!1,i.error(Ye)),"Age"===o&&null!=r&&(ke(r)?e.Age=+r:(n=!1,i.error(Qe))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||me(r)||(n=!1,i.error(Xe)),me(r)&&(e[o]=_e(r))):me(r)&&(e[o]=_e(r)),"Phone"!==o||we(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),ke(r)?e.Phone=+r:(n=!1,i.error(tt+". Removed."))):(n=!1,i.error(tt+". Removed."))),n||delete e[o]}return n},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var i=function(e){if(null!=e){for(var t="",i="",n=0;n0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ee(o[2]+o[0]+o[1])}return t},Et=function(e,t){var i=t.logger,n={};if(null!=e.displayName&&(n.Name=e.displayName),null!=e.id&&(n.GPID=e.id+""),null!=e.gender&&("male"===e.gender?n.Gender="M":"female"===e.gender?n.Gender="F":"other"===e.gender&&(n.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(n.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var i=e[t],n={},o=void 0;if(null!=i.Site){if(o=i.Site,we(o)||!It(o,{logger:C(this,Rt)[Rt]}))return}else if(null!=i.Facebook){var r=i.Facebook;we(r)||r.error||(o=_t(r))}else if(null!=i["Google Plus"]){var a=i["Google Plus"];we(a)||a.error||(o=Et(a,{logger:C(this,Rt)[Rt]}))}if(null!=o&&!we(o)){n.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=o,At(o,!0),n=C(this,jt)[jt].addSystemDataToObject(n,void 0),C(this,jt)[jt].addFlags(n);var s=ft(JSON.stringify(n),C(this,Rt)[Rt]),l=C(this,Dt)[Dt].dataPostURL;l=pt(l,"type",Y),l=pt(l,"d",s),C(this,jt)[jt].saveAndFireRequest(l,Me.blockRequest)}}},Vt=k("request"),qt=k("logger"),Wt=k("account"),Kt=k("session"),Ht=k("oldValues"),Gt=k("device"),Jt=k("processOUL"),Zt=k("handleCookieFromCache"),$t=k("deleteUser"),Yt=k("processLoginArray"),Qt=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=i.call(this),Object.defineProperty(h(r),Yt,{value:ii}),Object.defineProperty(h(r),$t,{value:ti}),Object.defineProperty(h(r),Zt,{value:ei}),Object.defineProperty(h(r),Jt,{value:Xt}),Object.defineProperty(h(r),Vt,{writable:!0,value:void 0}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Wt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),C(h(r),Vt)[Vt]=a,C(h(r),Wt)[Wt]=s,C(h(r),Kt)[Kt]=l,C(h(r),qt)[qt]=c,C(h(r),Ht)[Ht]=n,C(h(r),Gt)[Gt]=d,r}return n(o,[{key:"clear",value:function(){C(this,qt)[qt].debug("clear called. Reset flag has been set."),C(this,$t)[$t](),Le.setMetaProp(j,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,we(s)||!It(s,{logger:C(this,qt)[qt]}))return}else if(null!=r.Facebook){var l=r.Facebook;we(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];we(c)&&!c.error&&(s=Et(c,{logger:C(this,qt)[qt]}))}if(null!=s&&!we(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&n(d)),At(s,!0),a=C(this,Vt)[Vt].addSystemDataToObject(a,void 0),C(this,Vt)[Vt].addFlags(a),i&&(a.isOUL=!0);var u=ft(JSON.stringify(a),C(this,qt)[qt]),p=C(this,Wt)[Wt].dataPostURL;p=pt(p,"type",Y),p=pt(p,"d",u),C(this,Vt)[Vt].saveAndFireRequest(p,Me.blockRequest,i)}}},ei=function(){Me.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(U,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Kt)[Kt].setSessionCookieObject("")},ti=function(){Me.blockRequest=!0,C(this,qt)[qt].debug("Block request is true"),Me.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,Me.broadDomain),Le.removeCookie(U,ht()),Le.removeCookie(N,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Gt)[Gt].gcookie=null,C(this,Kt)[Kt].setSessionCookieObject("")},ii=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&be(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{C(this,Jt)[Jt]([t])}catch(e){C(this,qt)[qt].debug(e)}}else C(this,qt)[qt].error("Profile object is in incorrect format")}},ni=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),oi=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni),e}return n(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var i=t.target.id;if(i.startsWith("carousel__button")){var n=+i.split("-")[1];n!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=n,e.updateSelectedItem(),e.startAutoSlide())}else if(i.startsWith("carousel__arrow"))i.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(i.indexOf("-")>-1){var o=+i.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,i){var n=document.createElement("ct-web-personalisation-banner");n.classList.add("carousel__item"),n.trackClick=!1,n.setAttribute("id","carousel__item-".concat(i+1)),n.details=t,e.appendChild(n)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var i=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),n=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));i.classList.add("carousel__item--selected"),n&&n.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),ri=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],i=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var n=xt(),o=n.wp[i];null==o&&(o={},n[i]=o),o[t]="dnd",Pt(n)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),ai=function(e){s(o,e);var i=v(o);function o(e,n){var r;return t(this,o),(r=i.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=n,r.renderMessage(n),r}return n(o,[{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var i=this.createEl("div","timeStamp");if(i.innerHTML="".concat(gi(e.id.split("_")[1]),""),!e.viewed){var n=this.createEl("span","unreadMarker");i.appendChild(n)}this.wrapper.appendChild(i),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}var n=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");n.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&n.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(n),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.createEl("div","buttonsContainer"),n=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(n=!0),i.appendChild(r)})),n&&this.addSnackbar(i),i}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=mi;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var i=this.createEl("div","".concat(t,"Container")),n=this.createEl("img",t);return n.setAttribute("src",e),n.setAttribute("loading","lazy"),i.appendChild(n),i}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var i=this,n=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=n.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){i.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&n.onClickUrl&&(n.openUrlInNewTab?window.open(n.onClickUrl,"_blank"):window.location=n.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),si=function(e){s(o,e);var i=v(o);function o(e){var n;return t(this,o),(n=i.call(this)).isInboxOpen=!1,n.isInboxFromFlutter=!1,n.selectedCategory=null,n.unviewedMessages={},n.unviewedCounter=0,n.isPreview=!1,n.inboxConfigForPreview={},n.inboxSelector=null,n.inbox=null,n.emptyInboxMsg=null,n.inboxCard=null,n.unviewedBadge=null,n.observer=null,n.selectedCategoryRef=null,n.addClickListenerOnDocument=function(e){if(e.composedPath().includes(n.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var i=t[0].id;if("closeInbox"===i)n.toggleInbox();else if(i.startsWith("category-"))n.prevCategoryRef=n.selectedCategoryRef,n.selectedCategoryRef=t[0],n.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],n.isPreview)}}}else(n.inboxSelector.contains(e.target)||n.isInboxOpen)&&(n.isInboxFromFlutter?n.isInboxFromFlutter=!1:n.toggleInbox(e))},n.setBadgeStyle=function(e){null!==n.unviewedBadge&&(n.unviewedBadge.innerText=e>9?"9+":e,n.unviewedBadge.style.display=e>0?"flex":"none")},n.logger=e,n.shadow=n.attachShadow({mode:"open"}),n}return n(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(pe)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),i=t?Object.keys(t):[];0!==i.length&&(i.forEach((function(i){t[i].viewed||(e.unviewedMessages[i]=t[i],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=ui(),i=Math.floor(Date.now()/1e3);for(var n in t)if(t[n].wzrk_ttl&&t[n].wzrk_ttl>0&&t[n].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),pi(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.deleteExpiredAndGetUnexpiredMsgs(),n=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=n-r,t.viewed=0,i[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),pi(i),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,i=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(i-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),i=this.createEl("div","headerTitle");i.innerText=this.config.title;var n=this.createEl("div","closeInbox");if(n.innerHTML="×",t.appendChild(i),t.appendChild(n),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,i){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),i=this.createEl("div","leftArrow");i.innerHTML=bi,i.children[0].style="transform: rotate(180deg)",i.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(i);var n=this.createEl("div","categoriesWrapper");["All"].concat(g(this.config.categories)).forEach((function(t,i){var o=e.createEl("div","category-".concat(i),"category");o.innerText=t,0===i&&(e.selectedCategoryRef=o),n.appendChild(o)})),t.appendChild(n);var o=this.createEl("div","rightArrow");o.innerHTML=bi,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=n.children[0],s=n.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(i,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var i=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&i++)})),0===i?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var i,n=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=m(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=new ai(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>n;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,i=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,i?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var i=ui();i[e]=t,pi(i)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,i=getComputedStyle(Me.inbox),n=i.getPropertyValue("--inbox-top"),o=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),a=i.getPropertyValue("--inbox-right");if(t>481&&!(n||o||r||a)){var s=vi(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var i=ui();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=gi(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var i,n,o,r,a,s,l,c,d,u,p,h,f,v,g,y,b,m,w,k,C,x=(n=(i=t).panelBackgroundColor,o=i.panelBorderColor,r=i.headerBackgroundColor,a=i.headerTitleColor,s=i.closeIconColor,l=i.categoriesTabColor,c=i.categoriesTitleColor,d=i.categoriesBorderColor,u=i.selectedCategoryTabColor,p=i.selectedCategoryTitleColor,h=i.selectedCategoryBorderColor,f=i.headerCategoryHeight,'\n \n ")),P=this.config.styles.cards;return x+(v={backgroundColor:P.backgroundColor,borderColor:P.borderColor,titleColor:P.titleColor,descriptionColor:P.descriptionColor,buttonColor:P.buttonColor,buttonTextColor:P.buttonTextColor,unreadMarkerColor:P.unreadMarkerColor},g=v.backgroundColor,y=v.borderColor,b=v.titleColor,m=v.descriptionColor,w=v.buttonColor,k=v.buttonTextColor,C=v.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var n="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=n,i[n]=t,e.unviewedMessages[n]=t,e.unviewedCounter++})),this.buildUIForMessages(i),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),li=function(e){e.inbox_preview?Me.inbox.incomingMessagesForPreview=e.inbox_notifs:Me.inbox.incomingMessages=e},ci=function(e){fi(),Me.inbox=new si({logger:e}),document.body.appendChild(Me.inbox)},di=function(e){var t=Le.readFromLSorCookie(he)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var i={};return i[e]=t,Le.saveToLSorCookie(he,i),i}return t},ui=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!xe(e))return{};var t=di(e);return t.hasOwnProperty(e)?t[e]:{}},pi=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(xe(t)){var i=a(a({},di(t)),{},o({},t,e));Le.saveToLSorCookie(he,i)}},hi=function(e){return new Promise((function(t,i){if("complete"===document.readyState)ci(e),t();else{var n=Le.readFromLSorCookie(pe)||{},o=function(){null===Me.inbox&&ci(e),t()};window.addEventListener("load",(function(){if(document.getElementById(n.inboxSelector))o();else{var i=0;if(i<20)var r=setInterval((function(){document.getElementById(n.inboxSelector)?(o(),clearInterval(r),t()):i>=20&&(clearInterval(r),e.debug("Failed to add inbox")),i++}),500)}}))}}))},fi=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",si),customElements.define("ct-inbox-message",ai))},vi=function(e,t,i){var n,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,f=c.top+a,v=c.bottom,g=c.height,y=c.width,b=!1,m=16;if(v+t<=l){var w=l-(v+t);o=w>=m?v+m:v+w}else if(f-t>=a){var k=f-t;o=k>=m?f-t-m:f-t-k}else b=!0,(o=u+g/2-t/2)l&&(o=l-t);if(b){var C=h+i;if(C<=s){n=h+(C+m<=s?m:s-C)}else{var x=p-i;n=x-(x-m>=r?m:x-r)}}else(n=d+y/2-i/2)s&&(n=h-i>=r?h-i:s-i);return{xPos:n,yPos:o}},gi=function(e){var t=Date.now(),i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60))<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago"))},yi=function(){return Object.keys(Le.readFromLSorCookie(pe)||{}).length>0},bi='\n\n\n',mi='\n\n\n',wi="https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css",ki="wve-anti-flicker-show",Ci="wve-anti-flicker-hide",xi="wve-flicker-style",Pi=function(e,t){var i=window.location.search,n=window.opener;if("?ctBuilder"===i)return e.debug("open in visual builder mode"),window.addEventListener("message",Si,!1),void(n&&n.postMessage({message:"builder",originUrl:window.location.href},"*"));"?ctBuilderPreview"===i&&(window.addEventListener("message",Si,!1),n&&n.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===i&&n&&n.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.9.6"},"*")},Si=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,i,n=new URL(e.data.originUrl).origin;if(e.origin===n)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Oi(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&Ai(e.data,!0)}},Oi=function(e,t,i,n){"complete"===document.readyState?Ei(e,t,i,n):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&Ei(e,t,i,n)}))},Ii=!1,_i=!1;function Ei(e,t,i,n){if(!Ii){window.Shopify&&(_i=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(Ct=document.createElement("div")).id="overlayDiv",Ct.style.position="relative",Ct.style.display="flex",document.body.appendChild(Ct);(function(e,t,i,n,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:n,isShopify:_i,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js",e,t,i,n).then((function(){console.log("Overlay script loaded successfully."),Ii=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=wi,document.head.appendChild(o)}var o}var Ai=function(e,t){console.log(e.details);var i=t?e.details:e.display.details,n=!1,o=function(i,n){var o;n.values&&(n.values.html?i.outerHTML=n.values.html:(null===(o=n.values)||void 0===o?void 0:o.json)?function(e,t){var i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);var n=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(n)}(e,n.values):function(e,t,i){if(void 0!==t.style&&Object.keys(t.style).forEach((function(i){e.style.setProperty(i,t.style[i])})),void 0!==t.underline){var n=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(n," underline").trim():e.style.textDecoration=n.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text.replacements),void 0!==t.clickDetails){var o=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){return window.open(o,"_blank").focus()}:function(){window.location.href=o}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var r=document.createElement("style");r.innerHTML=t.elementCss,document.head.appendChild(r)}}(i,n.values.form,t))};i.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,i,r,a=document.querySelector(e.selector);a?(o(a,e),n=!0):(t=e,i=0,r=setInterval((function(){var e=document.querySelector(t.selector);e?(o(e,t),clearInterval(r)):++i>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(r))}),500))}))})),n&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function Li(e){var t,i=e.personalizedSelectors,n=void 0===i?[]:i,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function i(e){var t=[];e.forEach((function(e){var i=document.querySelectorAll(e);i.length?(i.forEach((function(e){var i,n,o,r;i=e.getBoundingClientRect(),n=window,o=n.innerHeight,r=n.innerWidth,i.bottom>0&&i.right>0&&i.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=xi;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(n))})).observe(document.body,{childList:!0,subtree:!0}),l(n)}))}var Mi=function e(t,i){var n,r=i.device,s=i.session,l=i.request,c=i.logger,d=r,u=s,p=l,h=c,f=0,v=function(i){var n=i.wzrk_id.split("_")[0],r=Oe(),a=function(e,t,i){var n=0,o=0;null!=e[t]&&(n=e[t]),n++,null!=e.tc&&(o=e.tc),i<0&&o++,e.tc=o,e[t]=n};if(Le._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={},l=xt();s=3===i.display.wtarget_type&&l.hasOwnProperty("wi")?l.wi:0!==i.display.wtarget_type&&1!==i.display.wtarget_type||!l.hasOwnProperty("wp")?{}:l.wp,l.hasOwnProperty("global")&&(s.wp=l),null==i.display.wmc&&(i.display.wmc=1),null==i.display.wimc&&(i.display.wimc=1);var c=-1,f=-1,v=-1,g=-1,y=-1,b=-1,m=-1;null!=i.display.efc&&(c=parseInt(i.display.efc,10)),null!=i.display.mdc&&(f=parseInt(i.display.mdc,10)),null!=i.display.tdc&&(v=parseInt(i.display.tdc,10)),null!=i.display.tlc&&(g=parseInt(i.display.tlc,10)),null!=i.display.wmp&&(y=parseInt(i.display.wmp,10)),null!=i.display.wmc&&(b=parseInt(i.display.wmc,10)),null!=i.display.wimc&&(m=parseInt(i.display.wimc,10));var w=s[u.sessionId];if(w){var k=w[n],C=w.tc;if("dnd"===k&&!Me.dismissSpamControl)return!1;if(3===i.display.wtarget_type){if(m>0&&C>=m&&c<0)return!1}else if(b>0&&C>=b&&c<0)return!1;if(f>0&&k>=f)return!1}else w={},s[u.sessionId]=w;var x=s[r];if(null!=x){var P=x[n],S=x.tc;if(y>0&&S>=y&&c<0)return!1;if(v>0&&P>=v)return!1}else x={},s[r]=x;var O=s.global;if(null!=O){var I=O[n];if(g>0&&I>=g)return!1}else O={},s.global=O}if(null!=i.display.delay&&i.display.delay>0){var _=i.display.delay;return i.display.delay=0,setTimeout(e,1e3*_,t,{device:d,session:u,request:p,logger:h}),!1}a(w,n,c),a(x,n,c),a(O,n,c);var E="wp";3===i.display.wtarget_type&&(E="wi");var A={};A[u.sessionId]=w,A[r]=x,A.global=O,Pt(o({},E,A))},g=function(){var e=d.getGuid(),t=u.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(gt(e+"|"+t.p+"|"+t.s))},y=function(e,t){var i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},b=function(e,t,i,n,o){w(t),function(e,t,i,n,o){if(""!==e&&null!=e){var r,a;o?r=i:null!==i&&null!=(a=i.getElementsByClassName("jsCT_CTA"))&&1===a.length&&(r=a[0]);var s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=g()),null!=r&&(r.onclick=function(){if(null!=s)return null==l&&kt.fireRequest(e),y(s,t),void Lt("-1",0,u.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}}(e,t,i,0,o)},w=function(e){var t={type:"event"};t.evtName=ie,t.evtData=o({},te,e.wzrk_id),e.wzrk_pivot&&(t.evtData=a(a({},t.evtData),{},{wzrk_pivot:e.wzrk_pivot})),p.processEvent(t)},k=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-banner");n.msgId=e.wzrk_id,n.pivotId=e.wzrk_pivot,n.divHeight=e.display.divHeight,n.details=e.display.details[0];var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},C=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",oi);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-carousel");n.target=e;var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},x=function(e){var t=e.wzrk_id.split("_")[0],i=e.display;if(2!==i.wtarget_type||1!==e.msgContent.type){if(1===i.layout)return I(void 0,e);if(3===i.layout){var n="wzrkImageOnlyDiv";if(!1===v(e))return;if(Me.dismissSpamControl&&null!=document.getElementById(n))document.getElementById(n).remove();if(null!=document.getElementById(n)||null!=document.getElementById("intentPreview"))return;var o=document.createElement("div");return o.id=n,document.body.appendChild(o),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",ri),function(e){var t=document.createElement("ct-web-popup-imageonly");t.session=u,t.target=e;var i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)}(e)}if(!1!==v(e)){var r="wizParDiv"+i.layout;if(Me.dismissSpamControl&&null!=document.getElementById(r))document.getElementById(r).remove();if(null==document.getElementById(r)){Me.campaignDivMap[t]=r;var a=2===i.layout,s=document.createElement("div");s.id=r;var l=window.innerHeight,c=window.innerWidth,d=!1;if(a)s.setAttribute("style",i.iFrameStyle);else{var p=10,h=5*c/100,f=p+5*l/100,g=30*c/100+20,y="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(g=85*c/100+20,h=5*c/100,f=5*l/100,y="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(g=50*c/100+20,h=5*c/100,f=5*l/100,y="width:50%;"),null==i.proto?(d=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+f+"px !important;width:"+g+"px !important;right:"+h+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",y+i.iFrameStyle)}document.body.appendChild(s);var m=document.createElement("iframe"),w=!1===i.br?"0":"8";m.frameborder="0px",m.marginheight="0px",m.marginwidth="0px",m.scrolling="no",m.id="wiz-iframe";var k,C=e.display.onClick,x="";if(""!==C&&null!=C&&(x="cursor:pointer;"),i.preview&&i["custom-editor"]&&(m.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)k=(k=(k=e.msgContent.html).replace(/##campaignId##/g,t)).replace(/##campaignId_batchId##/g,e.wzrk_id);else{var S,O,_,E,A,L='";"dark"===e.display.theme?(S="#2d2d2e",O="#eaeaea",_="#353535",E="#353535",A="#ffffff"):(S="#ffffff",O="#000000",E="#f4f4f4",_="#a5a6a6",A="#ffffff");var M=e.msgContent.title,T=e.msgContent.description,R="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(R=""),k=L+("
×
"+R+"
"+M+"
")+("
"+T+"
")}m.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(m);var j=new Event("CT_campaign_rendered");document.dispatchEvent(j),i["custom-editor"]&&(k=P(e,k)),m.srcdoc=k;var D=function(){p=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||a||(p+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=p+"px"},z=navigator.userAgent.toLowerCase();if(-1!==z.indexOf("safari"))if(z.indexOf("chrome")>-1)m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)};else{var B=m.contentDocument||m.contentWindow;B.document&&(B=B.document);var N=setInterval((function(){if("complete"===B.readyState){clearInterval(N),D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}),300)}else m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}}}else{var U={};U.msgId=e.wzrk_id,e.wzrk_pivot&&(U.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(U.kv=e.msgContent.kv);var F=new CustomEvent("CT_web_native_display",{detail:U});document.dispatchEvent(F)}},P=function(e,t){var i="\n "); + const appendScriptForCustomEvent = (targetingMsgJson, html) => { + const script = "\n "); return html.replace(/(<\s*\/\s*body)/, "".concat(script, "\n$1")); }; - var _callBackCalled = false; + let _callBackCalled = false; - var showFooterNotification = function showFooterNotification(targetingMsgJson) { - var onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable + const showFooterNotification = targetingMsgJson => { + let onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { - var notificationCallback = window.clevertap.notificationCallback; + const notificationCallback = window.clevertap.notificationCallback; if (!_callBackCalled) { - var inaObj = {}; + const inaObj = {}; inaObj.msgContent = targetingMsgJson.msgContent; inaObj.msgId = targetingMsgJson.wzrk_id; @@ -6103,9 +5507,9 @@ inaObj.kv = targetingMsgJson.display.kv; } - window.clevertap.raiseNotificationClicked = function () { + window.clevertap.raiseNotificationClicked = () => { if (onClick !== '' && onClick != null) { - var jsFunc = targetingMsgJson.display.jsFunc; + const jsFunc = targetingMsgJson.display.jsFunc; onClick += getCookieParams(); // invoke js function call if (jsFunc != null) { @@ -6124,7 +5528,7 @@ } }; - window.clevertap.raiseNotificationViewed = function () { + window.clevertap.raiseNotificationViewed = () => { incrementImpression(targetingMsgJson); }; @@ -6136,13 +5540,13 @@ renderFooterNotification(targetingMsgJson); if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { - var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; - var _inaObj = {}; - _inaObj.msgContent = targetingMsgJson.msgContent; - _inaObj.msgId = targetingMsgJson.wzrk_id; + const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; + const inaObj = {}; + inaObj.msgContent = targetingMsgJson.msgContent; + inaObj.msgId = targetingMsgJson.wzrk_id; if (targetingMsgJson.wzrk_pivot) { - _inaObj.pivotId = targetingMsgJson.wzrk_pivot; + inaObj.pivotId = targetingMsgJson.wzrk_pivot; } var msgCTkv = []; @@ -6150,66 +5554,61 @@ for (var wzrkPrefixKey in targetingMsgJson) { // ADD WZRK PREFIX KEY VALUE PAIRS if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { - var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); - + const wzrkJson = { + [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] + }; msgCTkv.push(wzrkJson); } } if (msgCTkv.length > 0) { - _inaObj.msgCTkv = msgCTkv; + inaObj.msgCTkv = msgCTkv; } if (targetingMsgJson.display.kv != null) { - _inaObj.kv = targetingMsgJson.display.kv; + inaObj.kv = targetingMsgJson.display.kv; } // PUBLIC API TO RECORD CLICKED EVENT - window.clevertap.raisePopupNotificationClicked = function (notificationData) { + window.clevertap.raisePopupNotificationClicked = notificationData => { if (!notificationData || !notificationData.msgId) { return; } - var eventData = {}; + const eventData = {}; eventData.type = 'event'; eventData.evtName = NOTIFICATION_CLICKED; - eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); + eventData.evtData = { + [WZRK_ID]: notificationData.msgId + }; if (targetingMsgJson.wzrk_pivot) { - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { + eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId - }); + }; } // WZRK PREFIX KEY VALUE PAIRS if (notificationData.msgCTkv) { - var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), - _step; - - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var wzrkPrefixObj = _step.value; - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); + for (var wzrkPrefixObj of notificationData.msgCTkv) { + eventData.evtData = { ...eventData.evtData, + ...wzrkPrefixObj + }; } } _request.processEvent(eventData); }; - popupCallback(_inaObj); + popupCallback(inaObj); } } }; - var exitintentObj; + let exitintentObj; - var showExitIntent = function showExitIntent(event, targetObj) { - var targetingMsgJson; + const showExitIntent = (event, targetObj) => { + let targetingMsgJson; if (event != null && event.clientY > 0) { return; @@ -6222,7 +5621,7 @@ } if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) { - var element = document.getElementById('intentPreview'); + const element = document.getElementById('intentPreview'); element.remove(); document.getElementById('intentOpacityDiv').remove(); } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist @@ -6241,16 +5640,16 @@ return; } - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; $ct.campaignDivMap[campaignId] = 'intentPreview'; - var legacy = false; - var opacityDiv = document.createElement('div'); + let legacy = false; + const opacityDiv = document.createElement('div'); opacityDiv.id = 'intentOpacityDiv'; - var opacity = targetingMsgJson.display.opacity || 0.7; - var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + const opacity = targetingMsgJson.display.opacity || 0.7; + const rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); document.body.appendChild(opacityDiv); - var msgDiv = document.createElement('div'); + const msgDiv = document.createElement('div'); msgDiv.id = 'intentPreview'; if (targetingMsgJson.display.proto == null) { @@ -6261,15 +5660,15 @@ } document.body.appendChild(msgDiv); - var iframe = document.createElement('iframe'); - var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; + const iframe = document.createElement('iframe'); + const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe-intent'; - var onClick = targetingMsgJson.display.onClick; - var pointerCss = ''; + const onClick = targetingMsgJson.display.onClick; + let pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; @@ -6279,15 +5678,15 @@ iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; } - var html; // direct html + let html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - var css = '' + ''; - var bgColor, textColor, btnBg, btColor; + const css = '' + ''; + let bgColor, textColor, btnBg, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -6301,30 +5700,30 @@ btColor = '#ffffff'; } - var titleText = targetingMsgJson.msgContent.title; - var descriptionText = targetingMsgJson.msgContent.description; - var ctaText = ''; + const titleText = targetingMsgJson.msgContent.title; + const descriptionText = targetingMsgJson.msgContent.description; + let ctaText = ''; if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { ctaText = "'; } - var imageTd = ''; + let imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = "
 + titleText + ' /></div>';
         }
 
-        var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; - var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; + const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'intentPreview');"; + const title = "
" + "×" + "
" + "
" + titleText + '
'; + const body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); // Dispatch event for interstitial/exit intent close - var closeCampaign = new Event('CT_campaign_rendered'); + const closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); if (targetingMsgJson.display['custom-editor']) { @@ -6333,8 +5732,8 @@ iframe.srcdoc = html; - iframe.onload = function () { - var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); + iframe.onload = () => { + const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); }; }; @@ -6353,8 +5752,8 @@ return; } - var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { - Object.keys(arrInAppNotifs).map(function (key) { + const processNativeDisplayArr = arrInAppNotifs => { + Object.keys(arrInAppNotifs).map(key => { var elementId, id; if (arrInAppNotifs[key].display.divId) { @@ -6372,12 +5771,12 @@ }); }; - var addLoadListener = function addLoadListener(arrInAppNotifs) { - window.addEventListener('load', function () { - var count = 0; + const addLoadListener = arrInAppNotifs => { + window.addEventListener('load', () => { + let count = 0; if (count < 20) { - var t = setInterval(function () { + const t = setInterval(() => { processNativeDisplayArr(arrInAppNotifs); if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { @@ -6392,10 +5791,10 @@ }; if (msg.inapp_notifs != null) { - var arrInAppNotifs = {}; + const arrInAppNotifs = {}; - for (var index = 0; index < msg.inapp_notifs.length; index++) { - var targetNotif = msg.inapp_notifs[index]; + for (let index = 0; index < msg.inapp_notifs.length; index++) { + const targetNotif = msg.inapp_notifs[index]; if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { showFooterNotification(targetNotif); @@ -6407,7 +5806,7 @@ // if display['wtarget_type']==2 then web native display if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel - var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); + const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); if (element !== null) { targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); @@ -6432,7 +5831,7 @@ } } - var mergeEventMap = function mergeEventMap(newEvtMap) { + const mergeEventMap = newEvtMap => { if ($ct.globalEventsMap == null) { $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); @@ -6442,10 +5841,10 @@ } } - for (var key in newEvtMap) { + for (const key in newEvtMap) { if (newEvtMap.hasOwnProperty(key)) { - var oldEvtObj = $ct.globalEventsMap[key]; - var newEvtObj = newEvtMap[key]; + const oldEvtObj = $ct.globalEventsMap[key]; + const newEvtObj = newEvtMap[key]; if ($ct.globalEventsMap[key] != null) { if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { @@ -6458,18 +5857,18 @@ } }; - var handleInboxNotifications = function handleInboxNotifications() { + const handleInboxNotifications = () => { if (msg.inbox_preview) { processInboxNotifs(msg); return; } if (msg.inbox_notifs) { - var msgArr = []; + const msgArr = []; - for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { - if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { - msgArr.push(msg.inbox_notifs[_index]); + for (let index = 0; index < msg.inbox_notifs.length; index++) { + if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) { + msgArr.push(msg.inbox_notifs[index]); } } @@ -6489,9 +5888,9 @@ if ($ct.inbox === null) { msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); - initializeWebInbox(_logger).then(function () { + initializeWebInbox(_logger).then(() => { handleInboxNotifications(); - }).catch(function (e) {}); + }).catch(e => {}); } else { handleInboxNotifications(); } @@ -6502,18 +5901,18 @@ return; } - var staleDataUpdate = function staleDataUpdate(staledata, campType) { - var campObj = getCampaignObject(); - var globalObj = campObj[campType].global; + const staleDataUpdate = (staledata, campType) => { + const campObj = getCampaignObject(); + const globalObj = campObj[campType].global; if (globalObj != null && campType) { - for (var idx in staledata) { + for (const idx in staledata) { if (staledata.hasOwnProperty(idx)) { delete globalObj[staledata[idx]]; if (StorageManager.read(CAMP_COOKIE_G)) { - var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); + const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { delete guidCampObj[guid][campType][staledata[idx]]; @@ -6530,10 +5929,10 @@ if (StorageManager._isLocalStorageSupported()) { try { if (msg.evpr != null) { - var eventsMap = msg.evpr.events; - var profileMap = msg.evpr.profile; - var syncExpiry = msg.evpr.expires_in; - var now = getNow(); + const eventsMap = msg.evpr.events; + const profileMap = msg.evpr.profile; + const syncExpiry = msg.evpr.expires_in; + const now = getNow(); StorageManager.setMetaProp('lsTime', now); StorageManager.setMetaProp('exTs', syncExpiry); mergeEventMap(eventsMap); @@ -6567,12 +5966,11 @@ var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var User = /*#__PURE__*/function () { - function User(_ref) { - var isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, User); - + class User { + constructor(_ref) { + let { + isPersonalisationActive + } = _ref; Object.defineProperty(this, _isPersonalisationActive$2, { writable: true, value: void 0 @@ -6580,40 +5978,35 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; } - _createClass(User, [{ - key: "getTotalVisits", - value: function getTotalVisits() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } + getTotalVisits() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - var visitCount = StorageManager.getMetaProp('sc'); + let visitCount = StorageManager.getMetaProp('sc'); - if (visitCount == null) { - visitCount = 1; - } + if (visitCount == null) { + visitCount = 1; + } + + return visitCount; + } - return visitCount; + getLastVisit() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; } - }, { - key: "getLastVisit", - value: function getLastVisit() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } - var prevSession = StorageManager.getMetaProp('ps'); + const prevSession = StorageManager.getMetaProp('ps'); - if (prevSession != null) { - return new Date(prevSession * 1000); - } + if (prevSession != null) { + return new Date(prevSession * 1000); } - }]); + } - return User; - }(); + } - var logLevels = { + const logLevels = { DISABLE: 0, ERROR: 1, INFO: 2, @@ -6627,10 +6020,8 @@ var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); - var Logger = /*#__PURE__*/function () { - function Logger(logLevel) { - _classCallCheck(this, Logger); - + class Logger { + constructor(logLevel) { Object.defineProperty(this, _isLegacyDebug, { get: _get_isLegacyDebug, set: void 0 @@ -6647,64 +6038,56 @@ this.wzrkError = {}; } - _createClass(Logger, [{ - key: "error", - value: function error(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { - _classPrivateFieldLooseBase(this, _log)[_log]('error', message); - } - } - }, { - key: "info", - value: function info(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { - _classPrivateFieldLooseBase(this, _log)[_log]('log', message); - } - } - }, { - key: "debug", - value: function debug(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); - } + get logLevel() { + return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; + } + + set logLevel(logLevel) { + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + + error(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { + _classPrivateFieldLooseBase(this, _log)[_log]('error', message); } - }, { - key: "debugPE", - value: function debugPE(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); - } + } + + info(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { + _classPrivateFieldLooseBase(this, _log)[_log]('log', message); } - }, { - key: "reportError", - value: function reportError(code, description) { - this.wzrkError.c = code; - this.wzrkError.d = description; - this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } + + debug(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); } - }, { - key: "logLevel", - get: function get() { - return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; - }, - set: function set(logLevel) { - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + + debugPE(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); } - }]); + } + + reportError(code, description) { + this.wzrkError.c = code; + this.wzrkError.d = description; + this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } - return Logger; - }(); + } var _log2 = function _log2(level, message) { if (window.console) { try { - var ts = new Date().getTime(); + const ts = new Date().getTime(); console[level]("CleverTap [".concat(ts, "]: ").concat(message)); } catch (e) {} } }; - var _get_isLegacyDebug = function _get_isLegacyDebug() { + var _get_isLegacyDebug = function () { return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; }; @@ -6714,14 +6097,13 @@ var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var SessionManager = /*#__PURE__*/function () { + class SessionManager { // SCOOKIE_NAME - function SessionManager(_ref) { - var logger = _ref.logger, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, SessionManager); - + constructor(_ref) { + let { + logger, + isPersonalisationActive + } = _ref; Object.defineProperty(this, _logger$5, { writable: true, value: void 0 @@ -6741,120 +6123,112 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; } - _createClass(SessionManager, [{ - key: "getSessionCookieObject", - value: function getSessionCookieObject() { - var scookieStr = StorageManager.readCookie(this.cookieName); - var obj = {}; + get sessionId() { + return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; + } - if (scookieStr != null) { - // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera - scookieStr = scookieStr.replace(singleQuoteRegex, '"'); - obj = JSON.parse(scookieStr); + set sessionId(sessionId) { + _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + } - if (!isObject(obj)) { - obj = {}; - } else { - if (typeof obj.t !== 'undefined') { - // check time elapsed since last request - var lastTime = obj.t; - var now = getNow(); - - if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { - // adding 60 seconds to compensate for in-journey requests - // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read - // hence we shouldn't use it. - obj = {}; - } + getSessionCookieObject() { + let scookieStr = StorageManager.readCookie(this.cookieName); + let obj = {}; + + if (scookieStr != null) { + // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera + scookieStr = scookieStr.replace(singleQuoteRegex, '"'); + obj = JSON.parse(scookieStr); + + if (!isObject(obj)) { + obj = {}; + } else { + if (typeof obj.t !== 'undefined') { + // check time elapsed since last request + const lastTime = obj.t; + const now = getNow(); + + if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { + // adding 60 seconds to compensate for in-journey requests + // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read + // hence we shouldn't use it. + obj = {}; } } } + } - this.scookieObj = obj; - return obj; - } - }, { - key: "setSessionCookieObject", - value: function setSessionCookieObject(obj) { - var objStr = JSON.stringify(obj); - StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); - } - }, { - key: "manageSession", - value: function manageSession(session) { - // first time. check if current session id in localstorage is same - // if not same then prev = current and current = this new session - if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { - var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both - - if (typeof currentSessionInLS === 'undefined') { - StorageManager.setMetaProp('ps', session); - StorageManager.setMetaProp('cs', session); - StorageManager.setMetaProp('sc', 1); - } else if (currentSessionInLS !== session) { - // not same as session in local storage. new session - StorageManager.setMetaProp('ps', currentSessionInLS); - StorageManager.setMetaProp('cs', session); - var sessionCount = StorageManager.getMetaProp('sc'); - - if (typeof sessionCount === 'undefined') { - sessionCount = 0; - } + this.scookieObj = obj; + return obj; + } + + setSessionCookieObject(obj) { + const objStr = JSON.stringify(obj); + StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); + } - StorageManager.setMetaProp('sc', sessionCount + 1); + manageSession(session) { + // first time. check if current session id in localstorage is same + // if not same then prev = current and current = this new session + if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { + const currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + + if (typeof currentSessionInLS === 'undefined') { + StorageManager.setMetaProp('ps', session); + StorageManager.setMetaProp('cs', session); + StorageManager.setMetaProp('sc', 1); + } else if (currentSessionInLS !== session) { + // not same as session in local storage. new session + StorageManager.setMetaProp('ps', currentSessionInLS); + StorageManager.setMetaProp('cs', session); + let sessionCount = StorageManager.getMetaProp('sc'); + + if (typeof sessionCount === 'undefined') { + sessionCount = 0; } - this.sessionId = session; - } - } - }, { - key: "getTimeElapsed", - value: function getTimeElapsed() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; + StorageManager.setMetaProp('sc', sessionCount + 1); } - if (this.scookieObj != null) { - // TODO: check logic? - this.scookieObj = this.getSessionCookieObject(); - } + this.sessionId = session; + } + } - var sessionStart = this.scookieObj.s; + getTimeElapsed() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - if (sessionStart != null) { - var ts = getNow(); - return Math.floor(ts - sessionStart); - } + if (this.scookieObj != null) { + // TODO: check logic? + this.scookieObj = this.getSessionCookieObject(); } - }, { - key: "getPageCount", - value: function getPageCount() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } - if (this.scookieObj != null) { - // TODO: check logic - this.scookieObj = this.getSessionCookieObject(); - } + const sessionStart = this.scookieObj.s; + + if (sessionStart != null) { + const ts = getNow(); + return Math.floor(ts - sessionStart); + } + } - return this.scookieObj.p; + getPageCount() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; } - }, { - key: "sessionId", - get: function get() { - return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; - }, - set: function set(sessionId) { - _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + + if (this.scookieObj != null) { + // TODO: check logic + this.scookieObj = this.getSessionCookieObject(); } - }]); - return SessionManager; - }(); + return this.scookieObj.p; + } + + } - var seqNo = 0; - var requestTime = 0; + let seqNo = 0; + let requestTime = 0; var _logger$6 = _classPrivateFieldLooseKey("logger"); @@ -6870,16 +6244,15 @@ var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); - var RequestManager = /*#__PURE__*/function () { - function RequestManager(_ref) { - var logger = _ref.logger, - account = _ref.account, - device = _ref.device, - session = _ref.session, - isPersonalisationActive = _ref.isPersonalisationActive; - - _classCallCheck(this, RequestManager); - + class RequestManager { + constructor(_ref) { + let { + logger, + account, + device, + session, + isPersonalisationActive + } = _ref; Object.defineProperty(this, _addToLocalEventMap, { value: _addToLocalEventMap2 }); @@ -6918,234 +6291,222 @@ RequestDispatcher.account = account; } - _createClass(RequestManager, [{ - key: "processBackupEvents", - value: function processBackupEvents() { - var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); + processBackupEvents() { + const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); - if (typeof backupMap === 'undefined' || backupMap === null) { - return; - } - - this.processingBackup = true; + if (typeof backupMap === 'undefined' || backupMap === null) { + return; + } - for (var idx in backupMap) { - if (backupMap.hasOwnProperty(idx)) { - var backupEvent = backupMap[idx]; + this.processingBackup = true; - if (typeof backupEvent.fired === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); + for (const idx in backupMap) { + if (backupMap.hasOwnProperty(idx)) { + const backupEvent = backupMap[idx]; - if (typeof backupEvent.q !== 'undefined') { - RequestDispatcher.fireRequest(backupEvent.q); - } + if (typeof backupEvent.fired === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); - backupEvent.fired = true; + if (typeof backupEvent.q !== 'undefined') { + RequestDispatcher.fireRequest(backupEvent.q); } + + backupEvent.fired = true; } } + } - StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); - this.processingBackup = false; + StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); + this.processingBackup = false; + } + + addSystemDataToObject(dataObject, ignoreTrim) { + // ignore trim for chrome notifications; undefined everywhere else + if (typeof ignoreTrim === 'undefined') { + dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); } - }, { - key: "addSystemDataToObject", - value: function addSystemDataToObject(dataObject, ignoreTrim) { - // ignore trim for chrome notifications; undefined everywhere else - if (typeof ignoreTrim === 'undefined') { - dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - } - if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { - dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; - } + if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { + dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; + } - dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { - dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; - } + if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { + dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + } - var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - dataObject.s = obj.s; // session cookie + dataObject.s = obj.s; // session cookie - dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count - var proto = document.location.protocol; - proto = proto.replace(':', ''); - dataObject.af = _objectSpread2(_objectSpread2({}, dataObject.af), {}, { - lib: 'web-sdk-v1.9.6', - protocol: proto - }, $ct.flutterVersion); // app fields + let proto = document.location.protocol; + proto = proto.replace(':', ''); + dataObject.af = { ...dataObject.af, + lib: 'web-sdk-v1.9.6', + protocol: proto, + ...$ct.flutterVersion + }; // app fields - if (sessionStorage.hasOwnProperty('WZRK_D')) { - dataObject.debug = true; - } + if (sessionStorage.hasOwnProperty('WZRK_D')) { + dataObject.debug = true; + } + + return dataObject; + } - return dataObject; + addFlags(data) { + // check if cookie should be cleared. + _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); + + if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { + data.rc = true; + + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); } - }, { - key: "addFlags", - value: function addFlags(data) { - // check if cookie should be cleared. - _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { - data.rc = true; + if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { + const lastSyncTime = StorageManager.getMetaProp('lsTime'); + const expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); + if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { + data.dsync = true; + return; } - if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { - var lastSyncTime = StorageManager.getMetaProp('lsTime'); - var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server + const now = getNow(); // last sync time has expired - get fresh data from server - if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { - data.dsync = true; - return; - } + if (lastSyncTime + expirySeconds < now) { + data.dsync = true; + } + } + } // saves url to backup cache and fires the request - var now = getNow(); // last sync time has expired - get fresh data from server + /** + * + * @param {string} url + * @param {boolean} override whether the request can go through or not + * @param {Boolean} sendOULFlag - true in case of a On User Login request + */ - if (lastSyncTime + expirySeconds < now) { - data.dsync = true; - } - } - } // saves url to backup cache and fires the request - /** - * - * @param {string} url - * @param {boolean} override whether the request can go through or not - * @param {Boolean} sendOULFlag - true in case of a On User Login request - */ + saveAndFireRequest(url, override, sendOULFlag, evtName) { + const now = getNow(); + url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); + const data = url + '&i=' + now + '&sn=' + seqNo; + StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return - }, { - key: "saveAndFireRequest", - value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { - var now = getNow(); - url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); - var data = url + '&i=' + now + '&sn=' + seqNo; - StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return - - if ($ct.offline) return; // if there is no override - // and an OUL request is not in progress - // then process the request as it is - // else block the request - // note - $ct.blockRequest should ideally be used for override - - if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { - if (now === requestTime) { - seqNo++; - } else { - requestTime = now; - seqNo = 0; - } + if ($ct.offline) return; // if there is no override + // and an OUL request is not in progress + // then process the request as it is + // else block the request + // note - $ct.blockRequest should ideally be used for override - window.oulReqN = $ct.globalCache.REQ_N; - RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { + if (now === requestTime) { + seqNo++; } else { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); + requestTime = now; + seqNo = 0; } + + window.oulReqN = $ct.globalCache.REQ_N; + RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + } else { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - }, { - key: "unregisterTokenForGuid", - value: function unregisterTokenForGuid(givenGUID) { - var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available + } - if (payload) { - var data = {}; - data.type = 'data'; + unregisterTokenForGuid(givenGUID) { + const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - if (isValueValid(givenGUID)) { - data.g = givenGUID; - } + if (payload) { + const data = {}; + data.type = 'data'; + + if (isValueValid(givenGUID)) { + data.g = givenGUID; + } - data.action = 'unregister'; - data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + data.action = 'unregister'; + data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; - var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - data.s = obj.s; // session cookie + data.s = obj.s; // session cookie - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - RequestDispatcher.fireRequest(pageLoadUrl, true); - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); - } // REGISTER TOKEN + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + RequestDispatcher.fireRequest(pageLoadUrl, true); + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); + } // REGISTER TOKEN - this.registerToken(payload); - } - }, { - key: "registerToken", - value: function registerToken(payload) { - if (!payload) return; // add gcookie etc to the payload + this.registerToken(payload); + } - payload = this.addSystemDataToObject(payload, true); - payload = JSON.stringify(payload); + registerToken(payload) { + if (!payload) return; // add gcookie etc to the payload - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + payload = this.addSystemDataToObject(payload, true); + payload = JSON.stringify(payload); - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); - RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - StorageManager.save(WEBPUSH_LS_KEY, 'ok'); - } - }, { - key: "processEvent", - value: function processEvent(data) { - _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); + RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage - data = this.addSystemDataToObject(data, undefined); - this.addFlags(data); - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + StorageManager.save(WEBPUSH_LS_KEY, 'ok'); + } - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + processEvent(data) { + _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); - } - }, { - key: "post", - value: function post(url, body) { - var _this = this; - - return fetch(url, { - method: 'post', - headers: { - 'Content-Type': 'application/json' - }, - body: body - }).then(function (response) { - if (response.ok) { - return response.json(); - } + data = this.addSystemDataToObject(data, undefined); + this.addFlags(data); + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); - throw response; - }).then(function (data) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Sync data successful', data); + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; - return data; - }).catch(function (e) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); + } - throw e; - }); - } - }]); + post(url, body) { + return fetch(url, { + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: body + }).then(response => { + if (response.ok) { + return response.json(); + } + + throw response; + }).then(data => { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Sync data successful', data); - return RequestManager; - }(); + return data; + }).catch(e => { + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + + throw e; + }); + } + + } var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { if (StorageManager._isLocalStorageSupported()) { @@ -7157,8 +6518,8 @@ } } - var nowTs = getNow(); - var evtDetail = $ct.globalEventsMap[evtName]; + const nowTs = getNow(); + let evtDetail = $ct.globalEventsMap[evtName]; if (typeof evtDetail !== 'undefined') { evtDetail[2] = nowTs; @@ -7185,85 +6546,70 @@ var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); - var Privacy = /*#__PURE__*/function (_Array) { - _inherits(Privacy, _Array); - - var _super = _createSuper(Privacy); - - function Privacy(_ref, values) { - var _this; - - var request = _ref.request, - account = _ref.account, - logger = _ref.logger; - - _classCallCheck(this, Privacy); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { + class Privacy extends Array { + constructor(_ref, values) { + let { + request, + account, + logger + } = _ref; + super(); + Object.defineProperty(this, _processPrivacyArray, { value: _processPrivacyArray2 }); - Object.defineProperty(_assertThisInitialized(_this), _request$4, { + Object.defineProperty(this, _request$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$3, { + Object.defineProperty(this, _account$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { + Object.defineProperty(this, _oldValues$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$7, { + Object.defineProperty(this, _logger$7, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$7)[_logger$7] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$3)[_account$3] = account; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; - return _this; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7] = logger; + _classPrivateFieldLooseBase(this, _request$4)[_request$4] = request; + _classPrivateFieldLooseBase(this, _account$3)[_account$3] = account; + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = values; } - _createClass(Privacy, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { - privacyArr[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { + privacyArr[_key] = arguments[_key]; + } - if ($ct.isPrivacyArrPushed) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); - } else { - var _$ct$privacyArray; + if ($ct.isPrivacyArrPushed) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); + } else { + $ct.privacyArray.push(...privacyArr); + } - (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); - } + return 0; + } - return 0; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); - } - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; - } - }]); + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; + } - return Privacy; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + } var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { if (Array.isArray(privacyArr) && privacyArr.length > 0) { - var privacyObj = privacyArr.reduce(function (prev, curr) { - return _objectSpread2(_objectSpread2({}, prev), curr); - }, {}); - var data = {}; - var profileObj = {}; + const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, + ...curr + }), {}); + let data = {}; + const profileObj = {}; var optOut = false; if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { @@ -7277,8 +6623,8 @@ } if (privacyObj.hasOwnProperty(USEIP_KEY)) { - var useIP = privacyObj[USEIP_KEY]; - var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; + const useIP = privacyObj[USEIP_KEY]; + const shouldUseIP = typeof useIP === 'boolean' ? useIP : false; StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); } @@ -7286,9 +6632,9 @@ data.type = 'profile'; data.profile = profileObj; data = _classPrivateFieldLooseBase(this, _request$4)[_request$4].addSystemDataToObject(data, undefined); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -7329,118 +6675,104 @@ var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); - var NotificationHandler = /*#__PURE__*/function (_Array) { - _inherits(NotificationHandler, _Array); - - var _super = _createSuper(NotificationHandler); - - function NotificationHandler(_ref, values) { - var _this; - - var logger = _ref.logger, - session = _ref.session, - request = _ref.request, - account = _ref.account; - - _classCallCheck(this, NotificationHandler); - - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { + class NotificationHandler extends Array { + constructor(_ref, values) { + let { + logger, + session, + request, + account + } = _ref; + super(); + Object.defineProperty(this, _handleNotificationRegistration, { value: _handleNotificationRegistration2 }); - Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { + Object.defineProperty(this, _removeWizAlertJS, { value: _removeWizAlertJS2 }); - Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { + Object.defineProperty(this, _addWizAlertJS, { value: _addWizAlertJS2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { + Object.defineProperty(this, _setUpChromeFirefoxNotifications, { value: _setUpChromeFirefoxNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { + Object.defineProperty(this, _setUpSafariNotifications, { value: _setUpSafariNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setApplicationServerKey, { + Object.defineProperty(this, _setApplicationServerKey, { value: _setApplicationServerKey2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPushNotifications, { + Object.defineProperty(this, _setUpWebPushNotifications, { value: _setUpWebPushNotifications2 }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { + Object.defineProperty(this, _setUpWebPush, { value: _setUpWebPush2 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { + Object.defineProperty(this, _oldValues$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$8, { + Object.defineProperty(this, _logger$8, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _request$5, { + Object.defineProperty(this, _request$5, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$4, { + Object.defineProperty(this, _account$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { + Object.defineProperty(this, _wizAlertJSPath, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { + Object.defineProperty(this, _fcmPublicKey, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; - return _this; + _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; + _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = null; + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = values; + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8] = logger; + _classPrivateFieldLooseBase(this, _request$5)[_request$5] = request; + _classPrivateFieldLooseBase(this, _account$4)[_account$4] = account; } - _createClass(NotificationHandler, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { - displayArgs[_key] = arguments[_key]; - } + push() { + for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { + displayArgs[_key] = arguments[_key]; + } - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - return 0; - } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); - } + return 0; + } - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); } - }, { - key: "_enableWebPush", - value: function _enableWebPush(enabled, applicationServerKey) { - $ct.webPushEnabled = enabled; - if (applicationServerKey != null) { - _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); - } + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + } - if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); - } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); - } + _enableWebPush(enabled, applicationServerKey) { + $ct.webPushEnabled = enabled; + + if (applicationServerKey != null) { + _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); } - }]); - return NotificationHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); + if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); + } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + } + } + + } var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { if ($ct.webPushEnabled && displayArgs.length > 0) { @@ -7466,8 +6798,6 @@ }; var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { - var _this2 = this; - // ensure that proper arguments are passed if (typeof apnsWebPushId === 'undefined') { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that APNS Web Push ID is supplied'); @@ -7478,82 +6808,70 @@ } if ('safari' in window && 'pushNotification' in window.safari) { - window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { + window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, subscription => { if (subscription.permission === 'granted') { - var subscriptionData = JSON.parse(JSON.stringify(subscription)); + const subscriptionData = JSON.parse(JSON.stringify(subscription)); subscriptionData.endpoint = subscription.deviceToken; subscriptionData.browser = 'Safari'; StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(_this2, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); } else if (subscription.permission === 'denied') { - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); } }); } }; var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { - var _this3 = this; - - var registrationScope = ''; + let registrationScope = ''; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { + navigator.serviceWorker.register(serviceWorkerPath).then(registration => { if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. // hence add a timeout and hope serviceWroker is ready within that time. - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); + return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); } registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS // OR getRegistrations PROMISE IF ITS FIREFOX - var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; - var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); + const rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; + const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); if (isServiceWorkerAtRoot) { return navigator.serviceWorker.ready; } else { if (navigator.userAgent.indexOf('Chrome') !== -1) { - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); + return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); } else { return navigator.serviceWorker.getRegistrations(); } } - }).then(function (serviceWorkerRegistration) { + }).then(serviceWorkerRegistration => { // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { - serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { - return i.scope === registrationScope; - })[0]; + serviceWorkerRegistration = serviceWorkerRegistration.filter(i => i.scope === registrationScope)[0]; } - var subscribeObj = { + const subscribeObj = { userVisibleOnly: true }; - if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { - subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); + if (_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] != null) { + subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey]); } - serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC + serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(subscription => { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC - var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token + const subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token if (navigator.userAgent.indexOf('Chrome') !== -1) { subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); @@ -7565,39 +6883,39 @@ StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(_this3, _request$5)[_request$5].registerToken(subscriptionData); + _classPrivateFieldLooseBase(this, _request$5)[_request$5].registerToken(subscriptionData); if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { subscriptionCallback(); } - }).catch(function (error) { + }).catch(error => { // unsubscribe from webpush if error - serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { + serviceWorkerRegistration.pushManager.getSubscription().then(subscription => { if (subscription !== null) { - subscription.unsubscribe().then(function (successful) { + subscription.unsubscribe().then(successful => { // You've successfully unsubscribed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Unsubscription successful'); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].info('Unsubscription successful'); window.clevertap.notifications.push({ skipDialog: true }); - }).catch(function (e) { + }).catch(e => { // Unsubscription failed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); }); } }); - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error subscribing: ' + error); + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Error subscribing: ' + error); }); - }).catch(function (err) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('error registering service worker: ' + err); + }).catch(err => { + _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('error registering service worker: ' + err); }); } }; var _addWizAlertJS2 = function _addWizAlertJS2() { - var scriptTag = document.createElement('script'); + const scriptTag = document.createElement('script'); scriptTag.setAttribute('type', 'text/javascript'); scriptTag.setAttribute('id', 'wzrk-alert-js'); scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body @@ -7607,33 +6925,31 @@ }; var _removeWizAlertJS2 = function _removeWizAlertJS2() { - var scriptTag = document.getElementById('wzrk-alert-js'); + const scriptTag = document.getElementById('wzrk-alert-js'); scriptTag.parentNode.removeChild(scriptTag); }; var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { - var _this4 = this; - // make sure everything is specified - var titleText; - var bodyText; - var okButtonText; - var rejectButtonText; - var okButtonColor; - var skipDialog; - var askAgainTimeInSeconds; - var okCallback; - var rejectCallback; - var subscriptionCallback; - var serviceWorkerPath; - var httpsPopupPath; - var httpsIframePath; - var apnsWebPushId; - var apnsWebPushServiceUrl; + let titleText; + let bodyText; + let okButtonText; + let rejectButtonText; + let okButtonColor; + let skipDialog; + let askAgainTimeInSeconds; + let okCallback; + let rejectCallback; + let subscriptionCallback; + let serviceWorkerPath; + let httpsPopupPath; + let httpsIframePath; + let apnsWebPushId; + let apnsWebPushServiceUrl; if (displayArgs.length === 1) { if (isObject(displayArgs[0])) { - var notifObj = displayArgs[0]; + const notifObj = displayArgs[0]; titleText = notifObj.titleText; bodyText = notifObj.bodyText; okButtonText = notifObj.okButtonText; @@ -7673,7 +6989,7 @@ return; } - var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications + const isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Make sure you are https or localhost to register for notifications'); @@ -7683,19 +6999,19 @@ if (navigator.userAgent.indexOf('Chrome') !== -1) { - var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); + const chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); + const firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Safari') !== -1) { - var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); + const safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return; @@ -7741,7 +7057,7 @@ } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds - var now = new Date().getTime() / 1000; + const now = new Date().getTime() / 1000; if (StorageManager.getMetaProp('notif_last_time') == null) { StorageManager.setMetaProp('notif_last_time', now); @@ -7761,13 +7077,13 @@ if (isHTTP) { // add the https iframe - var httpsIframe = document.createElement('iframe'); + const httpsIframe = document.createElement('iframe'); httpsIframe.setAttribute('style', 'display:none;'); httpsIframe.setAttribute('src', httpsIframePath); document.body.appendChild(httpsIframe); - window.addEventListener('message', function (event) { + window.addEventListener('message', event => { if (event.data != null) { - var obj = {}; + let obj = {}; try { obj = JSON.parse(event.data); @@ -7778,7 +7094,7 @@ if (obj.state != null) { if (obj.from === 'ct' && obj.state === 'not') { - _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7786,7 +7102,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, function (enabled) { + }, enabled => { // callback function if (enabled) { // the user accepted on the dialog box @@ -7802,7 +7118,7 @@ } } - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7810,7 +7126,7 @@ } }, false); } else { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -7818,7 +7134,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, function (enabled) { + }, enabled => { // callback function if (enabled) { // the user accepted on the dialog box @@ -7826,14 +7142,14 @@ okCallback(); } - _classPrivateFieldLooseBase(_this4, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + _classPrivateFieldLooseBase(this, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); } else { if (typeof rejectCallback === 'function') { rejectCallback(); } } - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -7841,7 +7157,7 @@ var _variableStore = _classPrivateFieldLooseKey("variableStore"); - var Variable = /*#__PURE__*/function () { + class Variable { /** * Creates an instance of the Variable class. * @@ -7854,11 +7170,10 @@ * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally). * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes. */ - function Variable(_ref) { - var variableStore = _ref.variableStore; - - _classCallCheck(this, Variable); - + constructor(_ref) { + let { + variableStore + } = _ref; Object.defineProperty(this, _variableStore, { writable: true, value: void 0 @@ -7872,151 +7187,138 @@ _classPrivateFieldLooseBase(this, _variableStore)[_variableStore] = variableStore; } - _createClass(Variable, [{ - key: "getValue", - value: function getValue() { - return this.value; - } - }, { - key: "getdefaultValue", - value: function getdefaultValue() { - return this.defaultValue; + getValue() { + return this.value; + } + + getdefaultValue() { + return this.defaultValue; + } + /** + * Defines a new variable with the provided name, default value, and variable store. + * @static + * @param {string} name - The name of the variable. + * @param {*} defaultValue - The default value of the variable. + * @param {VariableStore} variableStore - The VariableStore instance for registration. + * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. + */ + + + static define(name, defaultValue, variableStore) { + if (!name || typeof name !== 'string') { + console.error('Empty or invalid name parameter provided.'); + return null; } - /** - * Defines a new variable with the provided name, default value, and variable store. - * @static - * @param {string} name - The name of the variable. - * @param {*} defaultValue - The default value of the variable. - * @param {VariableStore} variableStore - The VariableStore instance for registration. - * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. - */ - }, { - key: "update", + if (name.startsWith('.') || name.endsWith('.')) { + console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); + return null; + } - /** - * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. - * @param {*} newValue - The new value to be assigned to the variable. - */ - value: function update(newValue) { - var oldValue = this.value; - this.value = newValue; + const typeOfDefaultValue = typeof defaultValue; - if (newValue === null && oldValue === null) { - return; - } + if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { + console.error('Only primitive types (string, number, boolean) are accepted as value'); + return null; + } - if (newValue !== null && newValue === oldValue && this.hadStarted) { - return; - } + const existing = variableStore.getVariable(name); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - this.hadStarted = true; - this.triggerValueChanged(); - } + if (existing) { + return existing; } - /** - * Invokes all registered callbacks when the variable value changes. - */ - }, { - key: "triggerValueChanged", - value: function triggerValueChanged() { - var _this = this; + const varInstance = new Variable({ + variableStore + }); - this.valueChangedCallbacks.forEach(function (onValueChanged) { - onValueChanged(_this); - }); + try { + varInstance.name = name; + varInstance.defaultValue = defaultValue; + varInstance.value = defaultValue; + varInstance.type = typeOfDefaultValue; + variableStore.registerVariable(varInstance); + varInstance.update(defaultValue); + } catch (error) { + console.error(error); } - /** - * Adds a callback function to the array and triggers it immediately if variable requests have completed. - * @param {Function} onValueChanged - The callback function to be added. - */ - }, { - key: "addValueChangedCallback", - value: function addValueChangedCallback(onValueChanged) { - if (!onValueChanged) { - console.log('Invalid callback parameter provided.'); - return; - } + return varInstance; + } + /** + * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. + * @param {*} newValue - The new value to be assigned to the variable. + */ - this.valueChangedCallbacks.push(onValueChanged); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - onValueChanged(this); - } - } - /** - * Removes a callback function from the array. - * @param {Function} onValueChanged - The callback function to be removed. - */ + update(newValue) { + const oldValue = this.value; + this.value = newValue; - }, { - key: "removeValueChangedCallback", - value: function removeValueChangedCallback(onValueChanged) { - var index = this.valueChangedCallbacks.indexOf(onValueChanged); + if (newValue === null && oldValue === null) { + return; + } - if (index !== -1) { - this.valueChangedCallbacks.splice(index, 1); - } + if (newValue !== null && newValue === oldValue && this.hadStarted) { + return; } - /** - * Resets the `hadStarted` flag to false. - */ - }, { - key: "clearStartFlag", - value: function clearStartFlag() { - this.hadStarted = false; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + this.hadStarted = true; + this.triggerValueChanged(); } - }], [{ - key: "define", - value: function define(name, defaultValue, variableStore) { - if (!name || typeof name !== 'string') { - console.error('Empty or invalid name parameter provided.'); - return null; - } + } + /** + * Invokes all registered callbacks when the variable value changes. + */ - if (name.startsWith('.') || name.endsWith('.')) { - console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); - return null; - } - var typeOfDefaultValue = _typeof(defaultValue); + triggerValueChanged() { + this.valueChangedCallbacks.forEach(onValueChanged => { + onValueChanged(this); + }); + } + /** + * Adds a callback function to the array and triggers it immediately if variable requests have completed. + * @param {Function} onValueChanged - The callback function to be added. + */ - if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { - console.error('Only primitive types (string, number, boolean) are accepted as value'); - return null; - } - var existing = variableStore.getVariable(name); + addValueChangedCallback(onValueChanged) { + if (!onValueChanged) { + console.log('Invalid callback parameter provided.'); + return; + } - if (existing) { - return existing; - } + this.valueChangedCallbacks.push(onValueChanged); - var varInstance = new Variable({ - variableStore: variableStore - }); + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + onValueChanged(this); + } + } + /** + * Removes a callback function from the array. + * @param {Function} onValueChanged - The callback function to be removed. + */ - try { - varInstance.name = name; - varInstance.defaultValue = defaultValue; - varInstance.value = defaultValue; - varInstance.type = typeOfDefaultValue; - variableStore.registerVariable(varInstance); - varInstance.update(defaultValue); - } catch (error) { - console.error(error); - } - return varInstance; + removeValueChangedCallback(onValueChanged) { + const index = this.valueChangedCallbacks.indexOf(onValueChanged); + + if (index !== -1) { + this.valueChangedCallbacks.splice(index, 1); } - }]); + } + /** + * Resets the `hadStarted` flag to false. + */ + + + clearStartFlag() { + this.hadStarted = false; + } - return Variable; - }(); + } var _logger$9 = _classPrivateFieldLooseKey("logger"); @@ -8040,15 +7342,14 @@ var _runVariablesChangedCallback = _classPrivateFieldLooseKey("runVariablesChangedCallback"); - var VariableStore = /*#__PURE__*/function () { - function VariableStore(_ref) { - var logger = _ref.logger, - request = _ref.request, - account = _ref.account, - event = _ref.event; - - _classCallCheck(this, VariableStore); - + class VariableStore { + constructor(_ref) { + let { + logger, + request, + account, + event + } = _ref; Object.defineProperty(this, _runVariablesChangedCallback, { value: _runVariablesChangedCallback2 }); @@ -8108,211 +7409,178 @@ */ - _createClass(VariableStore, [{ - key: "registerVariable", - value: function registerVariable(varInstance) { - var name = varInstance.name; - _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; - console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); - } - /** - * Retrieves a variable by its name. - * @param {string} name - The name of the variable to retrieve. - * @returns {Object} - The variable instance. - */ + registerVariable(varInstance) { + const { + name + } = varInstance; + _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; + console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); + } + /** + * Retrieves a variable by its name. + * @param {string} name - The name of the variable to retrieve. + * @returns {Object} - The variable instance. + */ - }, { - key: "getVariable", - value: function getVariable(name) { - return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; - } - }, { - key: "hasVarsRequestCompleted", - value: function hasVarsRequestCompleted() { - return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; - } - /** - * Synchronizes variables with the server. - * @param {Function} onSyncSuccess - Callback function on successful synchronization. - * @param {Function} onSyncFailure - Callback function on synchronization failure. - * @throws Will throw an error if the account token is missing. - * @returns {Promise} - The result of the synchronization request. - */ - }, { - key: "syncVariables", - value: function syncVariables(onSyncSuccess, onSyncFailure) { - var _this = this; + getVariable(name) { + return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; + } + + hasVarsRequestCompleted() { + return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; + } + /** + * Synchronizes variables with the server. + * @param {Function} onSyncSuccess - Callback function on successful synchronization. + * @param {Function} onSyncFailure - Callback function on synchronization failure. + * @throws Will throw an error if the account token is missing. + * @returns {Promise} - The result of the synchronization request. + */ + - if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { - var m = 'Account token is missing.'; + syncVariables(onSyncSuccess, onSyncFailure) { + if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { + const m = 'Account token is missing.'; - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); - return Promise.reject(new Error(m)); - } + return Promise.reject(new Error(m)); + } + + const payload = { + type: 'varsPayload', + vars: {} + }; - var payload = { - type: 'varsPayload', - vars: {} + for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + payload.vars[name] = { + defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, + type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type }; + } // Check if payload.vars is empty - for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - payload.vars[name] = { - defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, - type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type - }; - } // Check if payload.vars is empty + if (Object.keys(payload.vars).length === 0) { + const m = 'No variables are defined.'; - if (Object.keys(payload.vars).length === 0) { - var _m = 'No variables are defined.'; + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(_m); + return Promise.reject(new Error(m)); + } + + let meta = {}; + meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); + meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; + meta.type = 'meta'; + const body = JSON.stringify([meta, payload]); - return Promise.reject(new Error(_m)); + const url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; + + return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(r => { + if (onSyncSuccess && typeof onSyncSuccess === 'function') { + onSyncSuccess(r); } - var meta = {}; - meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); - meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; - meta.type = 'meta'; - var body = JSON.stringify([meta, payload]); + return r; + }).catch(e => { + if (onSyncFailure && typeof onSyncFailure === 'function') { + onSyncFailure(e); + } - var url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; + if (e.status === 400) { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); + } else if (e.status === 401) { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('This is not a test profile'); + } else { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Sync variable failed'); + } - return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(function (r) { - if (onSyncSuccess && typeof onSyncSuccess === 'function') { - onSyncSuccess(r); - } + throw e; + }); + } + /** + * Fetches variables from the server. + * @param {Function} onFetchCallback - Callback function on fetch completion. + */ - return r; - }).catch(function (e) { - if (onSyncFailure && typeof onSyncFailure === 'function') { - onSyncFailure(e); - } - if (e.status === 400) { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); - } else if (e.status === 401) { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('This is not a test profile'); - } else { - _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Sync variable failed'); - } + fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { + t: 4 + }); - throw e; - }); + if (onFetchCallback && typeof onFetchCallback === 'function') { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; } - /** - * Fetches variables from the server. - * @param {Function} onFetchCallback - Callback function on fetch completion. - */ + } - }, { - key: "fetchVariables", - value: function fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { - t: 4 - }); + mergeVariables(vars) { + console.log('msg vars is ', vars); + _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; + StorageManager.saveToLSorCookie(VARIABLES, vars); + _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - if (onFetchCallback && typeof onFetchCallback === 'function') { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; + for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + if (vars.hasOwnProperty(name)) { + _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); } } - }, { - key: "mergeVariables", - value: function mergeVariables(vars) { - console.log('msg vars is ', vars); - _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; - StorageManager.saveToLSorCookie(VARIABLES, vars); - _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - if (vars.hasOwnProperty(name)) { - _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); - } - } + if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); + } - if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); - } + _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); + } - _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); - } - }, { - key: "addVariablesChangedCallback", - value: function addVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); + addVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); - if (this.hasVarsRequestCompleted()) { - callback(); - } - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); - } - } - }, { - key: "addOneTimeVariablesChangedCallback", - value: function addOneTimeVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - if (this.hasVarsRequestCompleted()) { - callback(); - } else { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); - } + if (this.hasVarsRequestCompleted()) { + callback(); } + } else { + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); } - }, { - key: "removeVariablesChangedCallback", - value: function removeVariablesChangedCallback(callback) { - var index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); + } - if (index !== -1) { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + addOneTimeVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + if (this.hasVarsRequestCompleted()) { + callback(); + } else { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); } } - }, { - key: "removeOneTimeVariablesChangedCallback", - value: function removeOneTimeVariablesChangedCallback(callback) { - var index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); + } - if (index !== -1) { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); - } - } - }]); + removeVariablesChangedCallback(callback) { + const index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - return VariableStore; - }(); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + } + } - var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { - var _iterator = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]), - _step; + removeOneTimeVariablesChangedCallback(callback) { + const index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var callback = _step.value; - callback(); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); } - var _iterator2 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]), - _step2; + } - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var callBack = _step2.value; - callBack(); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); + var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { + for (var callback of _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]) { + callback(); + } + + for (var callBack of _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]) { + callBack(); } _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].length = 0; @@ -8356,50 +7624,40 @@ var _sendLocationData = _classPrivateFieldLooseKey("sendLocationData"); - var CleverTap = /*#__PURE__*/function () { - _createClass(CleverTap, [{ - key: "spa", - get: function get() { - return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; - }, - set: function set(value) { - var isSpa = value === true; - - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // if clevertap.spa is changed after init has been called then update the click listeners - if (isSpa) { - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } - } + class CleverTap { + get spa() { + return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; + } - _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; - } - }, { - key: "dismissSpamControl", - get: function get() { - return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; - }, - set: function set(value) { - var dismissSpamControl = value === true; - _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; - $ct.dismissSpamControl = dismissSpamControl; + set spa(value) { + const isSpa = value === true; + + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // if clevertap.spa is changed after init has been called then update the click listeners + if (isSpa) { + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } } - }]); - function CleverTap() { - var _clevertap$account, - _clevertap$account2, - _clevertap$account3, - _clevertap$account4, - _this = this, - _clevertap$account5; + _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; + } + + get dismissSpamControl() { + return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; + } - var clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + set dismissSpamControl(value) { + const dismissSpamControl = value === true; + _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; + $ct.dismissSpamControl = dismissSpamControl; + } - _classCallCheck(this, CleverTap); + constructor() { + var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5; + let clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; Object.defineProperty(this, _sendLocationData, { value: _sendLocationData2 }); @@ -8475,7 +7733,7 @@ _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 0; this._isPersonalisationActive = this._isPersonalisationActive.bind(this); - this.raiseNotificationClicked = function () {}; + this.raiseNotificationClicked = () => {}; _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] = new Logger(logLevels.INFO); _classPrivateFieldLooseBase(this, _account$6)[_account$6] = new Account((_clevertap$account = clevertap.account) === null || _clevertap$account === void 0 ? void 0 : _clevertap$account[0], clevertap.region || ((_clevertap$account2 = clevertap.account) === null || _clevertap$account2 === void 0 ? void 0 : _clevertap$account2[1]), clevertap.targetDomain || ((_clevertap$account3 = clevertap.account) === null || _clevertap$account3 === void 0 ? void 0 : _clevertap$account3[2]), clevertap.token || ((_clevertap$account4 = clevertap.account) === null || _clevertap$account4 === void 0 ? void 0 : _clevertap$account4[3])); @@ -8542,54 +7800,56 @@ isPersonalisationActive: this._isPersonalisationActive }); this.session = { - getTimeElapsed: function getTimeElapsed() { - return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getTimeElapsed(); + getTimeElapsed: () => { + return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getTimeElapsed(); }, - getPageCount: function getPageCount() { - return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getPageCount(); + getPageCount: () => { + return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getPageCount(); } }; - this.logout = function () { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('logout called'); + this.logout = () => { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('logout called'); StorageManager.setInstantDeleteFlagInK(); }; - this.clear = function () { - _this.onUserLogin.clear(); + this.clear = () => { + this.onUserLogin.clear(); }; - this.getCleverTapID = function () { - return _classPrivateFieldLooseBase(_this, _device$3)[_device$3].getGuid(); + this.getCleverTapID = () => { + return _classPrivateFieldLooseBase(this, _device$3)[_device$3].getGuid(); }; - this.getAccountID = function () { - return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].id; + this.getAccountID = () => { + return _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; }; - this.getSCDomain = function () { - return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].finalTargetDomain; + this.getSCDomain = () => { + return _classPrivateFieldLooseBase(this, _account$6)[_account$6].finalTargetDomain; }; - this.setLibrary = function (libName, libVersion) { - $ct.flutterVersion = _defineProperty({}, libName, libVersion); + this.setLibrary = (libName, libVersion) => { + $ct.flutterVersion = { + [libName]: libVersion + }; }; // Set the Signed Call sdk version and fire request - this.setSCSDKVersion = function (ver) { - _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion = ver; - var data = {}; + this.setSCSDKVersion = ver => { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion = ver; + const data = {}; data.af = { - scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion + scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion }; - var pageLoadUrl = _classPrivateFieldLooseBase(_this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a])); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - _classPrivateFieldLooseBase(_this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; if (hasWebInboxSettingsInLS()) { @@ -8598,53 +7858,53 @@ } // Get Inbox Message Count - this.getInboxMessageCount = function () { - var msgCount = getInboxMessages(); + this.getInboxMessageCount = () => { + const msgCount = getInboxMessages(); return Object.keys(msgCount).length; }; // Get Inbox Unread Message Count - this.getInboxMessageUnreadCount = function () { + this.getInboxMessageUnreadCount = () => { if ($ct.inbox) { return $ct.inbox.unviewedCounter; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get All Inbox messages - this.getAllInboxMessages = function () { + this.getAllInboxMessages = () => { return getInboxMessages(); }; // Get only Unread messages - this.getUnreadInboxMessages = function () { + this.getUnreadInboxMessages = () => { if ($ct.inbox) { return $ct.inbox.unviewedMessages; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get message object belonging to the given message id only. Message id should be a String - this.getInboxMessageForId = function (messageId) { - var messages = getInboxMessages(); + this.getInboxMessageForId = messageId => { + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { return messages[messageId]; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; // Delete message from the Inbox. Message id should be a String // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list // Then remove the message from local storage and update cookie - this.deleteInboxMessage = function (messageId) { - var messages = getInboxMessages(); + this.deleteInboxMessage = messageId => { + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (messages[messageId].viewed === 0) { $ct.inbox.unviewedCounter--; @@ -8657,7 +7917,7 @@ delete messages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. Message id should be a String @@ -8666,12 +7926,12 @@ - renderNotificationViewed */ - this.markReadInboxMessage = function (messageId) { - var unreadMsg = $ct.inbox.unviewedMessages; - var messages = getInboxMessages(); + this.markReadInboxMessage = messageId => { + const unreadMsg = $ct.inbox.unviewedMessages; + const messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8693,16 +7953,16 @@ delete $ct.inbox.unviewedMessages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. messageIds should be a an array of string */ - this.markReadInboxMessagesForIds = function (messageIds) { + this.markReadInboxMessagesForIds = messageIds => { if (Array.isArray(messageIds)) { for (var id = 0; id < messageIds.length; id++) { - _this.markReadInboxMessage(messageIds[id]); + this.markReadInboxMessage(messageIds[id]); } } }; @@ -8712,14 +7972,14 @@ */ - this.markReadAllInboxMessage = function () { - var unreadMsg = $ct.inbox.unviewedMessages; - var messages = getInboxMessages(); + this.markReadAllInboxMessage = () => { + const unreadMsg = $ct.inbox.unviewedMessages; + const messages = getInboxMessages(); if (Object.keys(unreadMsg).length > 0) { - var msgIds = Object.keys(unreadMsg); - msgIds.forEach(function (key) { - var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); + const msgIds = Object.keys(unreadMsg); + msgIds.forEach(key => { + const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8737,71 +7997,77 @@ $ct.inbox.unviewedCounter = 0; $ct.inbox.unviewedMessages = {}; } else { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('All messages are already read'); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('All messages are already read'); } }; - this.toggleInbox = function (e) { + this.toggleInbox = e => { var _$ct$inbox; return (_$ct$inbox = $ct.inbox) === null || _$ct$inbox === void 0 ? void 0 : _$ct$inbox.toggleInbox(e); }; // method for notification viewed - this.renderNotificationViewed = function (detail) { + this.renderNotificationViewed = detail => { processNotificationEvent(NOTIFICATION_VIEWED, detail); }; // method for notification clicked - this.renderNotificationClicked = function (detail) { + this.renderNotificationClicked = detail => { processNotificationEvent(NOTIFICATION_CLICKED, detail); }; - var processNotificationEvent = function processNotificationEvent(eventName, eventDetail) { + const processNotificationEvent = (eventName, eventDetail) => { if (!eventDetail || !eventDetail.msgId) { return; } - var data = {}; + const data = {}; data.type = 'event'; data.evtName = eventName; - data.evtData = _defineProperty({}, WZRK_ID, eventDetail.msgId); + data.evtData = { + [WZRK_ID]: eventDetail.msgId + }; if (eventDetail.pivotId) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId - }); + }; } if (eventDetail.wzrk_slideNo) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo - }); + }; } // Adding kv pair to event data if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) { - for (var key in eventDetail.kv) { + for (const key in eventDetail.kv) { if (key.startsWith(WZRK_PREFIX)) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, key, eventDetail.kv[key])); + data.evtData = { ...data.evtData, + [key]: eventDetail.kv[key] + }; } } } // Adding msgCTkv to event data if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) { - for (var _key in eventDetail.msgCTkv) { - if (_key.startsWith(WZRK_PREFIX)) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, _key, eventDetail.msgCTkv[_key])); + for (const key in eventDetail.msgCTkv) { + if (key.startsWith(WZRK_PREFIX)) { + data.evtData = { ...data.evtData, + [key]: eventDetail.msgCTkv[key] + }; } } } - _classPrivateFieldLooseBase(_this, _request$7)[_request$7].processEvent(data); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processEvent(data); }; - this.setLogLevel = function (l) { - _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].logLevel = Number(l); + this.setLogLevel = l => { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel = Number(l); if (l === 3) { sessionStorage.WZRK_D = ''; @@ -8815,60 +8081,60 @@ */ - this.handleIncrementValue = function (key, value) { - _this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); + this.handleIncrementValue = (key, value) => { + this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); }; - this.handleDecrementValue = function (key, value) { - _this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); + this.handleDecrementValue = (key, value) => { + this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); }; - this.setMultiValuesForKey = function (key, value) { + this.setMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueSet(key, value, COMMAND_SET); + this.profile._handleMultiValueSet(key, value, COMMAND_SET); } else { console.error('setMultiValuesForKey should be called with a value of type array'); } }; - this.addMultiValueForKey = function (key, value) { + this.addMultiValueForKey = (key, value) => { if (typeof value === 'string' || typeof value === 'number') { - _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValueForKey should be called with a value of type string or number.'); } }; - this.addMultiValuesForKey = function (key, value) { + this.addMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValuesForKey should be called with a value of type array.'); } }; - this.removeMultiValueForKey = function (key, value) { + this.removeMultiValueForKey = (key, value) => { if (typeof value === 'string' || typeof value === 'number') { - _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValueForKey should be called with a value of type string or number.'); } }; - this.removeMultiValuesForKey = function (key, value) { + this.removeMultiValuesForKey = (key, value) => { if (Array.isArray(value)) { - _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValuesForKey should be called with a value of type array.'); } }; - this.removeValueForKey = function (key) { - _this.profile._handleMultiValueDelete(key, COMMAND_DELETE); + this.removeValueForKey = key => { + this.profile._handleMultiValueDelete(key, COMMAND_DELETE); }; - var _handleEmailSubscription = function _handleEmailSubscription(subscription, reEncoded, fetchGroups) { - handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(_this, _account$6)[_account$6], _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); + const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => { + handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(this, _account$6)[_account$6], _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); }; /** * @@ -8951,57 +8217,57 @@ } } - var api = _classPrivateFieldLooseBase(this, _api)[_api]; + const api = _classPrivateFieldLooseBase(this, _api)[_api]; api.logout = this.logout; api.clear = this.clear; - api.closeIframe = function (campaignId, divIdIgnored) { - closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(_this, _session$3)[_session$3].sessionId); + api.closeIframe = (campaignId, divIdIgnored) => { + closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(this, _session$3)[_session$3].sessionId); }; - api.enableWebPush = function (enabled, applicationServerKey) { - _this.notifications._enableWebPush(enabled, applicationServerKey); + api.enableWebPush = (enabled, applicationServerKey) => { + this.notifications._enableWebPush(enabled, applicationServerKey); }; - api.tr = function (msg) { + api.tr = msg => { _tr(msg, { - device: _classPrivateFieldLooseBase(_this, _device$3)[_device$3], - session: _classPrivateFieldLooseBase(_this, _session$3)[_session$3], - request: _classPrivateFieldLooseBase(_this, _request$7)[_request$7], - logger: _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a] + device: _classPrivateFieldLooseBase(this, _device$3)[_device$3], + session: _classPrivateFieldLooseBase(this, _session$3)[_session$3], + request: _classPrivateFieldLooseBase(this, _request$7)[_request$7], + logger: _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] }); }; - api.setEnum = function (enumVal) { - setEnum(enumVal, _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); + api.setEnum = enumVal => { + setEnum(enumVal, _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); }; - api.is_onloadcalled = function () { - return _classPrivateFieldLooseBase(_this, _onloadcalled)[_onloadcalled] === 1; + api.is_onloadcalled = () => { + return _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1; }; - api.subEmail = function (reEncoded) { + api.subEmail = reEncoded => { _handleEmailSubscription('1', reEncoded); }; - api.getEmail = function (reEncoded, withGroups) { + api.getEmail = (reEncoded, withGroups) => { _handleEmailSubscription('-1', reEncoded, withGroups); }; - api.unSubEmail = function (reEncoded) { + api.unSubEmail = reEncoded => { _handleEmailSubscription('0', reEncoded); }; - api.unsubEmailGroups = function (reEncoded) { + api.unsubEmailGroups = reEncoded => { $ct.unsubGroups = []; - var elements = document.getElementsByClassName('ct-unsub-group-input-item'); + const elements = document.getElementsByClassName('ct-unsub-group-input-item'); - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; + for (let i = 0; i < elements.length; i++) { + const element = elements[i]; if (element.name) { - var data = { + const data = { name: element.name, isUnsubscribed: element.checked }; @@ -9012,29 +8278,29 @@ _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.setSubscriptionGroups = function (value) { + api.setSubscriptionGroups = value => { $ct.unsubGroups = value; }; - api.getSubscriptionGroups = function () { + api.getSubscriptionGroups = () => { return $ct.unsubGroups; }; - api.changeSubscriptionGroups = function (reEncoded, updatedGroups) { + api.changeSubscriptionGroups = (reEncoded, updatedGroups) => { api.setSubscriptionGroups(updatedGroups); _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.isGlobalUnsubscribe = function () { + api.isGlobalUnsubscribe = () => { return $ct.globalUnsubscribe; }; - api.setIsGlobalUnsubscribe = function (value) { + api.setIsGlobalUnsubscribe = value => { $ct.globalUnsubscribe = value; }; - api.setUpdatedCategoryLong = function (profile) { + api.setUpdatedCategoryLong = profile => { if (profile[categoryLongKey]) { $ct.updatedCategoryLong = profile[categoryLongKey]; } @@ -9051,261 +8317,243 @@ } // starts here - _createClass(CleverTap, [{ - key: "init", - value: function init(accountId, region, targetDomain, token) { - var _this2 = this; + init(accountId, region, targetDomain, token) { + let antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - var antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; + if (Object.keys(antiFlicker).length > 0) { + addAntiFlicker(antiFlicker); + } - if (Object.keys(antiFlicker).length > 0) { - addAntiFlicker(antiFlicker); - } + if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // already initailsed + return; + } + + checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], accountId); + StorageManager.removeCookie('WZRK_P', window.location.hostname); + + if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { + if (!accountId) { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); - if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // already initailsed return; } - checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], accountId); - StorageManager.removeCookie('WZRK_P', window.location.hostname); + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; + } - if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { - if (!accountId) { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); + _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; - return; - } + if (region) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; + } - _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; - } + if (targetDomain) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; + } - _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + if (token) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; + } - if (region) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; - } + const currLocation = location.href; + const urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq - if (targetDomain) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; - } + if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { + return; + } - if (token) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; - } + $ct.isPrivacyArrPushed = true; - var currLocation = location.href; - var urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq + if ($ct.privacyArray.length > 0) { + this.privacy.push($ct.privacyArray); + } - if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { - return; - } + _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); - $ct.isPrivacyArrPushed = true; + this.pageChanged(); + const backupInterval = setInterval(() => { + if (_classPrivateFieldLooseBase(this, _device$3)[_device$3].gcookie) { + clearInterval(backupInterval); - if ($ct.privacyArray.length > 0) { - this.privacy.push($ct.privacyArray); + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); } + }, 3000); - _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { + // listen to click on the document and check if URL has changed. + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + // remove existing click listeners if any + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } - this.pageChanged(); - var backupInterval = setInterval(function () { - if (_classPrivateFieldLooseBase(_this2, _device$3)[_device$3].gcookie) { - clearInterval(backupInterval); + _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; + } // process the option array provided to the clevertap object + // after its been initialized - _classPrivateFieldLooseBase(_this2, _request$7)[_request$7].processBackupEvents(); - } - }, 3000); - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { - // listen to click on the document and check if URL has changed. - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - // remove existing click listeners if any - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } + pageChanged() { + const currLocation = window.location.href; + const urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count - _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; - } // process the option array provided to the clevertap object - // after its been initialized + const obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); - }, { - key: "pageChanged", - value: function pageChanged() { - var _this3 = this; + let pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; + obj.p = ++pgCount; - var currLocation = window.location.href; - var urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count + _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count - var obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); - var pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; - obj.p = ++pgCount; + let data = {}; + let referrerDomain = getDomain(document.referrer); - _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count + if (window.location.hostname !== referrerDomain) { + const maxLen = 120; + if (referrerDomain !== '') { + referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; + data.referrer = referrerDomain; + } - var data = {}; - var referrerDomain = getDomain(document.referrer); + let utmSource = urlParams.utm_source || urlParams.wzrk_source; - if (window.location.hostname !== referrerDomain) { - var maxLen = 120; + if (typeof utmSource !== 'undefined') { + utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; + data.us = utmSource; // utm_source + } - if (referrerDomain !== '') { - referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; - data.referrer = referrerDomain; - } + let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; - var utmSource = urlParams.utm_source || urlParams.wzrk_source; + if (typeof utmMedium !== 'undefined') { + utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; + data.um = utmMedium; // utm_medium + } + + let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; + + if (typeof utmCampaign !== 'undefined') { + utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; + data.uc = utmCampaign; // utm_campaign + } // also independently send wzrk_medium to the backend - if (typeof utmSource !== 'undefined') { - utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; - data.us = utmSource; // utm_source - } - var utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; + if (typeof urlParams.wzrk_medium !== 'undefined') { + const wm = urlParams.wzrk_medium; - if (typeof utmMedium !== 'undefined') { - utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; - data.um = utmMedium; // utm_medium + if (wm.match(/^email$|^social$|^search$/)) { + data.wm = wm; // wzrk_medium } + } + } - var utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; + data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); + data.cpg = currLocation; + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - if (typeof utmCampaign !== 'undefined') { - utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; - data.uc = utmCampaign; // utm_campaign - } // also independently send wzrk_medium to the backend + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 - if (typeof urlParams.wzrk_medium !== 'undefined') { - var wm = urlParams.wzrk_medium; - if (wm.match(/^email$|^social$|^search$/)) { - data.wm = wm; // wzrk_medium - } - } - } + if (parseInt(data.pg) === 1) { + _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); + } - data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); - data.cpg = currLocation; - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 + if (parseInt(data.pg) === 1) { + this.event.push(WZRK_FETCH, { + t: 4 + }); + } + _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; + setTimeout(() => { + if (pgCount <= 3) { + // send ping for up to 3 pages + _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); + } - if (parseInt(data.pg) === 1) { - _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); + if (_classPrivateFieldLooseBase(this, _isPingContinuous)[_isPingContinuous]()) { + setInterval(() => { + _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); + }, CONTINUOUS_PING_FREQ_IN_MILLIS); } + }, FIRST_PING_FREQ_IN_MILLIS); + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + _isPersonalisationActive() { + return StorageManager._isLocalStorageSupported() && this.enablePersonalization; + } - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + // eslint-disable-next-line accessor-pairs + set popupCallback(callback) { + this.popupCallbacks[this.popupCurrentWzrkId] = callback; + } + /** + * + * @param {object} payload + */ - if (parseInt(data.pg) === 1) { - this.event.push(WZRK_FETCH, { - t: 4 - }); - } - _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; - setTimeout(function () { - if (pgCount <= 3) { - // send ping for up to 3 pages - _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); - } + // offline mode - if (_classPrivateFieldLooseBase(_this3, _isPingContinuous)[_isPingContinuous]()) { - setInterval(function () { - _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); - }, CONTINUOUS_PING_FREQ_IN_MILLIS); - } - }, FIRST_PING_FREQ_IN_MILLIS); + /** + * events will be recorded and queued locally when passed with true + * but will not be sent to the server until offline is disabled by passing false + * @param {boolean} arg + */ + setOffline(arg) { + if (typeof arg !== 'boolean') { + console.error('setOffline should be called with a value of type boolean'); + return; } - }, { - key: "_isPersonalisationActive", - value: function _isPersonalisationActive() { - return StorageManager._isLocalStorageSupported() && this.enablePersonalization; + + $ct.offline = arg; // if offline is disabled + // process events from cache + + if (!arg) { + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); } - }, { - key: "setOffline", - // offline mode + } - /** - * events will be recorded and queued locally when passed with true - * but will not be sent to the server until offline is disabled by passing false - * @param {boolean} arg - */ - value: function setOffline(arg) { - if (typeof arg !== 'boolean') { - console.error('setOffline should be called with a value of type boolean'); - return; - } + getSDKVersion() { + return 'web-sdk-v1.9.6'; + } - $ct.offline = arg; // if offline is disabled - // process events from cache + defineVariable(name, defaultValue) { + return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); + } - if (!arg) { - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); - } - } - }, { - key: "getSDKVersion", - value: function getSDKVersion() { - return 'web-sdk-v1.9.6'; - } - }, { - key: "defineVariable", - value: function defineVariable(name, defaultValue) { - return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); - } - }, { - key: "syncVariables", - value: function syncVariables(onSyncSuccess, onSyncFailure) { - if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { - return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); - } else { - var m = 'App log level is not set to 4'; + syncVariables(onSyncSuccess, onSyncFailure) { + if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { + return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); + } else { + const m = 'App log level is not set to 4'; - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); - return Promise.reject(new Error(m)); - } - } - }, { - key: "fetchVariables", - value: function fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); + return Promise.reject(new Error(m)); } - }, { - key: "addVariablesChangedCallback", - value: function addVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); - } - }, { - key: "addOneTimeVariablesChangedCallback", - value: function addOneTimeVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); - } - }, { - key: "popupCallback", - // eslint-disable-next-line accessor-pairs - set: function set(callback) { - this.popupCallbacks[this.popupCurrentWzrkId] = callback; - } - /** - * - * @param {object} payload - */ + } + + fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); + } + + addVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); + } - }]); + addOneTimeVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); + } - return CleverTap; - }(); + } var _processOldValues2 = function _processOldValues2() { this.onUserLogin._processOldValues(); @@ -9320,8 +8568,8 @@ }; var _debounce2 = function _debounce2(func) { - var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; - var timeout; + let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + let timeout; return function () { clearTimeout(timeout); timeout = setTimeout(func, delay); @@ -9329,11 +8577,9 @@ }; var _checkPageChanged2 = function _checkPageChanged2() { - var _this4 = this; - - var debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](function () { - if (_classPrivateFieldLooseBase(_this4, _previousUrl)[_previousUrl] !== location.href) { - _this4.pageChanged(); + const debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](() => { + if (_classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] !== location.href) { + this.pageChanged(); } }); @@ -9341,9 +8587,9 @@ }; var _pingRequest2 = function _pingRequest2() { - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - var data = {}; + let data = {}; data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); @@ -9363,9 +8609,9 @@ var _sendLocationData2 = function _sendLocationData2(payload) { // Send the updated value to LC - var data = {}; + let data = {}; data.af = {}; - var profileObj = {}; + const profileObj = {}; data.type = 'profile'; if (profileObj.tz == null) { @@ -9375,23 +8621,25 @@ data.profile = profileObj; if (payload) { - var keys = Object.keys(payload); - keys.forEach(function (key) { + const keys = Object.keys(payload); + keys.forEach(key => { data.af[key] = payload[key]; }); } if ($ct.location) { - data.af = _objectSpread2(_objectSpread2({}, data.af), $ct.location); + data.af = { ...data.af, + ...$ct.location + }; } data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, true); _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -9399,7 +8647,7 @@ _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; - var clevertap = new CleverTap(window.clevertap); + const clevertap = new CleverTap(window.clevertap); window.clevertap = window.wizrocket = clevertap; return clevertap; diff --git a/clevertap.js.map b/clevertap.js.map index 729c9d59..70be7b44 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n console.log('updateFormData called with', selector.values.form, isPreview)\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA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,MAAM,CAACsU,IAAP,CAAY0R,OAAZ,CAAb;EACA1R,IAAAA,IAAI,CAACC,OAAL,CAAa,UAAAhT,GAAG,EAAI;EAClBuC,MAAAA,IAAI,CAACygC,EAAL,CAAQhjC,GAAR,IAAeykB,OAAO,CAACzkB,GAAD,CAAtB;EACD,KAFD;EAGD;;EACD,MAAIqE,GAAG,CAACF,QAAR,EAAkB;EAChB5B,IAAAA,IAAI,CAACygC,EAAL,qCAAezgC,IAAI,CAACygC,EAApB,GAA2B3+B,GAAG,CAACF,QAA/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc8W,qBAAd,CAAoC9W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAc+W,QAAd,CAAuB/W,IAAvB;;EACA,MAAMgX,cAAc,GAAG5K,YAAY,CAACtM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI6O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI8/B,SAAJ,CAAcztC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n console.log('updateFormData called with', selector.values.form, isPreview)\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPersonalisationBanner","HTMLElement","_details","shadow","attachShadow","mode","details","renderBanner","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","target","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","button","setInterval","sliderTime","goTo","prev","cur","CTWebPopupImageOnly","_session","popup","container","resizeObserver","renderImageOnlyPopup","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","info","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","_enableWebPush","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YA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MAAAA,IAAI,CAACohC,EAAL,CAAQ7jC,GAAR,IAAeklB,OAAO,CAACllB,GAAD,CAAtB;EACD,KAFD;EAGD;;EACD,MAAI0E,GAAG,CAACF,QAAR,EAAkB;EAChB/B,IAAAA,IAAI,CAACohC,EAAL,GAAU,EAAE,GAAGphC,IAAI,CAACohC,EAAV;EAAc,SAAGn/B,GAAG,CAACF;EAArB,KAAV;EACD;;EACD/B,EAAAA,IAAI,GAAG,0DAAcqX,qBAAd,CAAoCrX,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcsX,QAAd,CAAuBtX,IAAvB;;EACA,QAAMuX,cAAc,GAAG7K,YAAY,CAAC7M,IAAI,CAACC,SAAL,CAAeE,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAIqP,WAAW,GAAG,0DAAcpX,WAAhC;;EACAoX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBrV,QAAtB,CAAtB;EACAqV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CpN,GAAG,CAACgC,YAAlD;EACD;;QC3yBGyL,SAAS,GAAG,IAAIkgC,SAAJ,CAAchuC,MAAM,CAAC8N,SAArB;EAElB9N,MAAM,CAAC8N,SAAP,GAAmB9N,MAAM,CAAC+N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index f835532a..d443eaa7 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}var w=0;function k(e){return"__private_"+w+++"_"+e}function C(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var x,P="clevertap-prod.com",S="https:",O=k("accountId"),I=k("region"),_=k("targetDomain"),E=k("dcSdkversion"),A=k("token"),L=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:""}),Object.defineProperty(this,_,{writable:!0,value:P}),Object.defineProperty(this,E,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=n,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return n(e,[{key:"id",get:function(){return C(this,O)[O]},set:function(e){C(this,O)[O]=e}},{key:"region",get:function(){return C(this,I)[I]},set:function(e){C(this,I)[I]=e}},{key:"dcSDKVersion",get:function(){return C(this,E)[E]},set:function(e){C(this,E)[E]=e}},{key:"targetDomain",get:function(){return C(this,_)[_]},set:function(e){C(this,_)[_]=e}},{key:"token",get:function(){return C(this,A)[A]},set:function(e){C(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===P?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),M=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),T=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),R=new RegExp("'","g"),j="clear",D="Charged ID",z="WZRK_CHARGED_ID",B="WZRK_G",N="WZRK_K",U="WZRK_CAMP",F="WZRK_CAMP_G",V="WZRK_EV",q="WZRK_META",W="WZRK_PR",K="WZRK_ARP",H="WZRK_L",G="global",J="optOut",Z="useIP",$="WZRK_X",Y="push",Q=31536e3,X="2",ee="wzrk_",te="wzrk_id",ie="Notification Viewed",ne="Notification Clicked",oe="WZRK_FPU",re="WZRK_PSD",ae="$incr",se="$decr",le="$set",ce="$add",de="$remove",ue="$delete",pe="WZRK_INBOX_CONFIG",he="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ge=["Stayed","UTM Visited","App Launched","Notification Sent",ie,ne],ye=function(e){return"string"==typeof e||e instanceof String},be=function(e){return"[object Object]"===Object.prototype.toString.call(e)},me=function(t){return"object"===e(t)&&t instanceof Date},we=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},ke=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ce=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},xe=function(e){return null!=e&&"undefined"!==e},Pe=function t(i,n){var o;if("object"!==e(i))return ye(i)?(o=Se(i,T)).length>1024&&(o=o.substring(0,1024),n.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=i,o;for(var r in i)if(i.hasOwnProperty(r)){var a=t(i[r],n),s=void 0;(s=Se(r,M)).length>1024&&(s=s.substring(0,1024),n.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete i[r],i[s]=a}return i},Se=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ie=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ee=function(e){if(Ae(e))return"$D_"+e},Ae=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var i=t[3],n=t[2]-1,o=t[1],r=new Date(o,n,i);return r.getDate()==i&&r.getMonth()==n&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return n(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}},{key:"createCookie",value:function(e,t,i,n){var o="",r="";if(i){var a=new Date;a.setTime(a.getTime()+1e3*i),o="; expires="+a.toGMTString()}n&&(r="; domain="+n),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,i,a),this.readCookie(e)==t){o=a,Me.broadDomain=o;break}}else this.createCookie(e,t,i,o)}else this.createCookie(e,t,i,n)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var i=this.readFromLSorCookie(q);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(q,i)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(N);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(N,e)}},{key:"backupEvent",value:function(e,t,i){var n=this.readFromLSorCookie(H);void 0===n&&(n={}),n[t]={q:e},this.saveToLSorCookie(H,n),i.debug("stored in ".concat(H," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var i=this.readFromLSorCookie(H);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(H,i))}}]),e}(),Me={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}},Te=k("keyOrder"),Re=k("deleteFromObject"),je=function(){function e(i){t(this,e),Object.defineProperty(this,Re,{value:De}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=i;var n=Le.readFromLSorCookie($);if(n){var o={};for(var r in C(this,Te)[Te]=[],n=n.cache)n.hasOwnProperty(r)&&(o[n[r][0]]=n[r][1],C(this,Te)[Te].push(n[r][0]));this.cache=o}else this.cache={},C(this,Te)[Te]=[]}return n(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=C(this,Re)[Re](e,this.cache),this.cache[e]=t,C(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var i=this.cache[e],n=C(this,Te)[Te];null!=i?this.cache=C(this,Re)[Re](e,this.cache):n.length===this.max&&(this.cache=C(this,Re)[Re](n[0],this.cache)),this.cache[e]=t,C(this,Te)[Te][C(this,Te)[Te]-1]!==e&&C(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],i=C(this,Te)[Te];for(var n in i)if(i.hasOwnProperty(n)){var o=[];o.push(i[n]),o.push(e[i[n]]),t.push(o)}Le.saveToLSorCookie($,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=C(this,Te)[Te];for(var i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}},{key:"getSecondLastKey",value:function(){var e=C(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=C(this,Te)[Te].length;if(e)return C(this,Te)[Te][e-1]}}]),e}(),De=function(e,t){var i,n=JSON.parse(JSON.stringify(C(this,Te)[Te])),o={};for(var r in n)n.hasOwnProperty(r)&&(n[r]!==e?o[n[r]]=t[n[r]]:i=r);return n.splice(i,1),C(this,Te)[Te]=JSON.parse(JSON.stringify(n)),o},ze=k("logger"),Be=k("request"),Ne=k("device"),Ue=k("session"),Fe=function(){function e(i){var n=i.logger,o=i.request,r=i.device,a=i.session;t(this,e),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),C(this,ze)[ze]=n,C(this,Be)[Be]=o,C(this,Ne)[Ne]=r,C(this,Ue)[Ue]=a}return n(e,[{key:"s",value:function(e,t,i,n,o){var r=!1,a=!1;if(window.isOULInProgress&&(i||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),Le.removeBackup(n,C(this,ze)[ze]),!(n>Me.globalCache.REQ_N)){if(xe(C(this,Ne)[Ne].gcookie)||e&&(a=!0),!xe(C(this,Ne)[Ne].gcookie)||i||"boolean"==typeof o){var s=C(this,Ue)[Ue].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(n)&&(!be(e[i][n])||!it(e[i][n])))return!1}else{if(be(e[i])||Array.isArray(e[i]))return!1;me(e[i])&&(e[i]=_e(e[i]))}if(ye(e[D])||Ce(e[D])){var o=e[D]+"";if(void 0===x&&(x=Le.readFromLSorCookie(z)),void 0!==x&&x.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;x=o,Le.saveToLSorCookie(z,o)}return!0}return!1},ot=k("logger"),rt=k("oldValues"),at=k("request"),st=k("isPersonalisationActive"),lt=k("processEventArray"),ct=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=i.call(this),Object.defineProperty(h(r),lt,{value:dt}),Object.defineProperty(h(r),ot,{writable:!0,value:void 0}),Object.defineProperty(h(r),rt,{writable:!0,value:void 0}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),C(h(r),ot)[ot]=a,C(h(r),rt)[rt]=n,C(h(r),at)[at]=s,C(h(r),st)[st]=l,r}return n(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0;){var t=e.shift();if(ye(t))if(t.length>1024&&(t=t.substring(0,1024),C(this,ot)[ot].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),ge.includes(t))C(this,ot)[ot].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var i={type:"event"};if(i.evtName=Se(t,M),0!==e.length){var n=e.shift();if(be(n)){if("Charged"===t){if(!nt(n,C(this,ot)[ot])){C(this,ot)[ot].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!it(n)){C(this,ot)[ot].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=n}else e.unshift(n)}C(this,at)[at].processEvent(i)}else C(this,ot)[ot].error(Ge)}},ut=function(e){var t={},i=e.indexOf("?");if(i>1){var n,o=e.substring(i+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=a.exec(o);n;)t[s(n[1])]=s(n[2]),n=a.exec(o)}return t},pt=function(e,t,i){return e+"&"+t+"="+encodeURIComponent(i)},ht=function(){return window.location.hostname},ft=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),gt(e)},vt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),gt=function(e){if(null==e)return"";var t,i,n,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,i,n,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,f=0,v=String.fromCharCode;for(n=0;n>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(h<<=1,15==f){p+=v(h);break}f++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),n=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,n=255&e.charCodeAt((c+1)/2)):i=n=NaN),c+=3,o=t>>2,r=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),l=l+vt.charAt(o)+vt.charAt(r)+vt.charAt(a)+vt.charAt(s);return l},yt=k("fireRequest"),bt=k("dropRequestDueToOptOut"),mt=k("addUseIPToRequest"),wt=k("addARPToRequest"),kt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return n(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,i,n){C(this,yt)[yt](e,1,t,i,n)}}]),e}();kt.logger=void 0,kt.device=void 0,kt.account=void 0,Object.defineProperty(kt,yt,{value:function(e,t,i,n,o){var r,a,s=this;if(C(this,bt)[bt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(xe(this.device.gcookie)||(Me.blockRequest=!0),o&&o===ve)!xe(this.device.gcookie)&&Me.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(kt,bt,{value:function(){return!Me.isOptInRequest&&xe(this.device.gcookie)&&ye(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(Me.isOptInRequest=!1,!1)}}),Object.defineProperty(kt,mt,{value:function(e){var t=Le.getMetaProp(Z);return"boolean"!=typeof t&&(t=!1),pt(e,Z,t?"true":"false")}}),Object.defineProperty(kt,wt,{value:function(e,t){if(!0===t){var i={skipResARP:!0};return pt(e,"arp",ft(JSON.stringify(i),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(K)&&null!==localStorage.getItem(K)?pt(e,"arp",ft(JSON.stringify(Le.readFromLSorCookie(K)),this.logger)):e}});var Ct,xt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(U);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(R,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},Pt=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},xt()),e),i=JSON.stringify(t);Le.save(U,encodeURIComponent(i)),St()}},St=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(xe(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(F)?JSON.parse(decodeURIComponent(Le.read(F))):{};if(e&&Le._isLocalStorageSupported()){var i={},n=xt();Object.keys(n).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=n[r].global,c=Oe(),d=n[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var f=0,v=0,g=u[p];if("tc"===g)continue;void 0!==d&&void 0!==d[g]&&(f=d[g]),void 0!==l&&void 0!==l[g]&&(v=l[g]),h=[g,f,v],s[g]=h}}}i=a(a({},i),{},o({},r,s))})),t[e]=i,Le.save(F,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=xt();var i=Le.read(F),n=i?decodeURIComponent(i):null,o=n?JSON.parse(n):null,r=e&&null!=i&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=i&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},It=function(e,t){var i=t.logger,n=!1;if(be(e))for(var o in e)if(e.hasOwnProperty(o)){n=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(n=!1,i.error(Je)),"Employed"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error(Ze)),"Married"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(n=!1,i.error(Ye)),"Age"===o&&null!=r&&(ke(r)?e.Age=+r:(n=!1,i.error(Qe))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||me(r)||(n=!1,i.error(Xe)),me(r)&&(e[o]=_e(r))):me(r)&&(e[o]=_e(r)),"Phone"!==o||we(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),ke(r)?e.Phone=+r:(n=!1,i.error(tt+". Removed."))):(n=!1,i.error(tt+". Removed."))),n||delete e[o]}return n},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var i=function(e){if(null!=e){for(var t="",i="",n=0;n0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ee(o[2]+o[0]+o[1])}return t},Et=function(e,t){var i=t.logger,n={};if(null!=e.displayName&&(n.Name=e.displayName),null!=e.id&&(n.GPID=e.id+""),null!=e.gender&&("male"===e.gender?n.Gender="M":"female"===e.gender?n.Gender="F":"other"===e.gender&&(n.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(n.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var i=e[t],n={},o=void 0;if(null!=i.Site){if(o=i.Site,we(o)||!It(o,{logger:C(this,Rt)[Rt]}))return}else if(null!=i.Facebook){var r=i.Facebook;we(r)||r.error||(o=_t(r))}else if(null!=i["Google Plus"]){var a=i["Google Plus"];we(a)||a.error||(o=Et(a,{logger:C(this,Rt)[Rt]}))}if(null!=o&&!we(o)){n.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=o,At(o,!0),n=C(this,jt)[jt].addSystemDataToObject(n,void 0),C(this,jt)[jt].addFlags(n);var s=ft(JSON.stringify(n),C(this,Rt)[Rt]),l=C(this,Dt)[Dt].dataPostURL;l=pt(l,"type",Y),l=pt(l,"d",s),C(this,jt)[jt].saveAndFireRequest(l,Me.blockRequest)}}},Vt=k("request"),qt=k("logger"),Wt=k("account"),Kt=k("session"),Ht=k("oldValues"),Gt=k("device"),Jt=k("processOUL"),Zt=k("handleCookieFromCache"),$t=k("deleteUser"),Yt=k("processLoginArray"),Qt=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=i.call(this),Object.defineProperty(h(r),Yt,{value:ii}),Object.defineProperty(h(r),$t,{value:ti}),Object.defineProperty(h(r),Zt,{value:ei}),Object.defineProperty(h(r),Jt,{value:Xt}),Object.defineProperty(h(r),Vt,{writable:!0,value:void 0}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Wt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),C(h(r),Vt)[Vt]=a,C(h(r),Wt)[Wt]=s,C(h(r),Kt)[Kt]=l,C(h(r),qt)[qt]=c,C(h(r),Ht)[Ht]=n,C(h(r),Gt)[Gt]=d,r}return n(o,[{key:"clear",value:function(){C(this,qt)[qt].debug("clear called. Reset flag has been set."),C(this,$t)[$t](),Le.setMetaProp(j,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,we(s)||!It(s,{logger:C(this,qt)[qt]}))return}else if(null!=r.Facebook){var l=r.Facebook;we(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];we(c)&&!c.error&&(s=Et(c,{logger:C(this,qt)[qt]}))}if(null!=s&&!we(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&n(d)),At(s,!0),a=C(this,Vt)[Vt].addSystemDataToObject(a,void 0),C(this,Vt)[Vt].addFlags(a),i&&(a.isOUL=!0);var u=ft(JSON.stringify(a),C(this,qt)[qt]),p=C(this,Wt)[Wt].dataPostURL;p=pt(p,"type",Y),p=pt(p,"d",u),C(this,Vt)[Vt].saveAndFireRequest(p,Me.blockRequest,i)}}},ei=function(){Me.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(U,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Kt)[Kt].setSessionCookieObject("")},ti=function(){Me.blockRequest=!0,C(this,qt)[qt].debug("Block request is true"),Me.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,Me.broadDomain),Le.removeCookie(U,ht()),Le.removeCookie(N,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Gt)[Gt].gcookie=null,C(this,Kt)[Kt].setSessionCookieObject("")},ii=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&be(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{C(this,Jt)[Jt]([t])}catch(e){C(this,qt)[qt].debug(e)}}else C(this,qt)[qt].error("Profile object is in incorrect format")}},ni=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),oi=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni),e}return n(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var i=t.target.id;if(i.startsWith("carousel__button")){var n=+i.split("-")[1];n!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=n,e.updateSelectedItem(),e.startAutoSlide())}else if(i.startsWith("carousel__arrow"))i.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(i.indexOf("-")>-1){var o=+i.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,i){var n=document.createElement("ct-web-personalisation-banner");n.classList.add("carousel__item"),n.trackClick=!1,n.setAttribute("id","carousel__item-".concat(i+1)),n.details=t,e.appendChild(n)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var i=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),n=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));i.classList.add("carousel__item--selected"),n&&n.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),ri=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],i=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var n=xt(),o=n.wp[i];null==o&&(o={},n[i]=o),o[t]="dnd",Pt(n)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),ai=function(e){s(o,e);var i=v(o);function o(e,n){var r;return t(this,o),(r=i.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=n,r.renderMessage(n),r}return n(o,[{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var i=this.createEl("div","timeStamp");if(i.innerHTML="".concat(gi(e.id.split("_")[1]),""),!e.viewed){var n=this.createEl("span","unreadMarker");i.appendChild(n)}this.wrapper.appendChild(i),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}var n=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");n.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&n.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(n),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.createEl("div","buttonsContainer"),n=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(n=!0),i.appendChild(r)})),n&&this.addSnackbar(i),i}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=mi;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var i=this.createEl("div","".concat(t,"Container")),n=this.createEl("img",t);return n.setAttribute("src",e),n.setAttribute("loading","lazy"),i.appendChild(n),i}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var i=this,n=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=n.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){i.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&n.onClickUrl&&(n.openUrlInNewTab?window.open(n.onClickUrl,"_blank"):window.location=n.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),si=function(e){s(o,e);var i=v(o);function o(e){var n;return t(this,o),(n=i.call(this)).isInboxOpen=!1,n.isInboxFromFlutter=!1,n.selectedCategory=null,n.unviewedMessages={},n.unviewedCounter=0,n.isPreview=!1,n.inboxConfigForPreview={},n.inboxSelector=null,n.inbox=null,n.emptyInboxMsg=null,n.inboxCard=null,n.unviewedBadge=null,n.observer=null,n.selectedCategoryRef=null,n.addClickListenerOnDocument=function(e){if(e.composedPath().includes(n.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var i=t[0].id;if("closeInbox"===i)n.toggleInbox();else if(i.startsWith("category-"))n.prevCategoryRef=n.selectedCategoryRef,n.selectedCategoryRef=t[0],n.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],n.isPreview)}}}else(n.inboxSelector.contains(e.target)||n.isInboxOpen)&&(n.isInboxFromFlutter?n.isInboxFromFlutter=!1:n.toggleInbox(e))},n.setBadgeStyle=function(e){null!==n.unviewedBadge&&(n.unviewedBadge.innerText=e>9?"9+":e,n.unviewedBadge.style.display=e>0?"flex":"none")},n.logger=e,n.shadow=n.attachShadow({mode:"open"}),n}return n(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(pe)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),i=t?Object.keys(t):[];0!==i.length&&(i.forEach((function(i){t[i].viewed||(e.unviewedMessages[i]=t[i],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=ui(),i=Math.floor(Date.now()/1e3);for(var n in t)if(t[n].wzrk_ttl&&t[n].wzrk_ttl>0&&t[n].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),pi(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.deleteExpiredAndGetUnexpiredMsgs(),n=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=n-r,t.viewed=0,i[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),pi(i),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,i=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(i-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),i=this.createEl("div","headerTitle");i.innerText=this.config.title;var n=this.createEl("div","closeInbox");if(n.innerHTML="×",t.appendChild(i),t.appendChild(n),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,i){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),i=this.createEl("div","leftArrow");i.innerHTML=bi,i.children[0].style="transform: rotate(180deg)",i.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(i);var n=this.createEl("div","categoriesWrapper");["All"].concat(g(this.config.categories)).forEach((function(t,i){var o=e.createEl("div","category-".concat(i),"category");o.innerText=t,0===i&&(e.selectedCategoryRef=o),n.appendChild(o)})),t.appendChild(n);var o=this.createEl("div","rightArrow");o.innerHTML=bi,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=n.children[0],s=n.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(i,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var i=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&i++)})),0===i?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var i,n=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=m(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=new ai(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>n;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,i=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,i?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var i=ui();i[e]=t,pi(i)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,i=getComputedStyle(Me.inbox),n=i.getPropertyValue("--inbox-top"),o=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),a=i.getPropertyValue("--inbox-right");if(t>481&&!(n||o||r||a)){var s=vi(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var i=ui();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=gi(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var i,n,o,r,a,s,l,c,d,u,p,h,f,v,g,y,b,m,w,k,C,x=(n=(i=t).panelBackgroundColor,o=i.panelBorderColor,r=i.headerBackgroundColor,a=i.headerTitleColor,s=i.closeIconColor,l=i.categoriesTabColor,c=i.categoriesTitleColor,d=i.categoriesBorderColor,u=i.selectedCategoryTabColor,p=i.selectedCategoryTitleColor,h=i.selectedCategoryBorderColor,f=i.headerCategoryHeight,'\n \n ")),P=this.config.styles.cards;return x+(v={backgroundColor:P.backgroundColor,borderColor:P.borderColor,titleColor:P.titleColor,descriptionColor:P.descriptionColor,buttonColor:P.buttonColor,buttonTextColor:P.buttonTextColor,unreadMarkerColor:P.unreadMarkerColor},g=v.backgroundColor,y=v.borderColor,b=v.titleColor,m=v.descriptionColor,w=v.buttonColor,k=v.buttonTextColor,C=v.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var n="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=n,i[n]=t,e.unviewedMessages[n]=t,e.unviewedCounter++})),this.buildUIForMessages(i),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),li=function(e){e.inbox_preview?Me.inbox.incomingMessagesForPreview=e.inbox_notifs:Me.inbox.incomingMessages=e},ci=function(e){fi(),Me.inbox=new si({logger:e}),document.body.appendChild(Me.inbox)},di=function(e){var t=Le.readFromLSorCookie(he)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var i={};return i[e]=t,Le.saveToLSorCookie(he,i),i}return t},ui=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!xe(e))return{};var t=di(e);return t.hasOwnProperty(e)?t[e]:{}},pi=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(xe(t)){var i=a(a({},di(t)),{},o({},t,e));Le.saveToLSorCookie(he,i)}},hi=function(e){return new Promise((function(t,i){if("complete"===document.readyState)ci(e),t();else{var n=Le.readFromLSorCookie(pe)||{},o=function(){null===Me.inbox&&ci(e),t()};window.addEventListener("load",(function(){if(document.getElementById(n.inboxSelector))o();else{var i=0;if(i<20)var r=setInterval((function(){document.getElementById(n.inboxSelector)?(o(),clearInterval(r),t()):i>=20&&(clearInterval(r),e.debug("Failed to add inbox")),i++}),500)}}))}}))},fi=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",si),customElements.define("ct-inbox-message",ai))},vi=function(e,t,i){var n,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,f=c.top+a,v=c.bottom,g=c.height,y=c.width,b=!1,m=16;if(v+t<=l){var w=l-(v+t);o=w>=m?v+m:v+w}else if(f-t>=a){var k=f-t;o=k>=m?f-t-m:f-t-k}else b=!0,(o=u+g/2-t/2)l&&(o=l-t);if(b){var C=h+i;if(C<=s){n=h+(C+m<=s?m:s-C)}else{var x=p-i;n=x-(x-m>=r?m:x-r)}}else(n=d+y/2-i/2)s&&(n=h-i>=r?h-i:s-i);return{xPos:n,yPos:o}},gi=function(e){var t=Date.now(),i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60))<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago"))},yi=function(){return Object.keys(Le.readFromLSorCookie(pe)||{}).length>0},bi='\n\n\n',mi='\n\n\n',wi="https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css",ki="wve-anti-flicker-show",Ci="wve-anti-flicker-hide",xi="wve-flicker-style",Pi=function(e,t){var i=window.location.search,n=window.opener;if("?ctBuilder"===i)return e.debug("open in visual builder mode"),window.addEventListener("message",Si,!1),void(n&&n.postMessage({message:"builder",originUrl:window.location.href},"*"));"?ctBuilderPreview"===i&&(window.addEventListener("message",Si,!1),n&&n.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===i&&n&&n.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.9.6"},"*")},Si=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,i,n=new URL(e.data.originUrl).origin;if(e.origin===n)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Oi(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&Ai(e.data,!0)}},Oi=function(e,t,i,n){"complete"===document.readyState?Ei(e,t,i,n):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&Ei(e,t,i,n)}))},Ii=!1,_i=!1;function Ei(e,t,i,n){if(!Ii){window.Shopify&&(_i=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(Ct=document.createElement("div")).id="overlayDiv",Ct.style.position="relative",Ct.style.display="flex",document.body.appendChild(Ct);(function(e,t,i,n,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:n,isShopify:_i,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js",e,t,i,n).then((function(){console.log("Overlay script loaded successfully."),Ii=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=wi,document.head.appendChild(o)}var o}var Ai=function(e,t){console.log(e.details);var i=t?e.details:e.display.details,n=!1,o=function(i,n){var o;n.values&&(n.values.html?i.outerHTML=n.values.html:(null===(o=n.values)||void 0===o?void 0:o.json)?function(e,t){var i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);var n=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(n)}(e,n.values):(console.log("updateFormData called with",n.values.form,t),function(e,t,i){if(void 0!==t.style&&Object.keys(t.style).forEach((function(i){e.style.setProperty(i,t.style[i])})),void 0!==t.underline){var n=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(n," underline").trim():e.style.textDecoration=n.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text),void 0!==t.clickDetails){var o=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){return window.open(o,"_blank").focus()}:function(){window.location.href=o}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var r=document.createElement("style");r.innerHTML=t.elementCss,document.head.appendChild(r)}}(i,n.values.form,t)))};i.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,i,r,a=document.querySelector(e.selector);a?(o(a,e),n=!0):(t=e,i=0,r=setInterval((function(){var e=document.querySelector(t.selector);e?(o(e,t),clearInterval(r)):++i>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(r))}),500))}))})),n&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function Li(e){var t,i=e.personalizedSelectors,n=void 0===i?[]:i,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function i(e){var t=[];e.forEach((function(e){var i=document.querySelectorAll(e);i.length?(i.forEach((function(e){var i,n,o,r;i=e.getBoundingClientRect(),n=window,o=n.innerHeight,r=n.innerWidth,i.bottom>0&&i.right>0&&i.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=xi;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(n))})).observe(document.body,{childList:!0,subtree:!0}),l(n)}))}var Mi=function e(t,i){var n,r=i.device,s=i.session,l=i.request,c=i.logger,d=r,u=s,p=l,h=c,f=0,v=function(i){var n=i.wzrk_id.split("_")[0],r=Oe(),a=function(e,t,i){var n=0,o=0;null!=e[t]&&(n=e[t]),n++,null!=e.tc&&(o=e.tc),i<0&&o++,e.tc=o,e[t]=n};if(Le._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={},l=xt();s=3===i.display.wtarget_type&&l.hasOwnProperty("wi")?l.wi:0!==i.display.wtarget_type&&1!==i.display.wtarget_type||!l.hasOwnProperty("wp")?{}:l.wp,l.hasOwnProperty("global")&&(s.wp=l),null==i.display.wmc&&(i.display.wmc=1),null==i.display.wimc&&(i.display.wimc=1);var c=-1,f=-1,v=-1,g=-1,y=-1,b=-1,m=-1;null!=i.display.efc&&(c=parseInt(i.display.efc,10)),null!=i.display.mdc&&(f=parseInt(i.display.mdc,10)),null!=i.display.tdc&&(v=parseInt(i.display.tdc,10)),null!=i.display.tlc&&(g=parseInt(i.display.tlc,10)),null!=i.display.wmp&&(y=parseInt(i.display.wmp,10)),null!=i.display.wmc&&(b=parseInt(i.display.wmc,10)),null!=i.display.wimc&&(m=parseInt(i.display.wimc,10));var w=s[u.sessionId];if(w){var k=w[n],C=w.tc;if("dnd"===k&&!Me.dismissSpamControl)return!1;if(3===i.display.wtarget_type){if(m>0&&C>=m&&c<0)return!1}else if(b>0&&C>=b&&c<0)return!1;if(f>0&&k>=f)return!1}else w={},s[u.sessionId]=w;var x=s[r];if(null!=x){var P=x[n],S=x.tc;if(y>0&&S>=y&&c<0)return!1;if(v>0&&P>=v)return!1}else x={},s[r]=x;var O=s.global;if(null!=O){var I=O[n];if(g>0&&I>=g)return!1}else O={},s.global=O}if(null!=i.display.delay&&i.display.delay>0){var _=i.display.delay;return i.display.delay=0,setTimeout(e,1e3*_,t,{device:d,session:u,request:p,logger:h}),!1}a(w,n,c),a(x,n,c),a(O,n,c);var E="wp";3===i.display.wtarget_type&&(E="wi");var A={};A[u.sessionId]=w,A[r]=x,A.global=O,Pt(o({},E,A))},g=function(){var e=d.getGuid(),t=u.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(gt(e+"|"+t.p+"|"+t.s))},y=function(e,t){var i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},b=function(e,t,i,n,o){w(t),function(e,t,i,n,o){if(""!==e&&null!=e){var r,a;o?r=i:null!==i&&null!=(a=i.getElementsByClassName("jsCT_CTA"))&&1===a.length&&(r=a[0]);var s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=g()),null!=r&&(r.onclick=function(){if(null!=s)return null==l&&kt.fireRequest(e),y(s,t),void Lt("-1",0,u.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}}(e,t,i,0,o)},w=function(e){var t={type:"event"};t.evtName=ie,t.evtData=o({},te,e.wzrk_id),e.wzrk_pivot&&(t.evtData=a(a({},t.evtData),{},{wzrk_pivot:e.wzrk_pivot})),p.processEvent(t)},k=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-banner");n.msgId=e.wzrk_id,n.pivotId=e.wzrk_pivot,n.divHeight=e.display.divHeight,n.details=e.display.details[0];var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},C=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",oi);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-carousel");n.target=e;var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},x=function(e){var t=e.wzrk_id.split("_")[0],i=e.display;if(2!==i.wtarget_type||1!==e.msgContent.type){if(1===i.layout)return I(void 0,e);if(3===i.layout){var n="wzrkImageOnlyDiv";if(!1===v(e))return;if(Me.dismissSpamControl&&null!=document.getElementById(n))document.getElementById(n).remove();if(null!=document.getElementById(n)||null!=document.getElementById("intentPreview"))return;var o=document.createElement("div");return o.id=n,document.body.appendChild(o),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",ri),function(e){var t=document.createElement("ct-web-popup-imageonly");t.session=u,t.target=e;var i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)}(e)}if(!1!==v(e)){var r="wizParDiv"+i.layout;if(Me.dismissSpamControl&&null!=document.getElementById(r))document.getElementById(r).remove();if(null==document.getElementById(r)){Me.campaignDivMap[t]=r;var a=2===i.layout,s=document.createElement("div");s.id=r;var l=window.innerHeight,c=window.innerWidth,d=!1;if(a)s.setAttribute("style",i.iFrameStyle);else{var p=10,h=5*c/100,f=p+5*l/100,g=30*c/100+20,y="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(g=85*c/100+20,h=5*c/100,f=5*l/100,y="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(g=50*c/100+20,h=5*c/100,f=5*l/100,y="width:50%;"),null==i.proto?(d=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+f+"px !important;width:"+g+"px !important;right:"+h+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",y+i.iFrameStyle)}document.body.appendChild(s);var m=document.createElement("iframe"),w=!1===i.br?"0":"8";m.frameborder="0px",m.marginheight="0px",m.marginwidth="0px",m.scrolling="no",m.id="wiz-iframe";var k,C=e.display.onClick,x="";if(""!==C&&null!=C&&(x="cursor:pointer;"),i.preview&&i["custom-editor"]&&(m.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)k=(k=(k=e.msgContent.html).replace(/##campaignId##/g,t)).replace(/##campaignId_batchId##/g,e.wzrk_id);else{var S,O,_,E,A,L='";"dark"===e.display.theme?(S="#2d2d2e",O="#eaeaea",_="#353535",E="#353535",A="#ffffff"):(S="#ffffff",O="#000000",E="#f4f4f4",_="#a5a6a6",A="#ffffff");var M=e.msgContent.title,T=e.msgContent.description,R="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(R=""),k=L+("
×
"+R+"
"+M+"
")+("
"+T+"
")}m.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(m);var j=new Event("CT_campaign_rendered");document.dispatchEvent(j),i["custom-editor"]&&(k=P(e,k)),m.srcdoc=k;var D=function(){p=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||a||(p+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=p+"px"},z=navigator.userAgent.toLowerCase();if(-1!==z.indexOf("safari"))if(z.indexOf("chrome")>-1)m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)};else{var B=m.contentDocument||m.contentWindow;B.document&&(B=B.document);var N=setInterval((function(){if("complete"===B.readyState){clearInterval(N),D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}),300)}else m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}}}else{var U={};U.msgId=e.wzrk_id,e.wzrk_pivot&&(U.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(U.kv=e.msgContent.kv);var F=new CustomEvent("CT_web_native_display",{detail:U});document.dispatchEvent(F)}},P=function(e,t){var i="\n "); + return html.replace(/(<\s*\/\s*body)/, "".concat(script, "\n$1")); + }; + var staleDataUpdate = function staleDataUpdate(staledata, campType) { + var campObj = getCampaignObject(); + var globalObj = campObj[campType].global; + + if (globalObj != null && campType) { + for (var idx in staledata) { + if (staledata.hasOwnProperty(idx)) { + delete globalObj[staledata[idx]]; + + if (StorageManager.read(CAMP_COOKIE_G)) { + var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); + var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + + if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { + delete guidCampObj[guid][campType][staledata[idx]]; + StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj))); + } + } + } + } } - } - function addAntiFlicker(antiFlicker) { - var _antiFlicker$personal = antiFlicker.personalizedSelectors, - personalizedSelectors = _antiFlicker$personal === void 0 ? [] : _antiFlicker$personal, - _antiFlicker$delayTim = antiFlicker.delayTime, - delayTime = _antiFlicker$delayTim === void 0 ? 2000 : _antiFlicker$delayTim; - var retryElements = {}; // Track selectors that need retry + saveCampaignObject(campObj); + }; + var mergeEventMap = function mergeEventMap(newEvtMap) { + if ($ct.globalEventsMap == null) { + $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); - var retryCount = 0; // Counter for retries + if ($ct.globalEventsMap == null) { + $ct.globalEventsMap = newEvtMap; + return; + } + } - var retryInterval; + for (var key in newEvtMap) { + if (newEvtMap.hasOwnProperty(key)) { + var oldEvtObj = $ct.globalEventsMap[key]; + var newEvtObj = newEvtMap[key]; - function isInViewport(element) { - var rect = element.getBoundingClientRect(); - var _window = window, - windowHeight = _window.innerHeight, - windowWidth = _window.innerWidth; - return rect.bottom > 0 && rect.right > 0 && rect.top < windowHeight && rect.left < windowWidth; + if ($ct.globalEventsMap[key] != null) { + if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { + $ct.globalEventsMap[key] = newEvtObj; + } + } else { + $ct.globalEventsMap[key] = newEvtObj; + } + } } + }; + var incrementImpression = function incrementImpression(targetingMsgJson, _request) { + var data = {}; + data.type = 'event'; + data.evtName = NOTIFICATION_VIEWED; + data.evtData = _defineProperty({}, WZRK_ID, targetingMsgJson.wzrk_id); - (function () { - var styleContent = "\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n "; // Create and append the style element if it doesn't exist + if (targetingMsgJson.wzrk_pivot) { + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { + wzrk_pivot: targetingMsgJson.wzrk_pivot + }); + } - var styleId = WVE_CLASS.FLICKER_ID; + _request.processEvent(data); + }; + var setupClickEvent = function setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) { + if (onClick !== '' && onClick != null) { + var ctaElement; + var jsCTAElements; - if (!document.getElementById(styleId)) { - var styleElement = document.createElement('style'); - styleElement.id = styleId; - styleElement.textContent = styleContent; - document.head.appendChild(styleElement); + if (isLegacy) { + ctaElement = contentDiv; + } else if (contentDiv !== null) { + jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA'); + + if (jsCTAElements != null && jsCTAElements.length === 1) { + ctaElement = jsCTAElements[0]; + } } - })(); - function applyAntiFlicker(selectors) { - function processSelectors(selectorElements) { - var elements = []; - selectorElements.forEach(function (selector) { - var matchedElements = document.querySelectorAll(selector); + var jsFunc = targetingMsgJson.display.jsFunc; + var isPreview = targetingMsgJson.display.preview; - if (matchedElements.length) { - matchedElements.forEach(function (el) { - if (isInViewport(el)) { - elements.push(el); - } - }); - delete retryElements[selector]; // Successfully processed, remove from retry list - } else { - retryElements[selector] = false; // Add to retry list if not found - } - }); - applyStyles(elements); + if (isPreview == null) { + onClick += getCookieParams(_device, _session); } - function retryProcessing() { - processSelectors(Object.keys(retryElements)); - retryCount++; + if (ctaElement != null) { + ctaElement.onclick = function () { + // invoke js function call + if (jsFunc != null) { + // track notification clicked event + if (isPreview == null) { + RequestDispatcher.fireRequest(onClick); + } - if (Object.keys(retryElements).length === 0 || retryCount > 20) { - retryCount = 0; - clearInterval(retryInterval); - } - } + invokeExternalJs(jsFunc, targetingMsgJson); // close iframe. using -1 for no campaignId - processSelectors(selectors); + closeIframe('-1', divId, _session.sessionId); + } else { + var rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r'); + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + + if (rValue === 'pushPrompt') { + if (!targetingMsgJson.display.preview) { + window.parent.clevertap.renderNotificationClicked({ + msgId: targetingMsgJson.wzrk_id, + pivotId: targetingMsgJson.wzrk_pivot + }); + } // Open Web Push Soft prompt - if (Object.keys(retryElements).length) { - retryInterval = setInterval(retryProcessing, 100); - } - } - function applyStyles(elements) { - elements.forEach(function (el) { - return el.classList.add(WVE_CLASS.FLICKER_HIDE); - }); - setTimeout(function () { - elements.forEach(function (el) { - el.classList.remove(WVE_CLASS.FLICKER_HIDE); - el.classList.add(WVE_CLASS.FLICKER_SHOW); - }); - }, delayTime); // Apply styles after maxRenderTime - } + window.clevertap.notifications.push({ + skipDialog: true + }); + closeIframe(campaignId, divId, _session.sessionId); + } else if (rValue === 'none') { + // Close notification + closeIframe(campaignId, divId, _session.sessionId); + } else { + // Will get the url to open + if (targetingMsgJson.display.window === 1) { + window.open(onClick, '_blank'); + + if (targetingMsgJson.display['close-popup']) { + closeIframe(campaignId, divId, _session.sessionId); + } - function observeUrlChange() { - var previousHref = document.location.href; - var observer = new MutationObserver(function () { - if (previousHref !== document.location.href) { - previousHref = document.location.href; - applyAntiFlicker(personalizedSelectors); - } - }); - observer.observe(document.body, { - childList: true, - subtree: true - }); + if (!targetingMsgJson.display.preview) { + window.parent.clevertap.renderNotificationClicked({ + msgId: targetingMsgJson.wzrk_id, + pivotId: targetingMsgJson.wzrk_pivot + }); + } + } else { + window.location = onClick; + } + } + } + }; + } } + }; + var getCookieParams = function getCookieParams(_device, _session) { + var gcookie = _device.getGuid(); - window.addEventListener('load', function () { - observeUrlChange(); - applyAntiFlicker(personalizedSelectors); - }); - } + var scookieObj = _session.getSessionCookieObject(); - var _tr = function _tr(msg, _ref) { - var device = _ref.device, - session = _ref.session, - request = _ref.request, - logger = _ref.logger; - var _device = device; - var _session = session; - var _request = request; - var _logger = logger; - var _wizCounter = 0; // Campaign House keeping + return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s)); + }; - var doCampHouseKeeping = function doCampHouseKeeping(targetingMsgJson) { - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - var today = getToday(); + var renderPopUpImageOnly = function renderPopUpImageOnly(targetingMsgJson, _session) { + var divId = 'wzrkImageOnlyDiv'; + var popupImageOnly = document.createElement('ct-web-popup-imageonly'); + popupImageOnly.session = _session; + popupImageOnly.target = targetingMsgJson; + var containerEl = document.getElementById(divId); + containerEl.innerHTML = ''; + containerEl.style.visibility = 'hidden'; + containerEl.appendChild(popupImageOnly); + }; - var incrCount = function incrCount(obj, campaignId, excludeFromFreqCaps) { - var currentCount = 0; - var totalCount = 0; + var getBoxPromptStyles = function getBoxPromptStyles(style) { + var totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0; + var cardPadding = 16 * 2; // Left and right padding - if (obj[campaignId] != null) { - currentCount = obj[campaignId]; - } + var cardContentWidth = 360 - cardPadding - totalBorderWidth; + return "\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ".concat(style.overlay.color || 'rgba(0, 0, 0, .15)', ";\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ").concat(style.card.color, ";\n border-radius: ").concat(style.card.borderRadius, "px;\n padding: 16px;\n width: ").concat(cardContentWidth, "px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ").concat(style.card.borderEnabled ? "\n border-width: ".concat(style.card.border.borderWidth, "px;\n border-color: ").concat(style.card.border.borderColor, ";\n border-style: solid;\n ") : '', "\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ").concat(style.text.titleColor, ";\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ").concat(style.text.descriptionColor, ";\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ").concat(style.buttons.primaryButton.buttonColor, ";\n color: ").concat(style.buttons.primaryButton.textColor, ";\n border-radius: ").concat(style.buttons.primaryButton.borderRadius, "px;\n ").concat(style.buttons.primaryButton.borderEnabled ? "\n border-width: ".concat(style.buttons.primaryButton.border.borderWidth, "px;\n border-color: ").concat(style.buttons.primaryButton.border.borderColor, ";\n border-style: solid;\n ") : 'border: none;', "\n }\n\n #secondaryButton {\n background-color: ").concat(style.buttons.secondaryButton.buttonColor, ";\n color: ").concat(style.buttons.secondaryButton.textColor, ";\n border-radius: ").concat(style.buttons.secondaryButton.borderRadius, "px;\n ").concat(style.buttons.secondaryButton.borderEnabled ? "\n border-width: ".concat(style.buttons.secondaryButton.border.borderWidth, "px;\n border-color: ").concat(style.buttons.secondaryButton.border.borderColor, ";\n border-style: solid;\n ") : 'border: none;', "\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n "); + }; + var getBellIconStyles = function getBellIconStyles(style) { + return "\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ".concat(style.card.backgroundColor, ";\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n "); + }; - currentCount++; + var _oldValues$3 = _classPrivateFieldLooseKey("oldValues"); - if (obj.tc != null) { - totalCount = obj.tc; - } // if exclude from caps then dont add to total counts + var _logger$5 = _classPrivateFieldLooseKey("logger"); + var _request$4 = _classPrivateFieldLooseKey("request"); - if (excludeFromFreqCaps < 0) { - totalCount++; - } + var _account$2 = _classPrivateFieldLooseKey("account"); - obj.tc = totalCount; - obj[campaignId] = currentCount; - }; + var _wizAlertJSPath = _classPrivateFieldLooseKey("wizAlertJSPath"); - if (StorageManager._isLocalStorageSupported()) { - delete sessionStorage[CAMP_COOKIE_NAME]; - var campTypeObj = {}; - var campObj = getCampaignObject(); + var _fcmPublicKey = _classPrivateFieldLooseKey("fcmPublicKey"); - if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) { - campTypeObj = campObj.wi; - } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) { - campTypeObj = campObj.wp; - } else { - campTypeObj = {}; - } + var _setUpWebPush = _classPrivateFieldLooseKey("setUpWebPush"); - if (campObj.hasOwnProperty('global')) { - campTypeObj.wp = campObj; - } // global session limit. default is 1 + var _setUpSafariNotifications = _classPrivateFieldLooseKey("setUpSafariNotifications"); + var _setUpChromeFirefoxNotifications = _classPrivateFieldLooseKey("setUpChromeFirefoxNotifications"); - if (targetingMsgJson[DISPLAY].wmc == null) { - targetingMsgJson[DISPLAY].wmc = 1; - } // global session limit for web inbox. default is 1 + var _addWizAlertJS = _classPrivateFieldLooseKey("addWizAlertJS"); + var _removeWizAlertJS = _classPrivateFieldLooseKey("removeWizAlertJS"); - if (targetingMsgJson[DISPLAY].wimc == null) { - targetingMsgJson[DISPLAY].wimc = 1; - } + var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); - var excludeFromFreqCaps = -1; // efc - Exclude from frequency caps + var NotificationHandler = /*#__PURE__*/function (_Array) { + _inherits(NotificationHandler, _Array); - var campaignSessionLimit = -1; // mdc - Once per session + var _super = _createSuper(NotificationHandler); - var campaignDailyLimit = -1; // tdc - Once per day + function NotificationHandler(_ref, values) { + var _this; - var campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign + var logger = _ref.logger, + session = _ref.session, + request = _ref.request, + account = _ref.account; - var totalDailyLimit = -1; - var totalSessionLimit = -1; // wmc - Web Popup Global Session Limit + _classCallCheck(this, NotificationHandler); - var totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { + value: _handleNotificationRegistration2 + }); + Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { + value: _removeWizAlertJS2 + }); + Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { + value: _addWizAlertJS2 + }); + Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { + value: _setUpChromeFirefoxNotifications2 + }); + Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { + value: _setUpSafariNotifications2 + }); + Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { + value: _setUpWebPush2 + }); + Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _logger$5, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _request$4, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _account$2, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { + writable: true, + value: void 0 + }); + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$5)[_logger$5] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$2)[_account$2] = account; + return _this; + } - if (targetingMsgJson[DISPLAY].efc != null) { - // exclude from frequency cap - excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10); + _createClass(NotificationHandler, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { + displayArgs[_key] = arguments[_key]; } - if (targetingMsgJson[DISPLAY].mdc != null) { - // Campaign Session Limit - campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10); - } + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - if (targetingMsgJson[DISPLAY].tdc != null) { - // No of web popups in a day per campaign - campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10); + return 0; + } + }, { + key: "enable", + value: function enable() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var swPath = options.swPath; + enablePush(_classPrivateFieldLooseBase(this, _logger$5)[_logger$5], _classPrivateFieldLooseBase(this, _account$2)[_account$2], _classPrivateFieldLooseBase(this, _request$4)[_request$4], swPath); + } + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); } - if (targetingMsgJson[DISPLAY].tlc != null) { - // Total lifetime count - campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10); + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; + } + }, { + key: "setUpWebPushNotifications", + value: function setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) { + if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) { + _classPrivateFieldLooseBase(this, _setUpChromeFirefoxNotifications)[_setUpChromeFirefoxNotifications](subscriptionCallback, serviceWorkerPath); + } else if (navigator.userAgent.indexOf('Safari') !== -1) { + _classPrivateFieldLooseBase(this, _setUpSafariNotifications)[_setUpSafariNotifications](subscriptionCallback, apnsWebPushId, apnsServiceUrl); } + } + }, { + key: "setApplicationServerKey", + value: function setApplicationServerKey(applicationServerKey) { + _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = applicationServerKey; + } + }, { + key: "_enableWebPush", + value: function _enableWebPush(enabled, applicationServerKey) { + $ct.webPushEnabled = enabled; - if (targetingMsgJson[DISPLAY].wmp != null) { - // No of campaigns per day - totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10); + if (applicationServerKey != null) { + this.setApplicationServerKey(applicationServerKey); } - if (targetingMsgJson[DISPLAY].wmc != null) { - // No of campaigns per session - totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10); + if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); + } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); } + } + }]); - if (targetingMsgJson[DISPLAY].wimc != null) { - // No of inbox campaigns per session - totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10); - } // session level capping - - - var sessionObj = campTypeObj[_session.sessionId]; - - if (sessionObj) { - var campaignSessionCount = sessionObj[campaignId]; - var totalSessionCount = sessionObj.tc; // dnd - - if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) { - return false; - } + return NotificationHandler; + }( /*#__PURE__*/_wrapNativeSuper(Array)); - if (targetingMsgJson[DISPLAY].wtarget_type === 3) { - // Inbox session - if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) { - return false; - } - } else { - // session - if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) { - return false; - } - } // campaign session + var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { + if ($ct.webPushEnabled && displayArgs.length > 0) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration](displayArgs); + } else if ($ct.webPushEnabled == null && displayArgs.length > 0) { + $ct.notifApi.notifEnabledFromApi = true; + $ct.notifApi.displayArgs = displayArgs.slice(); + } else if ($ct.webPushEnabled === false && displayArgs.length > 0) { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Make sure push notifications are fully enabled and integrated'); + } + }; + var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { + var _this2 = this; - if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) { - return false; - } - } else { - sessionObj = {}; - campTypeObj[_session.sessionId] = sessionObj; - } // daily level capping + // ensure that proper arguments are passed + if (typeof apnsWebPushId === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that APNS Web Push ID is supplied'); + } + if (typeof apnsServiceUrl === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that APNS Web Push service path is supplied'); + } - var dailyObj = campTypeObj[today]; + if ('safari' in window && 'pushNotification' in window.safari) { + window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { + if (subscription.permission === 'granted') { + var subscriptionData = JSON.parse(JSON.stringify(subscription)); + subscriptionData.endpoint = subscription.deviceToken; + subscriptionData.browser = 'Safari'; + StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - if (dailyObj != null) { - var campaignDailyCount = dailyObj[campaignId]; - var totalDailyCount = dailyObj.tc; // daily + _classPrivateFieldLooseBase(_this2, _request$4)[_request$4].registerToken(subscriptionData); - if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) { - return false; - } // campaign daily + _classPrivateFieldLooseBase(_this2, _logger$5)[_logger$5].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); + } else if (subscription.permission === 'denied') { + _classPrivateFieldLooseBase(_this2, _logger$5)[_logger$5].info('Error subscribing to Safari web push'); + } + }); + } + }; + var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { + var _this3 = this; - if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) { - return false; - } - } else { - dailyObj = {}; - campTypeObj[today] = dailyObj; + var registrationScope = ''; + + if ('serviceWorker' in navigator) { + navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { + if (typeof __wzrk_account_id !== 'undefined') { + // eslint-disable-line + // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. + // hence add a timeout and hope serviceWroker is ready within that time. + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); } - var globalObj = campTypeObj[GLOBAL]; + registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE + // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS + // OR getRegistrations PROMISE IF ITS FIREFOX - if (globalObj != null) { - var campaignTotalCount = globalObj[campaignId]; // campaign total + var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; + var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); - if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) { - return false; - } + if (isServiceWorkerAtRoot) { + return navigator.serviceWorker.ready; } else { - globalObj = {}; - campTypeObj[GLOBAL] = globalObj; + if (navigator.userAgent.indexOf('Chrome') !== -1) { + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); + } else { + return navigator.serviceWorker.getRegistrations(); + } + } + }).then(function (serviceWorkerRegistration) { + // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE + if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { + serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { + return i.scope === registrationScope; + })[0]; } - } // delay - - if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) { - var delay = targetingMsgJson[DISPLAY].delay; - targetingMsgJson[DISPLAY].delay = 0; - setTimeout(_tr, delay * 1000, msg, { - device: _device, - session: _session, - request: _request, - logger: _logger - }); - return false; - } + var subscribeObj = { + userVisibleOnly: true + }; - incrCount(sessionObj, campaignId, excludeFromFreqCaps); - incrCount(dailyObj, campaignId, excludeFromFreqCaps); - incrCount(globalObj, campaignId, excludeFromFreqCaps); - var campKey = 'wp'; + if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { + subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); + } - if (targetingMsgJson[DISPLAY].wtarget_type === 3) { - campKey = 'wi'; - } // get ride of stale sessions and day entries + serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC - var newCampObj = {}; - newCampObj[_session.sessionId] = sessionObj; - newCampObj[today] = dailyObj; - newCampObj[GLOBAL] = globalObj; - saveCampaignObject(_defineProperty({}, campKey, newCampObj)); - }; + var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token - var getCookieParams = function getCookieParams() { - var gcookie = _device.getGuid(); + if (navigator.userAgent.indexOf('Chrome') !== -1) { + subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); + subscriptionData.browser = 'Chrome'; + } else if (navigator.userAgent.indexOf('Firefox') !== -1) { + subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); + subscriptionData.browser = 'Firefox'; + } - var scookieObj = _session.getSessionCookieObject(); + StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s)); - }; + _classPrivateFieldLooseBase(_this3, _request$4)[_request$4].registerToken(subscriptionData); - var setupClickEvent = function setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { - if (onClick !== '' && onClick != null) { - var ctaElement; - var jsCTAElements; + if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { + subscriptionCallback(); + } - if (isLegacy) { - ctaElement = contentDiv; - } else if (contentDiv !== null) { - jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA'); + var existingBellWrapper = document.getElementById('bell_wrapper'); - if (jsCTAElements != null && jsCTAElements.length === 1) { - ctaElement = jsCTAElements[0]; + if (existingBellWrapper) { + existingBellWrapper.parentNode.removeChild(existingBellWrapper); } - } + }).catch(function (error) { + // unsubscribe from webpush if error + serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { + if (subscription !== null) { + subscription.unsubscribe().then(function (successful) { + // You've successfully unsubscribed + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].info('Unsubscription successful'); + + window.clevertap.notifications.push({ + skipDialog: true + }); + }).catch(function (e) { + // Unsubscription failed + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('Error unsubscribing: ' + e); + }); + } + }); - var jsFunc = targetingMsgJson.display.jsFunc; - var isPreview = targetingMsgJson.display.preview; + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('Error subscribing: ' + error); + }); + }).catch(function (err) { + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('error registering service worker: ' + err); + }); + } + }; - if (isPreview == null) { - onClick += getCookieParams(); - } + var _addWizAlertJS2 = function _addWizAlertJS2() { + var scriptTag = document.createElement('script'); + scriptTag.setAttribute('type', 'text/javascript'); + scriptTag.setAttribute('id', 'wzrk-alert-js'); + scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body - if (ctaElement != null) { - ctaElement.onclick = function () { - // invoke js function call - if (jsFunc != null) { - // track notification clicked event - if (isPreview == null) { - RequestDispatcher.fireRequest(onClick); - } + document.getElementsByTagName('body')[0].appendChild(scriptTag); + return scriptTag; + }; - invokeExternalJs(jsFunc, targetingMsgJson); // close iframe. using -1 for no campaignId + var _removeWizAlertJS2 = function _removeWizAlertJS2() { + var scriptTag = document.getElementById('wzrk-alert-js'); + scriptTag.parentNode.removeChild(scriptTag); + }; - closeIframe('-1', divId, _session.sessionId); - return; - } // pass on the gcookie|page|scookieId for capturing the click event + var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { + var _this4 = this; + // make sure everything is specified + var titleText; + var bodyText; + var okButtonText; + var rejectButtonText; + var okButtonColor; + var skipDialog; + var askAgainTimeInSeconds; + var okCallback; + var rejectCallback; + var subscriptionCallback; + var serviceWorkerPath; + var httpsPopupPath; + var httpsIframePath; + var apnsWebPushId; + var apnsWebPushServiceUrl; - if (targetingMsgJson.display.window === 1) { - window.open(onClick, '_blank'); - } else { - window.location = onClick; - } - }; - } + if (displayArgs.length === 1) { + if (isObject(displayArgs[0])) { + var notifObj = displayArgs[0]; + titleText = notifObj.titleText; + bodyText = notifObj.bodyText; + okButtonText = notifObj.okButtonText; + rejectButtonText = notifObj.rejectButtonText; + okButtonColor = notifObj.okButtonColor; + skipDialog = notifObj.skipDialog; + askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds; + okCallback = notifObj.okCallback; + rejectCallback = notifObj.rejectCallback; + subscriptionCallback = notifObj.subscriptionCallback; + serviceWorkerPath = notifObj.serviceWorkerPath; + httpsPopupPath = notifObj.httpsPopupPath; + httpsIframePath = notifObj.httpsIframePath; + apnsWebPushId = notifObj.apnsWebPushId; + apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl; } - }; + } else { + titleText = displayArgs[0]; + bodyText = displayArgs[1]; + okButtonText = displayArgs[2]; + rejectButtonText = displayArgs[3]; + okButtonColor = displayArgs[4]; + skipDialog = displayArgs[5]; + askAgainTimeInSeconds = displayArgs[6]; + } - var invokeExternalJs = function invokeExternalJs(jsFunc, targetingMsgJson) { - var func = window.parent[jsFunc]; + if (skipDialog == null) { + skipDialog = false; + } - if (typeof func === 'function') { - if (targetingMsgJson.display.kv != null) { - func(targetingMsgJson.display.kv); - } else { - func(); - } - } - }; + if (serviceWorkerPath == null) { + serviceWorkerPath = '/clevertap_sw.js'; + } // ensure that the browser supports notifications - var setupClickUrl = function setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { - incrementImpression(targetingMsgJson); - setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy); - }; - var incrementImpression = function incrementImpression(targetingMsgJson) { - var data = {}; - data.type = 'event'; - data.evtName = NOTIFICATION_VIEWED; - data.evtData = _defineProperty({}, WZRK_ID, targetingMsgJson.wzrk_id); + if (typeof navigator.serviceWorker === 'undefined') { + return; + } - if (targetingMsgJson.wzrk_pivot) { - data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { - wzrk_pivot: targetingMsgJson.wzrk_pivot - }); - } + var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications - _request.processEvent(data); - }; + if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Make sure you are https or localhost to register for notifications'); + + return; + } // right now, we only support Chrome V50 & higher & Firefox - var renderPersonalisationBanner = function renderPersonalisationBanner(targetingMsgJson) { - var _targetingMsgJson$dis; - if (customElements.get('ct-web-personalisation-banner') === undefined) { - customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner); - } + if (navigator.userAgent.indexOf('Chrome') !== -1) { + var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); - var divId = (_targetingMsgJson$dis = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis !== void 0 ? _targetingMsgJson$dis : targetingMsgJson.display.divSelector; - var bannerEl = document.createElement('ct-web-personalisation-banner'); - bannerEl.msgId = targetingMsgJson.wzrk_id; - bannerEl.pivotId = targetingMsgJson.wzrk_pivot; - bannerEl.divHeight = targetingMsgJson.display.divHeight; - bannerEl.details = targetingMsgJson.display.details[0]; - var containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); - containerEl.innerHTML = ''; - containerEl.appendChild(bannerEl); - }; + if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { + return; + } + } else if (navigator.userAgent.indexOf('Firefox') !== -1) { + var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); - var renderPersonalisationCarousel = function renderPersonalisationCarousel(targetingMsgJson) { - var _targetingMsgJson$dis2; + if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { + return; + } + } else if (navigator.userAgent.indexOf('Safari') !== -1) { + var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); - if (customElements.get('ct-web-personalisation-carousel') === undefined) { - customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel); + if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { + return; } + } else { + return; + } // we check for the cookie in setUpChromeNotifications() the tokens may have changed - var divId = (_targetingMsgJson$dis2 = targetingMsgJson.display.divId) !== null && _targetingMsgJson$dis2 !== void 0 ? _targetingMsgJson$dis2 : targetingMsgJson.display.divSelector; - var carousel = document.createElement('ct-web-personalisation-carousel'); - carousel.target = targetingMsgJson; - var container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId); - container.innerHTML = ''; - container.appendChild(carousel); - }; - - var renderPopUpImageOnly = function renderPopUpImageOnly(targetingMsgJson) { - var divId = 'wzrkImageOnlyDiv'; - var popupImageOnly = document.createElement('ct-web-popup-imageonly'); - popupImageOnly.session = _session; - popupImageOnly.target = targetingMsgJson; - var containerEl = document.getElementById(divId); - containerEl.innerHTML = ''; - containerEl.style.visibility = 'hidden'; - containerEl.appendChild(popupImageOnly); - }; - - var renderFooterNotification = function renderFooterNotification(targetingMsgJson) { - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - var displayObj = targetingMsgJson.display; - - if (displayObj.wtarget_type === 2) { - // Handling Web Native display - // Logic for kv pair data - if (targetingMsgJson.msgContent.type === 1) { - var inaObj = {}; - inaObj.msgId = targetingMsgJson.wzrk_id; - if (targetingMsgJson.wzrk_pivot) { - inaObj.pivotId = targetingMsgJson.wzrk_pivot; - } + if (!isHTTP) { + if (Notification == null) { + return; + } // handle migrations from other services -> chrome notifications may have already been asked for before - if (targetingMsgJson.msgContent.kv != null) { - inaObj.kv = targetingMsgJson.msgContent.kv; - } - var kvPairsEvent = new CustomEvent('CT_web_native_display', { - detail: inaObj - }); - document.dispatchEvent(kvPairsEvent); - return; - } + if (Notification.permission === 'granted') { + // skip the dialog and register + this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + return; + } else if (Notification.permission === 'denied') { + // we've lost this profile :'( + return; } - if (displayObj.layout === 1) { - // Handling Web Exit Intent - return showExitIntent(undefined, targetingMsgJson); + if (skipDialog) { + this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + return; } + } // make sure the right parameters are passed - if (displayObj.layout === 3) { - // Handling Web Popup Image Only - var _divId = 'wzrkImageOnlyDiv'; - - if (doCampHouseKeeping(targetingMsgJson) === false) { - return; - } - if ($ct.dismissSpamControl && document.getElementById(_divId) != null) { - var element = document.getElementById(_divId); - element.remove(); - } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist + if (!titleText || !bodyText || !okButtonText || !rejectButtonText) { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Missing input parameters; please specify title, body, ok button and cancel button text'); + return; + } // make sure okButtonColor is formatted properly - if (document.getElementById(_divId) != null || document.getElementById('intentPreview') != null) { - return; - } - var _msgDiv = document.createElement('div'); + if (okButtonColor == null || !okButtonColor.match(/^#[a-f\d]{6}$/i)) { + okButtonColor = '#f28046'; // default color for positive button + } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds - _msgDiv.id = _divId; - document.body.appendChild(_msgDiv); - if (customElements.get('ct-web-popup-imageonly') === undefined) { - customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly); - } + var now = new Date().getTime() / 1000; - return renderPopUpImageOnly(targetingMsgJson); + if (StorageManager.getMetaProp('notif_last_time') == null) { + StorageManager.setMetaProp('notif_last_time', now); + } else { + if (askAgainTimeInSeconds == null) { + // 7 days by default + askAgainTimeInSeconds = 7 * 24 * 60 * 60; } - if (doCampHouseKeeping(targetingMsgJson) === false) { + if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) { return; + } else { + // continue asking + StorageManager.setMetaProp('notif_last_time', now); } + } - var divId = 'wizParDiv' + displayObj.layout; + if (isHTTP) { + // add the https iframe + var httpsIframe = document.createElement('iframe'); + httpsIframe.setAttribute('style', 'display:none;'); + httpsIframe.setAttribute('src', httpsIframePath); + document.body.appendChild(httpsIframe); + window.addEventListener('message', function (event) { + if (event.data != null) { + var obj = {}; - if ($ct.dismissSpamControl && document.getElementById(divId) != null) { - var _element = document.getElementById(divId); + try { + obj = JSON.parse(event.data); + } catch (e) { + // not a call from our iframe + return; + } - _element.remove(); - } + if (obj.state != null) { + if (obj.from === 'ct' && obj.state === 'not') { + _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + // create our wizrocket popup + window.wzrkPermissionPopup.wizAlert({ + title: titleText, + body: bodyText, + confirmButtonText: okButtonText, + confirmButtonColor: okButtonColor, + rejectButtonText: rejectButtonText + }, function (enabled) { + // callback function + if (enabled) { + // the user accepted on the dialog box + if (typeof okCallback === 'function') { + okCallback(); + } // redirect to popup.html - if (document.getElementById(divId) != null) { - return; - } - $ct.campaignDivMap[campaignId] = divId; - var isBanner = displayObj.layout === 2; - var msgDiv = document.createElement('div'); - msgDiv.id = divId; - var viewHeight = window.innerHeight; - var viewWidth = window.innerWidth; - var legacy = false; + window.open(httpsPopupPath); + } else { + if (typeof rejectCallback === 'function') { + rejectCallback(); + } + } - if (!isBanner) { - var marginBottom = viewHeight * 5 / 100; - var contentHeight = 10; - var right = viewWidth * 5 / 100; - var bottomPosition = contentHeight + marginBottom; - var width = viewWidth * 30 / 100 + 20; - var widthPerct = 'width:30%;'; // for small devices - mobile phones + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + }); + }; + } + } + } + }, false); + } else { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { + // create our wizrocket popup + window.wzrkPermissionPopup.wizAlert({ + title: titleText, + body: bodyText, + confirmButtonText: okButtonText, + confirmButtonColor: okButtonColor, + rejectButtonText: rejectButtonText + }, function (enabled) { + // callback function + if (enabled) { + // the user accepted on the dialog box + if (typeof okCallback === 'function') { + okCallback(); + } - if ((/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent)) && /iPad/i.test(navigator.userAgent) === false) { - width = viewWidth * 85 / 100 + 20; - right = viewWidth * 5 / 100; - bottomPosition = viewHeight * 5 / 100; - widthPerct = 'width:80%;'; // medium devices - tablets - } else if ('ontouchstart' in window || /tablet/i.test(navigator.userAgent)) { - width = viewWidth * 50 / 100 + 20; - right = viewWidth * 5 / 100; - bottomPosition = viewHeight * 5 / 100; - widthPerct = 'width:50%;'; - } // legacy footer notif + _this4.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + } else { + if (typeof rejectCallback === 'function') { + rejectCallback(); + } + } + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); + }); + }; + } + }; - if (displayObj.proto == null) { - legacy = true; - msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;'); - } else { - msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle); - } - } else { - msgDiv.setAttribute('style', displayObj.iFrameStyle); - } + var BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBj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kgNDEuMDQ5NyAyMy44NzM1IDQxLjA0OTdIMjkuNzgxMlY0MS43ODQyQzI5Ljc4MTIgNDMuMDA3NyAzMC43NzMxIDQzLjk5OTYgMzEuOTk2NiA0My45OTk2QzMzLjIyMDIgNDMuOTk5NiAzNC4yMTIgNDMuMDA3NyAzNC4yMTIgNDEuNzg0MlY0MS4wNDk3SDQwLjEyMzNDNDAuOTM4IDQxLjA0OTcgNDEuNTk4NCA0MC4zODkzIDQxLjU5ODQgMzkuNTc0NkM0MS41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='; - document.body.appendChild(msgDiv); - var iframe = document.createElement('iframe'); - var borderRadius = displayObj.br === false ? '0' : '8'; - iframe.frameborder = '0px'; - iframe.marginheight = '0px'; - iframe.marginwidth = '0px'; - iframe.scrolling = 'no'; - iframe.id = 'wiz-iframe'; - var onClick = targetingMsgJson.display.onClick; - var pointerCss = ''; + var appServerKey = null; + var swPath = '/clevertap_sw.js'; + var notificationHandler = null; + var processWebPushConfig = function processWebPushConfig(webPushConfig, logger, request) { + var _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; - if (onClick !== '' && onClick != null) { - pointerCss = 'cursor:pointer;'; - } + var updatePushConfig = function updatePushConfig() { + $ct.pushConfig = webPushConfig; + StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig); + }; - if (displayObj.preview && displayObj['custom-editor']) { - iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; - } + if (webPushConfig.isPreview) { + updatePushConfig(); + enablePush(logger, null, request); + } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) { + updatePushConfig(); + } + }; + var enablePush = function enablePush(logger, account, request, customSwPath) { + var _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; - var html; // direct html + $ct.pushConfig = _pushConfig; - if (targetingMsgJson.msgContent.type === 1) { - html = targetingMsgJson.msgContent.html; - html = html.replace(/##campaignId##/g, campaignId); - html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); - } else { - var css = '' + ''; - var bgColor, textColor, btnBg, leftTd, btColor; + if (!$ct.pushConfig) { + logger.error('Web Push config data not present'); + return; + } - if (targetingMsgJson.display.theme === 'dark') { - bgColor = '#2d2d2e'; - textColor = '#eaeaea'; - btnBg = '#353535'; - leftTd = '#353535'; - btColor = '#ffffff'; - } else { - bgColor = '#ffffff'; - textColor = '#000000'; - leftTd = '#f4f4f4'; - btnBg = '#a5a6a6'; - btColor = '#ffffff'; - } + if (customSwPath) { + swPath = customSwPath; + } - var titleText = targetingMsgJson.msgContent.title; - var descriptionText = targetingMsgJson.msgContent.description; - var imageTd = ''; + notificationHandler = new NotificationHandler({ + logger: logger, + session: {}, + request: request, + account: account + }); + var _$ct$pushConfig = $ct.pushConfig, + showBox = _$ct$pushConfig.showBox, + boxType = _$ct$pushConfig.boxType, + showBellIcon = _$ct$pushConfig.showBellIcon, + isPreview = _$ct$pushConfig.isPreview; - if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { - imageTd = ""; - } + if (isPreview) { + if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig); + if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig); + } else { + if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig); + if (showBellIcon) createBellIcon($ct.pushConfig); + } + }; - var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; - var title = "
" + "×" + "
" + "" + // ""+ - '' + imageTd + "
" + "
" + titleText + '
'; - var body = "
" + descriptionText + '
'; - html = css + title + body; - } + var createElementWithAttributes = function createElementWithAttributes(tag) { + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var element = document.createElement(tag); + Object.entries(attributes).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; - iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;'); - msgDiv.appendChild(iframe); // Dispatch event for popup box/banner close + element[key] = value; + }); + return element; + }; + + var createNotificationBox = function createNotificationBox(configData) { + if (document.getElementById('pnWrapper')) return; + var _configData$boxConfig = configData.boxConfig, + content = _configData$boxConfig.content, + style = _configData$boxConfig.style; // Create the wrapper div + + var wrapper = createElementWithAttributes('div', { + id: 'pnWrapper' + }); + var overlayDiv = createElementWithAttributes('div', { + id: 'pnOverlay' + }); + var pnCard = createElementWithAttributes('div', { + id: 'pnCard' + }); + var iconTitleDescWrapper = createElementWithAttributes('div', { + id: 'iconTitleDescWrapper' + }); + var iconContainer = createElementWithAttributes('img', { + id: 'iconContainer', + src: content.icon.type === 'default' ? "data:image/svg+xml;base64,".concat(PROMPT_BELL_BASE64) : content.icon.url + }); + iconTitleDescWrapper.appendChild(iconContainer); + var titleDescWrapper = createElementWithAttributes('div', { + id: 'titleDescWrapper' + }); + titleDescWrapper.appendChild(createElementWithAttributes('div', { + id: 'title', + textContent: content.title + })); + titleDescWrapper.appendChild(createElementWithAttributes('div', { + id: 'description', + textContent: content.description + })); + iconTitleDescWrapper.appendChild(titleDescWrapper); + var buttonsContainer = createElementWithAttributes('div', { + id: 'buttonsContainer' + }); + var primaryButton = createElementWithAttributes('button', { + id: 'primaryButton', + textContent: content.buttons.primaryButtonText + }); + var secondaryButton = createElementWithAttributes('button', { + id: 'secondaryButton', + textContent: content.buttons.secondaryButtonText + }); + buttonsContainer.appendChild(secondaryButton); + buttonsContainer.appendChild(primaryButton); + pnCard.appendChild(iconTitleDescWrapper); + pnCard.appendChild(buttonsContainer); // Apply styles + + var styleElement = createElementWithAttributes('style', { + textContent: getBoxPromptStyles(style) + }); + wrapper.appendChild(styleElement); + wrapper.appendChild(pnCard); + wrapper.appendChild(overlayDiv); + setElementPosition(pnCard, style.card.position); + var now = new Date().getTime() / 1000; + var lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time'); + var popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60; - var closeCampaign = new Event('CT_campaign_rendered'); - document.dispatchEvent(closeCampaign); + if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) { + document.body.appendChild(wrapper); - if (displayObj['custom-editor']) { - html = appendScriptForCustomEvent(targetingMsgJson, html); + if (!configData.isPreview) { + addEventListeners(wrapper); } + } + }; + var createBellIcon = function createBellIcon(configData) { + if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return; + var _configData$bellIconC = configData.bellIconConfig, + content = _configData$bellIconC.content, + style = _configData$bellIconC.style; + var bellWrapper = createElementWithAttributes('div', { + id: 'bell_wrapper' + }); + var bellIcon = createElementWithAttributes('img', { + id: 'bell_icon', + src: content.icon.type === 'default' ? "data:image/svg+xml;base64,".concat(BELL_BASE64) : content.icon.url + }); // For playing gif + + var gifModal = createElementWithAttributes('div', { + id: 'gif_modal', + style: 'display: none;' + }); + var gifImage = createElementWithAttributes('img', { + id: 'gif_image', + src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif' + }); + var closeModal = createElementWithAttributes('div', { + id: 'close_modal', + innerHTML: '×' + }); + gifModal.appendChild(gifImage); + gifModal.appendChild(closeModal); + bellWrapper.appendChild(bellIcon); + bellWrapper.appendChild(gifModal); + + if (content.hoverText.enabled) { + var tooltip = createElementWithAttributes('div', { + id: 'bell_tooltip', + textContent: content.hoverText.text + }); + bellWrapper.appendChild(tooltip); + } - iframe.srcdoc = html; + setElementPosition(bellWrapper, style.card.position); // Apply styles - var adjustIFrameHeight = function adjustIFrameHeight() { - // adjust iframe and body height of html inside correctly - contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight; + var styleElement = createElementWithAttributes('style', { + textContent: getBellIconStyles(style) + }); + document.head.appendChild(styleElement); + document.body.appendChild(bellWrapper); - if (displayObj['custom-editor'] !== true && !isBanner) { - contentHeight += 25; - } + if (!configData.isPreview) { + addBellEventListeners(bellWrapper); + } - document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'; - document.getElementById('wiz-iframe').style.height = contentHeight + 'px'; - }; + return bellWrapper; + }; + var setServerKey = function setServerKey(serverKey) { + appServerKey = serverKey; + }; + var addEventListeners = function addEventListeners(wrapper) { + var primaryButton = wrapper.querySelector('#primaryButton'); + var secondaryButton = wrapper.querySelector('#secondaryButton'); - var ua = navigator.userAgent.toLowerCase(); + var removeWrapper = function removeWrapper() { + var _wrapper$parentNode; - if (ua.indexOf('safari') !== -1) { - if (ua.indexOf('chrome') > -1) { - iframe.onload = function () { - adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); - setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); - }; - } else { - var inDoc = iframe.contentDocument || iframe.contentWindow; - if (inDoc.document) inDoc = inDoc.document; // safari iphone 7+ needs this. + return (_wrapper$parentNode = wrapper.parentNode) === null || _wrapper$parentNode === void 0 ? void 0 : _wrapper$parentNode.removeChild(wrapper); + }; - var _timer = setInterval(function () { - if (inDoc.readyState === 'complete') { - clearInterval(_timer); // adjust iframe and body height of html inside correctly + primaryButton.addEventListener('click', function () { + removeWrapper(); + notificationHandler.setApplicationServerKey(appServerKey); + notificationHandler.setUpWebPushNotifications(null, swPath, null, null); + }); + secondaryButton.addEventListener('click', function () { + StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000); + removeWrapper(); + }); + }; + var addBellEventListeners = function addBellEventListeners(bellWrapper) { + var bellIcon = bellWrapper.querySelector('#bell_icon'); + bellIcon.addEventListener('click', function () { + if (Notification.permission === 'denied') { + toggleGifModal(bellWrapper); + } else { + notificationHandler.setApplicationServerKey(appServerKey); + notificationHandler.setUpWebPushNotifications(null, swPath, null, null); - adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); - setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); - } - }, 300); + if (Notification.permission === 'granted') { + bellWrapper.remove(); } - } else { - iframe.onload = function () { - // adjust iframe and body height of html inside correctly - adjustIFrameHeight(); - var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); - setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); - }; + } + }); + bellIcon.addEventListener('mouseenter', function () { + return displayTooltip(bellWrapper); + }); + bellIcon.addEventListener('mouseleave', function () { + return clearTooltip(bellWrapper); + }); + bellWrapper.querySelector('#close_modal').addEventListener('click', function () { + return toggleGifModal(bellWrapper); + }); + }; + var setElementPosition = function setElementPosition(element, position) { + Object.assign(element.style, { + inset: 'auto', + transform: 'none' + }); + var positions = { + 'Top Right': { + inset: '16px 16px auto auto' + }, + 'Top Left': { + inset: '16px auto auto 16px' + }, + 'Bottom Right': { + inset: 'auto 16px 16px auto' + }, + 'Bottom Left': { + inset: 'auto auto 16px 16px' + }, + Center: { + inset: '50%', + transform: 'translate(-50%, -50%)' + }, + Top: { + inset: '16px auto auto 50%', + transform: 'translateX(-50%)' + }, + Bottom: { + inset: 'auto auto 16px 50%', + transform: 'translateX(-50%)' } }; + Object.assign(element.style, positions[position] || positions['top-right']); + }; - var appendScriptForCustomEvent = function appendScriptForCustomEvent(targetingMsgJson, html) { - var script = "\n "); - return html.replace(/(<\s*\/\s*body)/, "".concat(script, "\n$1")); - }; + var displayTooltip = function displayTooltip(bellWrapper) { + var gifModal = bellWrapper.querySelector('#gif_modal'); - var _callBackCalled = false; + if (gifModal.style.display === 'flex') { + return; + } - var showFooterNotification = function showFooterNotification(targetingMsgJson) { - var onClick = targetingMsgJson.display.onClick; // TODO: Needs wizrocket as a global variable + var tooltip = bellWrapper.querySelector('#bell_tooltip'); - if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { - var notificationCallback = window.clevertap.notificationCallback; + if (tooltip) { + tooltip.style.display = 'flex'; + } - if (!_callBackCalled) { - var inaObj = {}; - inaObj.msgContent = targetingMsgJson.msgContent; - inaObj.msgId = targetingMsgJson.wzrk_id; + var bellIcon = bellWrapper.querySelector('#bell_icon'); + var bellRect = bellIcon.getBoundingClientRect(); + var midX = window.innerWidth / 2; + var midY = window.innerHeight / 2; + bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'; + bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'; + }; - if (targetingMsgJson.wzrk_pivot) { - inaObj.pivotId = targetingMsgJson.wzrk_pivot; - } + var clearTooltip = function clearTooltip(bellWrapper) { + var tooltip = bellWrapper.querySelector('#bell_tooltip'); - if (targetingMsgJson.display.kv != null) { - inaObj.kv = targetingMsgJson.display.kv; - } + if (tooltip) { + tooltip.style.display = 'none'; + } + }; - window.clevertap.raiseNotificationClicked = function () { - if (onClick !== '' && onClick != null) { - var jsFunc = targetingMsgJson.display.jsFunc; - onClick += getCookieParams(); // invoke js function call + var toggleGifModal = function toggleGifModal(bellWrapper) { + clearTooltip(bellWrapper); + var gifModal = bellWrapper.querySelector('#gif_modal'); + gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'; + }; - if (jsFunc != null) { - // track notification clicked event - RequestDispatcher.fireRequest(onClick); - invokeExternalJs(jsFunc, targetingMsgJson); - return; - } // pass on the gcookie|page|scookieId for capturing the click event + var _tr = function _tr(msg, _ref) { + var device = _ref.device, + session = _ref.session, + request = _ref.request, + logger = _ref.logger; + var _device = device; + var _session = session; + var _request = request; + var _logger = logger; + var _wizCounter = 0; // Campaign House keeping + var doCampHouseKeeping = function doCampHouseKeeping(targetingMsgJson) { + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var today = getToday(); - if (targetingMsgJson.display.window === 1) { - window.open(onClick, '_blank'); - } else { - window.location = onClick; - } - } - }; + var incrCount = function incrCount(obj, campaignId, excludeFromFreqCaps) { + var currentCount = 0; + var totalCount = 0; - window.clevertap.raiseNotificationViewed = function () { - incrementImpression(targetingMsgJson); - }; + if (obj[campaignId] != null) { + currentCount = obj[campaignId]; + } - notificationCallback(inaObj); - _callBackCalled = true; + currentCount++; + + if (obj.tc != null) { + totalCount = obj.tc; + } // if exclude from caps then dont add to total counts + + + if (excludeFromFreqCaps < 0) { + totalCount++; } - } else { - window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id; - renderFooterNotification(targetingMsgJson); - if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { - var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; - var _inaObj = {}; - _inaObj.msgContent = targetingMsgJson.msgContent; - _inaObj.msgId = targetingMsgJson.wzrk_id; + obj.tc = totalCount; + obj[campaignId] = currentCount; + }; - if (targetingMsgJson.wzrk_pivot) { - _inaObj.pivotId = targetingMsgJson.wzrk_pivot; - } + if (StorageManager._isLocalStorageSupported()) { + delete sessionStorage[CAMP_COOKIE_NAME]; + var campTypeObj = {}; + var campObj = getCampaignObject(); - var msgCTkv = []; + if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) { + campTypeObj = campObj.wi; + } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) { + campTypeObj = campObj.wp; + } else { + campTypeObj = {}; + } - for (var wzrkPrefixKey in targetingMsgJson) { - // ADD WZRK PREFIX KEY VALUE PAIRS - if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { - var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); + if (campObj.hasOwnProperty('global')) { + campTypeObj.wp = campObj; + } // global session limit. default is 1 - msgCTkv.push(wzrkJson); - } - } - if (msgCTkv.length > 0) { - _inaObj.msgCTkv = msgCTkv; - } + if (targetingMsgJson[DISPLAY].wmc == null) { + targetingMsgJson[DISPLAY].wmc = 1; + } // global session limit for web inbox. default is 1 - if (targetingMsgJson.display.kv != null) { - _inaObj.kv = targetingMsgJson.display.kv; - } // PUBLIC API TO RECORD CLICKED EVENT + if (targetingMsgJson[DISPLAY].wimc == null) { + targetingMsgJson[DISPLAY].wimc = 1; + } - window.clevertap.raisePopupNotificationClicked = function (notificationData) { - if (!notificationData || !notificationData.msgId) { - return; - } + var excludeFromFreqCaps = -1; // efc - Exclude from frequency caps - var eventData = {}; - eventData.type = 'event'; - eventData.evtName = NOTIFICATION_CLICKED; - eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); + var campaignSessionLimit = -1; // mdc - Once per session - if (targetingMsgJson.wzrk_pivot) { - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { - wzrk_pivot: notificationData.pivotId - }); - } // WZRK PREFIX KEY VALUE PAIRS + var campaignDailyLimit = -1; // tdc - Once per day + var campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign - if (notificationData.msgCTkv) { - var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), - _step; + var totalDailyLimit = -1; + var totalSessionLimit = -1; // wmc - Web Popup Global Session Limit - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var wzrkPrefixObj = _step.value; - eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } + var totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit - _request.processEvent(eventData); - }; + if (targetingMsgJson[DISPLAY].efc != null) { + // exclude from frequency cap + excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10); + } - popupCallback(_inaObj); + if (targetingMsgJson[DISPLAY].mdc != null) { + // Campaign Session Limit + campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10); } - } - }; - var exitintentObj; + if (targetingMsgJson[DISPLAY].tdc != null) { + // No of web popups in a day per campaign + campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10); + } - var showExitIntent = function showExitIntent(event, targetObj) { - var targetingMsgJson; + if (targetingMsgJson[DISPLAY].tlc != null) { + // Total lifetime count + campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10); + } - if (event != null && event.clientY > 0) { - return; - } + if (targetingMsgJson[DISPLAY].wmp != null) { + // No of campaigns per day + totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10); + } - if (targetObj == null) { - targetingMsgJson = exitintentObj; - } else { - targetingMsgJson = targetObj; - } + if (targetingMsgJson[DISPLAY].wmc != null) { + // No of campaigns per session + totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10); + } - if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) { - var element = document.getElementById('intentPreview'); - element.remove(); - document.getElementById('intentOpacityDiv').remove(); - } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist + if (targetingMsgJson[DISPLAY].wimc != null) { + // No of inbox campaigns per session + totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10); + } // session level capping - if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) { - return; - } // dont show exit intent on tablet/mobile - only on desktop + var sessionObj = campTypeObj[_session.sessionId]; + if (sessionObj) { + var campaignSessionCount = sessionObj[campaignId]; + var totalSessionCount = sessionObj.tc; // dnd - if (targetingMsgJson.display.layout == null && (/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent) || /iPad/i.test(navigator.userAgent) || 'ontouchstart' in window || /tablet/i.test(navigator.userAgent))) { - return; - } + if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) { + return false; + } - if (doCampHouseKeeping(targetingMsgJson) === false) { - return; - } + if (targetingMsgJson[DISPLAY].wtarget_type === 3) { + // Inbox session + if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) { + return false; + } + } else { + // session + if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) { + return false; + } + } // campaign session - var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - $ct.campaignDivMap[campaignId] = 'intentPreview'; - var legacy = false; - var opacityDiv = document.createElement('div'); - opacityDiv.id = 'intentOpacityDiv'; - var opacity = targetingMsgJson.display.opacity || 0.7; - var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); - opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); - document.body.appendChild(opacityDiv); - var msgDiv = document.createElement('div'); - msgDiv.id = 'intentPreview'; - if (targetingMsgJson.display.proto == null) { - legacy = true; - msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;'); - } else { - msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle); - } + if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) { + return false; + } + } else { + sessionObj = {}; + campTypeObj[_session.sessionId] = sessionObj; + } // daily level capping - document.body.appendChild(msgDiv); - var iframe = document.createElement('iframe'); - var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; - iframe.frameborder = '0px'; - iframe.marginheight = '0px'; - iframe.marginwidth = '0px'; - iframe.scrolling = 'no'; - iframe.id = 'wiz-iframe-intent'; - var onClick = targetingMsgJson.display.onClick; - var pointerCss = ''; - if (onClick !== '' && onClick != null) { - pointerCss = 'cursor:pointer;'; - } + var dailyObj = campTypeObj[today]; - if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) { - iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; - } + if (dailyObj != null) { + var campaignDailyCount = dailyObj[campaignId]; + var totalDailyCount = dailyObj.tc; // daily - var html; // direct html + if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) { + return false; + } // campaign daily - if (targetingMsgJson.msgContent.type === 1) { - html = targetingMsgJson.msgContent.html; - html = html.replace(/##campaignId##/g, campaignId); - html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); - } else { - var css = '' + ''; - var bgColor, textColor, btnBg, btColor; - if (targetingMsgJson.display.theme === 'dark') { - bgColor = '#2d2d2e'; - textColor = '#eaeaea'; - btnBg = '#353535'; - btColor = '#ffffff'; + if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) { + return false; + } } else { - bgColor = '#ffffff'; - textColor = '#000000'; - btnBg = '#a5a6a6'; - btColor = '#ffffff'; + dailyObj = {}; + campTypeObj[today] = dailyObj; } - var titleText = targetingMsgJson.msgContent.title; - var descriptionText = targetingMsgJson.msgContent.description; - var ctaText = ''; - - if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { - ctaText = "'; - } + var globalObj = campTypeObj[GLOBAL]; - var imageTd = ''; + if (globalObj != null) { + var campaignTotalCount = globalObj[campaignId]; // campaign total - if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { - imageTd = "
 + titleText + ' /></div>';
+          if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {
+            return false;
+          }
+        } else {
+          globalObj = {};
+          campTypeObj[GLOBAL] = globalObj;
         }
+      } // delay
 
-        var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; - var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; - html = css + title + body; - } - - iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); - msgDiv.appendChild(iframe); // Dispatch event for interstitial/exit intent close - - var closeCampaign = new Event('CT_campaign_rendered'); - document.dispatchEvent(closeCampaign); - - if (targetingMsgJson.display['custom-editor']) { - html = appendScriptForCustomEvent(targetingMsgJson, html); - } - - iframe.srcdoc = html; - iframe.onload = function () { - var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); - setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); - }; - }; + var displayObj = targetingMsgJson.display; - if (!document.body) { - if (_wizCounter < 6) { - _wizCounter++; - setTimeout(_tr, 1000, msg, { + if (displayObj.delay != null && displayObj.delay > 0) { + var delay = displayObj.delay; + displayObj.delay = 0; + setTimeout(_tr, delay * 1000, msg, { device: _device, session: _session, request: _request, logger: _logger }); + return false; } - return; - } + incrCount(sessionObj, campaignId, excludeFromFreqCaps); + incrCount(dailyObj, campaignId, excludeFromFreqCaps); + incrCount(globalObj, campaignId, excludeFromFreqCaps); + var campKey = 'wp'; - var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { - Object.keys(arrInAppNotifs).map(function (key) { - var elementId, id; + if (targetingMsgJson[DISPLAY].wtarget_type === 3) { + campKey = 'wi'; + } // get ride of stale sessions and day entries - if (arrInAppNotifs[key].display.divId) { - elementId = arrInAppNotifs[key].display.divId; - id = document.getElementById(elementId); - } else { - elementId = arrInAppNotifs[key].display.divSelector; - id = document.querySelector(elementId); - } - if (id !== null) { - arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key]); - delete arrInAppNotifs[key]; - } - }); + var newCampObj = {}; + newCampObj[_session.sessionId] = sessionObj; + newCampObj[today] = dailyObj; + newCampObj[GLOBAL] = globalObj; + saveCampaignObject(_defineProperty({}, campKey, newCampObj)); }; - var addLoadListener = function addLoadListener(arrInAppNotifs) { - window.addEventListener('load', function () { - var count = 0; + var setupClickUrl = function setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { + incrementImpression(targetingMsgJson, _request); + setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session); + }; - if (count < 20) { - var t = setInterval(function () { - processNativeDisplayArr(arrInAppNotifs); + var handleImageOnlyPopup = function handleImageOnlyPopup(targetingMsgJson) { + var divId = 'wzrkImageOnlyDiv'; - if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { - clearInterval(t); - arrInAppNotifs = {}; - } + if (doCampHouseKeeping(targetingMsgJson) === false) { + return; + } - count++; - }, 500); - } - }); - }; + if ($ct.dismissSpamControl && document.getElementById(divId) != null) { + var element = document.getElementById(divId); + element.remove(); + } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist - if (msg.inapp_notifs != null) { - var arrInAppNotifs = {}; - for (var index = 0; index < msg.inapp_notifs.length; index++) { - var targetNotif = msg.inapp_notifs[index]; + if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) { + return; + } - if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { - showFooterNotification(targetNotif); - } else if (targetNotif.display.wtarget_type === 1) { - // if display['wtarget_type']==1 then exit intent - exitintentObj = targetNotif; - window.document.body.onmouseleave = showExitIntent; - } else if (targetNotif.display.wtarget_type === 2) { - // if display['wtarget_type']==2 then web native display - if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { - // Check for banner and carousel - var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); + var msgDiv = document.createElement('div'); + msgDiv.id = divId; + document.body.appendChild(msgDiv); - if (element !== null) { - targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); - } else { - arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif; // Add targetNotif to object - } - } else if (targetNotif.msgContent.type === 4) { - renderVisualBuilder(targetNotif, false); - } else { - showFooterNotification(targetNotif); - } - } - } // Process banner or carousel campaign array + if (customElements.get('ct-web-popup-imageonly') === undefined) { + customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly); + } + return renderPopUpImageOnly(targetingMsgJson, _session); + }; - if (Object.keys(arrInAppNotifs).length) { - if (document.readyState === 'complete') { - processNativeDisplayArr(arrInAppNotifs); - } else { - addLoadListener(arrInAppNotifs); - } + var isExistingCampaign = function isExistingCampaign(campaignId) { + var testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe'); + + if (testIframe) { + var iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document; + return iframeDocument.documentElement.innerHTML.includes(campaignId); } - } - var mergeEventMap = function mergeEventMap(newEvtMap) { - if ($ct.globalEventsMap == null) { - $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); + return false; + }; - if ($ct.globalEventsMap == null) { - $ct.globalEventsMap = newEvtMap; - return; - } - } + var createTemplate = function createTemplate(targetingMsgJson, isExitIntent) { + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var displayObj = targetingMsgJson.display; - for (var key in newEvtMap) { - if (newEvtMap.hasOwnProperty(key)) { - var oldEvtObj = $ct.globalEventsMap[key]; - var newEvtObj = newEvtMap[key]; + if (displayObj.layout === 1) { + // Handling Web Exit Intent + return showExitIntent(undefined, targetingMsgJson); + } - if ($ct.globalEventsMap[key] != null) { - if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { - $ct.globalEventsMap[key] = newEvtObj; - } - } else { - $ct.globalEventsMap[key] = newEvtObj; - } - } + if (displayObj.layout === 3) { + // Handling Web Popup Image Only + handleImageOnlyPopup(targetingMsgJson); + return; } - }; - var handleInboxNotifications = function handleInboxNotifications() { - if (msg.inbox_preview) { - processInboxNotifs(msg); + if (doCampHouseKeeping(targetingMsgJson) === false) { return; } - if (msg.inbox_notifs) { - var msgArr = []; + var divId = 'wizParDiv' + displayObj.layout; + var opacityDivId = 'intentOpacityDiv' + displayObj.layout; - for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { - if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { - msgArr.push(msg.inbox_notifs[_index]); - } + if ($ct.dismissSpamControl && document.getElementById(divId) != null) { + var element = document.getElementById(divId); + var opacityElement = document.getElementById(opacityDivId); + + if (element) { + element.remove(); } - processInboxNotifs(msgArr); + if (opacityElement) { + opacityElement.remove(); + } } - }; - if (msg.webInboxSetting || msg.inbox_notifs != null) { - /** - * When the user visits a website for the 1st time after web inbox channel is setup, - * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed - * as we would not have any entry related to webInboxSettings in the LS - */ - if (hasWebInboxSettingsInLS()) { - checkAndRegisterWebInboxElements(); + if (isExistingCampaign(campaignId)) return; + + if (document.getElementById(divId) != null) { + return; } - if ($ct.inbox === null) { - msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); - initializeWebInbox(_logger).then(function () { - handleInboxNotifications(); - }).catch(function (e) {}); - } else { - handleInboxNotifications(); + $ct.campaignDivMap[campaignId] = divId; + var isBanner = displayObj.layout === 2; + + if (isExitIntent) { + var opacityDiv = document.createElement('div'); + opacityDiv.id = opacityDivId; + var opacity = targetingMsgJson.display.opacity || 0.7; + var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); + document.body.appendChild(opacityDiv); } - } - if (msg.vars) { - $ct.variableStore.mergeVariables(msg.vars); - return; - } + var msgDiv = document.createElement('div'); + msgDiv.id = divId; + var viewHeight = window.innerHeight; + var viewWidth = window.innerWidth; + var legacy = false; - var staleDataUpdate = function staleDataUpdate(staledata, campType) { - var campObj = getCampaignObject(); - var globalObj = campObj[campType].global; + if (!isBanner) { + var marginBottom = viewHeight * 5 / 100; + var contentHeight = 10; + var right = viewWidth * 5 / 100; + var bottomPosition = contentHeight + marginBottom; + var width = viewWidth * 30 / 100 + 20; + var widthPerct = 'width:30%;'; // for small devices - mobile phones - if (globalObj != null && campType) { - for (var idx in staledata) { - if (staledata.hasOwnProperty(idx)) { - delete globalObj[staledata[idx]]; + if ((/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent)) && /iPad/i.test(navigator.userAgent) === false) { + width = viewWidth * 85 / 100 + 20; + right = viewWidth * 5 / 100; + bottomPosition = viewHeight * 5 / 100; + widthPerct = 'width:80%;'; // medium devices - tablets + } else if ('ontouchstart' in window || /tablet/i.test(navigator.userAgent)) { + width = viewWidth * 50 / 100 + 20; + right = viewWidth * 5 / 100; + bottomPosition = viewHeight * 5 / 100; + widthPerct = 'width:50%;'; + } // legacy footer notif - if (StorageManager.read(CAMP_COOKIE_G)) { - var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); - var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); - if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { - delete guidCampObj[guid][campType][staledata[idx]]; - StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj))); - } - } - } + if (displayObj.proto == null) { + legacy = true; + msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;'); + } else { + msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle); } + } else { + msgDiv.setAttribute('style', displayObj.iFrameStyle); } - saveCampaignObject(campObj); - }; + document.body.appendChild(msgDiv); + var iframe = document.createElement('iframe'); + var borderRadius = displayObj.br === false ? '0' : '8'; + iframe.frameborder = '0px'; + iframe.marginheight = '0px'; + iframe.marginwidth = '0px'; + iframe.scrolling = 'no'; + iframe.id = 'wiz-iframe'; + var onClick = targetingMsgJson.display.onClick; + var pointerCss = ''; - if (StorageManager._isLocalStorageSupported()) { - try { - if (msg.evpr != null) { - var eventsMap = msg.evpr.events; - var profileMap = msg.evpr.profile; - var syncExpiry = msg.evpr.expires_in; - var now = getNow(); - StorageManager.setMetaProp('lsTime', now); - StorageManager.setMetaProp('exTs', syncExpiry); - mergeEventMap(eventsMap); - StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap); + if (onClick !== '' && onClick != null) { + pointerCss = 'cursor:pointer;'; + } - if ($ct.globalProfileMap == null) { - addToLocalProfileMap(profileMap, true); - } else { - addToLocalProfileMap(profileMap, false); - } - } + if (displayObj.preview && displayObj['custom-editor']) { + iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; + } - if (msg.arp != null) { - arp(msg.arp); - } + var html; // direct html - if (msg.inapp_stale != null && msg.inapp_stale.length > 0) { - // web popup stale - staleDataUpdate(msg.inapp_stale, 'wp'); + if (targetingMsgJson.msgContent.type === 1) { + html = targetingMsgJson.msgContent.html; + html = html.replace(/##campaignId##/g, campaignId); + html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); + } else { + var css = '' + ''; + var bgColor, textColor, btnBg, leftTd, btColor; + + if (targetingMsgJson.display.theme === 'dark') { + bgColor = '#2d2d2e'; + textColor = '#eaeaea'; + btnBg = '#353535'; + leftTd = '#353535'; + btColor = '#ffffff'; + } else { + bgColor = '#ffffff'; + textColor = '#000000'; + leftTd = '#f4f4f4'; + btnBg = '#a5a6a6'; + btColor = '#ffffff'; } - if (msg.inbox_stale != null && msg.inbox_stale.length > 0) { - // web inbox stale - staleDataUpdate(msg.inbox_stale, 'wi'); + var titleText = targetingMsgJson.msgContent.title; + var descriptionText = targetingMsgJson.msgContent.description; + var imageTd = ''; + + if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { + imageTd = ""; } - } catch (e) { - _logger.error('Unable to persist evrp/arp: ' + e); + + var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; + var title = "
" + "×" + "
" + "" + // ""+ + '' + imageTd + "
" + "
" + titleText + '
'; + var body = "
" + descriptionText + '
'; + html = css + title + body; } - } - }; - var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); + iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;'); + msgDiv.appendChild(iframe); // Dispatch event for popup box/banner close - var User = /*#__PURE__*/function () { - function User(_ref) { - var isPersonalisationActive = _ref.isPersonalisationActive; + var closeCampaign = new Event('CT_campaign_rendered'); + document.dispatchEvent(closeCampaign); - _classCallCheck(this, User); + if (displayObj['custom-editor']) { + html = appendScriptForCustomEvent(targetingMsgJson, html); + } - Object.defineProperty(this, _isPersonalisationActive$2, { - writable: true, - value: void 0 - }); - _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; - } + iframe.srcdoc = html; - _createClass(User, [{ - key: "getTotalVisits", - value: function getTotalVisits() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; + var adjustIFrameHeight = function adjustIFrameHeight() { + // adjust iframe and body height of html inside correctly + contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight; + + if (displayObj['custom-editor'] !== true && !isBanner) { + contentHeight += 25; } - var visitCount = StorageManager.getMetaProp('sc'); + document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'; + document.getElementById('wiz-iframe').style.height = contentHeight + 'px'; + }; - if (visitCount == null) { - visitCount = 1; - } + var ua = navigator.userAgent.toLowerCase(); - return visitCount; - } - }, { - key: "getLastVisit", - value: function getLastVisit() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } + if (ua.indexOf('safari') !== -1) { + if (ua.indexOf('chrome') > -1) { + iframe.onload = function () { + adjustIFrameHeight(); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); + }; + } else { + var inDoc = iframe.contentDocument || iframe.contentWindow; + if (inDoc.document) inDoc = inDoc.document; // safari iphone 7+ needs this. - var prevSession = StorageManager.getMetaProp('ps'); + var _timer = setInterval(function () { + if (inDoc.readyState === 'complete') { + clearInterval(_timer); // adjust iframe and body height of html inside correctly - if (prevSession != null) { - return new Date(prevSession * 1000); + adjustIFrameHeight(); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); + } + }, 300); } + } else { + iframe.onload = function () { + // adjust iframe and body height of html inside correctly + adjustIFrameHeight(); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); + }; } - }]); - - return User; - }(); - - var logLevels = { - DISABLE: 0, - ERROR: 1, - INFO: 2, - DEBUG: 3, - DEBUG_PE: 4 - }; + }; - var _logLevel = _classPrivateFieldLooseKey("logLevel"); + var renderFooterNotification = function renderFooterNotification(targetingMsgJson) { + createTemplate(targetingMsgJson, false); + }; - var _log = _classPrivateFieldLooseKey("log"); + var _callBackCalled = false; - var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); + var showFooterNotification = function showFooterNotification(targetingMsgJson) { + var onClick = targetingMsgJson.display.onClick; + var displayObj = targetingMsgJson.display; // TODO: Needs wizrocket as a global variable - var Logger = /*#__PURE__*/function () { - function Logger(logLevel) { - _classCallCheck(this, Logger); + if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { + var notificationCallback = window.clevertap.notificationCallback; - Object.defineProperty(this, _isLegacyDebug, { - get: _get_isLegacyDebug, - set: void 0 - }); - Object.defineProperty(this, _log, { - value: _log2 - }); - Object.defineProperty(this, _logLevel, { - writable: true, - value: void 0 - }); - this.wzrkError = {}; - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel == null ? logLevel : logLevels.INFO; - this.wzrkError = {}; - } + if (!_callBackCalled) { + var inaObj = {}; + inaObj.msgContent = targetingMsgJson.msgContent; + inaObj.msgId = targetingMsgJson.wzrk_id; - _createClass(Logger, [{ - key: "error", - value: function error(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { - _classPrivateFieldLooseBase(this, _log)[_log]('error', message); - } - } - }, { - key: "info", - value: function info(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { - _classPrivateFieldLooseBase(this, _log)[_log]('log', message); - } - } - }, { - key: "debug", - value: function debug(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); - } - } - }, { - key: "debugPE", - value: function debugPE(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); - } - } - }, { - key: "reportError", - value: function reportError(code, description) { - this.wzrkError.c = code; - this.wzrkError.d = description; - this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); - } - }, { - key: "logLevel", - get: function get() { - return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; - }, - set: function set(logLevel) { - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; - } - }]); + if (targetingMsgJson.wzrk_pivot) { + inaObj.pivotId = targetingMsgJson.wzrk_pivot; + } - return Logger; - }(); + if (targetingMsgJson.display.kv != null) { + inaObj.kv = targetingMsgJson.display.kv; + } - var _log2 = function _log2(level, message) { - if (window.console) { - try { - var ts = new Date().getTime(); - console[level]("CleverTap [".concat(ts, "]: ").concat(message)); - } catch (e) {} - } - }; + window.clevertap.raiseNotificationClicked = function () { + if (onClick !== '' && onClick != null) { + var jsFunc = targetingMsgJson.display.jsFunc; + onClick += getCookieParams(_device, _session); // invoke js function call - var _get_isLegacyDebug = function _get_isLegacyDebug() { - return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; - }; + if (jsFunc != null) { + // track notification clicked event + RequestDispatcher.fireRequest(onClick); + invokeExternalJs(jsFunc, targetingMsgJson); + return; + } // pass on the gcookie|page|scookieId for capturing the click event - var _logger$5 = _classPrivateFieldLooseKey("logger"); - var _sessionId = _classPrivateFieldLooseKey("sessionId"); + if (targetingMsgJson.display.window === 1) { + window.open(onClick, '_blank'); + } else { + window.location = onClick; + } + } + }; - var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); + window.clevertap.raiseNotificationViewed = function () { + incrementImpression(targetingMsgJson); + }; - var SessionManager = /*#__PURE__*/function () { - // SCOOKIE_NAME - function SessionManager(_ref) { - var logger = _ref.logger, - isPersonalisationActive = _ref.isPersonalisationActive; + notificationCallback(inaObj); + _callBackCalled = true; + } + } else { + window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id; - _classCallCheck(this, SessionManager); + if (displayObj.deliveryTrigger) { + if (displayObj.deliveryTrigger.inactive) { + triggerByInactivity(targetingMsgJson); + } - Object.defineProperty(this, _logger$5, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _sessionId, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _isPersonalisationActive$3, { - writable: true, - value: void 0 - }); - this.cookieName = void 0; - this.scookieObj = void 0; - this.sessionId = StorageManager.getMetaProp('cs'); - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5] = logger; - _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; - } + if (displayObj.deliveryTrigger.scroll) { + triggerByScroll(targetingMsgJson); + } - _createClass(SessionManager, [{ - key: "getSessionCookieObject", - value: function getSessionCookieObject() { - var scookieStr = StorageManager.readCookie(this.cookieName); - var obj = {}; + if (displayObj.deliveryTrigger.isExitIntent) { + exitintentObj = targetingMsgJson; + window.document.body.onmouseleave = showExitIntent; + } // delay - if (scookieStr != null) { - // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera - scookieStr = scookieStr.replace(singleQuoteRegex, '"'); - obj = JSON.parse(scookieStr); - if (!isObject(obj)) { - obj = {}; - } else { - if (typeof obj.t !== 'undefined') { - // check time elapsed since last request - var lastTime = obj.t; - var now = getNow(); + var delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed; - if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { - // adding 60 seconds to compensate for in-journey requests - // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read - // hence we shouldn't use it. - obj = {}; - } - } + if (delay != null && delay > 0) { + setTimeout(function () { + renderFooterNotification(targetingMsgJson); + }, delay * 1000); } + } else { + renderFooterNotification(targetingMsgJson); } - this.scookieObj = obj; - return obj; - } - }, { - key: "setSessionCookieObject", - value: function setSessionCookieObject(obj) { - var objStr = JSON.stringify(obj); - StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); - } - }, { - key: "manageSession", - value: function manageSession(session) { - // first time. check if current session id in localstorage is same - // if not same then prev = current and current = this new session - if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { - var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { + var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; + var _inaObj = {}; + _inaObj.msgContent = targetingMsgJson.msgContent; + _inaObj.msgId = targetingMsgJson.wzrk_id; - if (typeof currentSessionInLS === 'undefined') { - StorageManager.setMetaProp('ps', session); - StorageManager.setMetaProp('cs', session); - StorageManager.setMetaProp('sc', 1); - } else if (currentSessionInLS !== session) { - // not same as session in local storage. new session - StorageManager.setMetaProp('ps', currentSessionInLS); - StorageManager.setMetaProp('cs', session); - var sessionCount = StorageManager.getMetaProp('sc'); + if (targetingMsgJson.wzrk_pivot) { + _inaObj.pivotId = targetingMsgJson.wzrk_pivot; + } - if (typeof sessionCount === 'undefined') { - sessionCount = 0; + var msgCTkv = []; + + for (var wzrkPrefixKey in targetingMsgJson) { + // ADD WZRK PREFIX KEY VALUE PAIRS + if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { + var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); + + msgCTkv.push(wzrkJson); } + } - StorageManager.setMetaProp('sc', sessionCount + 1); + if (msgCTkv.length > 0) { + _inaObj.msgCTkv = msgCTkv; } - this.sessionId = session; + if (targetingMsgJson.display.kv != null) { + _inaObj.kv = targetingMsgJson.display.kv; + } // PUBLIC API TO RECORD CLICKED EVENT + + + window.clevertap.raisePopupNotificationClicked = function (notificationData) { + if (!notificationData || !notificationData.msgId) { + return; + } + + var eventData = {}; + eventData.type = 'event'; + eventData.evtName = NOTIFICATION_CLICKED; + eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); + + if (targetingMsgJson.wzrk_pivot) { + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { + wzrk_pivot: notificationData.pivotId + }); + } // WZRK PREFIX KEY VALUE PAIRS + + + if (notificationData.msgCTkv) { + var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var wzrkPrefixObj = _step.value; + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + + _request.processEvent(eventData); + }; + + popupCallback(_inaObj); } } - }, { - key: "getTimeElapsed", - value: function getTimeElapsed() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } + }; - if (this.scookieObj != null) { - // TODO: check logic? - this.scookieObj = this.getSessionCookieObject(); - } + var triggerByInactivity = function triggerByInactivity(targetNotif) { + var IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000; // Convert to milliseconds - var sessionStart = this.scookieObj.s; + var idleTimer; + var events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']; - if (sessionStart != null) { - var ts = getNow(); - return Math.floor(ts - sessionStart); - } - } - }, { - key: "getPageCount", - value: function getPageCount() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } + var resetIdleTimer = function resetIdleTimer() { + clearTimeout(idleTimer); + idleTimer = setTimeout(function () { + renderFooterNotification(targetNotif); + removeEventListeners(); + }, IDLE_TIME_THRESHOLD); + }; - if (this.scookieObj != null) { - // TODO: check logic - this.scookieObj = this.getSessionCookieObject(); - } + var eventHandler = function eventHandler() { + resetIdleTimer(); + }; - return this.scookieObj.p; - } - }, { - key: "sessionId", - get: function get() { - return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; - }, - set: function set(sessionId) { - _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; - } - }]); + var setupEventListeners = function setupEventListeners() { + events.forEach(function (eventType) { + return window.addEventListener(eventType, eventHandler, { + passive: true + }); + }); + }; - return SessionManager; - }(); + var removeEventListeners = function removeEventListeners() { + events.forEach(function (eventType) { + return window.removeEventListener(eventType, eventHandler); + }); + }; - var seqNo = 0; - var requestTime = 0; + setupEventListeners(); + resetIdleTimer(); + return removeEventListeners; // Return a cleanup function + }; - var _logger$6 = _classPrivateFieldLooseKey("logger"); + var triggerByScroll = function triggerByScroll(targetNotif) { + var calculateScrollPercentage = function calculateScrollPercentage() { + var _document$documentEle = document.documentElement, + scrollHeight = _document$documentEle.scrollHeight, + clientHeight = _document$documentEle.clientHeight, + scrollTop = _document$documentEle.scrollTop; + return scrollTop / (scrollHeight - clientHeight) * 100; + }; - var _account$2 = _classPrivateFieldLooseKey("account"); + var scrollListener = function scrollListener() { + var scrollPercentage = calculateScrollPercentage(); - var _device$2 = _classPrivateFieldLooseKey("device"); + if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) { + renderFooterNotification(targetNotif); + window.removeEventListener('scroll', throttledScrollListener); + } + }; - var _session$2 = _classPrivateFieldLooseKey("session"); + var throttle = function throttle(func, limit) { + var inThrottle = false; + return function () { + var context = this; - var _isPersonalisationActive$4 = _classPrivateFieldLooseKey("isPersonalisationActive"); + if (!inThrottle) { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - var _clearCookie = _classPrivateFieldLooseKey("clearCookie"); + func.apply(context, args); + inThrottle = true; + setTimeout(function () { + inThrottle = false; + }, limit); + } + }; + }; - var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); + var throttledScrollListener = throttle(scrollListener, 200); + window.addEventListener('scroll', throttledScrollListener, { + passive: true + }); + return function () { + return window.removeEventListener('scroll', throttledScrollListener); + }; // Return a cleanup function + }; - var RequestManager = /*#__PURE__*/function () { - function RequestManager(_ref) { - var logger = _ref.logger, - account = _ref.account, - device = _ref.device, - session = _ref.session, - isPersonalisationActive = _ref.isPersonalisationActive; + var exitintentObj; - _classCallCheck(this, RequestManager); + var showExitIntent = function showExitIntent(event, targetObj) { + if ((event === null || event === void 0 ? void 0 : event.clientY) > 0) return; + var targetingMsgJson = targetObj || exitintentObj; + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var layout = targetingMsgJson.display.layout; + if (isExistingCampaign(campaignId)) return; - Object.defineProperty(this, _addToLocalEventMap, { - value: _addToLocalEventMap2 - }); - Object.defineProperty(this, _logger$6, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _account$2, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _device$2, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _session$2, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _isPersonalisationActive$4, { - writable: true, - value: void 0 - }); - Object.defineProperty(this, _clearCookie, { - writable: true, - value: false - }); - this.processingBackup = false; - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6] = logger; - _classPrivateFieldLooseBase(this, _account$2)[_account$2] = account; - _classPrivateFieldLooseBase(this, _device$2)[_device$2] = device; - _classPrivateFieldLooseBase(this, _session$2)[_session$2] = session; - _classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4] = isPersonalisationActive; - RequestDispatcher.logger = logger; - RequestDispatcher.device = device; - RequestDispatcher.account = account; - } + if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) { + createTemplate(targetingMsgJson, true); + return; + } - _createClass(RequestManager, [{ - key: "processBackupEvents", - value: function processBackupEvents() { - var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); + if (doCampHouseKeeping(targetingMsgJson) === false) { + return; + } - if (typeof backupMap === 'undefined' || backupMap === null) { - return; + if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) { + var intentPreview = document.getElementById('intentPreview'); + var intentOpacityDiv = document.getElementById('intentOpacityDiv'); + + if (intentPreview && intentOpacityDiv) { + intentPreview.remove(); + intentOpacityDiv.remove(); } + } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist` - this.processingBackup = true; - for (var idx in backupMap) { - if (backupMap.hasOwnProperty(idx)) { - var backupEvent = backupMap[idx]; + if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) { + return; + } // dont show exit intent on tablet/mobile - only on desktop - if (typeof backupEvent.fired === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('Processing backup event : ' + backupEvent.q); - if (typeof backupEvent.q !== 'undefined') { - RequestDispatcher.fireRequest(backupEvent.q); - } + if (targetingMsgJson.display.layout == null && (/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent) || /iPad/i.test(navigator.userAgent) || 'ontouchstart' in window || /tablet/i.test(navigator.userAgent))) { + return; + } - backupEvent.fired = true; - } - } - } + $ct.campaignDivMap[campaignId] = 'intentPreview'; + var legacy = false; + var opacityDiv = document.createElement('div'); + opacityDiv.id = 'intentOpacityDiv'; + var opacity = targetingMsgJson.display.opacity || 0.7; + var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); + document.body.appendChild(opacityDiv); + var msgDiv = document.createElement('div'); + msgDiv.id = 'intentPreview'; - StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); - this.processingBackup = false; + if (targetingMsgJson.display.proto == null) { + legacy = true; + msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;'); + } else { + msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle); } - }, { - key: "addSystemDataToObject", - value: function addSystemDataToObject(dataObject, ignoreTrim) { - // ignore trim for chrome notifications; undefined everywhere else - if (typeof ignoreTrim === 'undefined') { - dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + + document.body.appendChild(msgDiv); + var iframe = document.createElement('iframe'); + var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; + iframe.frameborder = '0px'; + iframe.marginheight = '0px'; + iframe.marginwidth = '0px'; + iframe.scrolling = 'no'; + iframe.id = 'wiz-iframe-intent'; + var onClick = targetingMsgJson.display.onClick; + var pointerCss = ''; + + if (onClick !== '' && onClick != null) { + pointerCss = 'cursor:pointer;'; + } + + if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) { + iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; + } + + var html; // direct html + + if (targetingMsgJson.msgContent.type === 1) { + html = targetingMsgJson.msgContent.html; + html = html.replace(/##campaignId##/g, campaignId); + html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); + } else { + var css = '' + ''; + var bgColor, textColor, btnBg, btColor; + + if (targetingMsgJson.display.theme === 'dark') { + bgColor = '#2d2d2e'; + textColor = '#eaeaea'; + btnBg = '#353535'; + btColor = '#ffffff'; + } else { + bgColor = '#ffffff'; + textColor = '#000000'; + btnBg = '#a5a6a6'; + btColor = '#ffffff'; } - if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError)) { - dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError; - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].wzrkError = {}; + var titleText = targetingMsgJson.msgContent.title; + var descriptionText = targetingMsgJson.msgContent.description; + var ctaText = ''; + + if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { + ctaText = "'; } - dataObject.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + var imageTd = ''; - if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { - dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { + imageTd = "
 + titleText + ' /></div>';
         }
 
-        var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject();
+        var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; + var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; + html = css + title + body; + } - dataObject.s = obj.s; // session cookie + iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); + msgDiv.appendChild(iframe); // Dispatch event for interstitial/exit intent close - dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + var closeCampaign = new Event('CT_campaign_rendered'); + document.dispatchEvent(closeCampaign); - var proto = document.location.protocol; - proto = proto.replace(':', ''); - dataObject.af = _objectSpread2(_objectSpread2({}, dataObject.af), {}, { - lib: 'web-sdk-v1.9.6', - protocol: proto - }, $ct.flutterVersion); // app fields + if (targetingMsgJson.display['custom-editor']) { + html = appendScriptForCustomEvent(targetingMsgJson, html); + } + + iframe.srcdoc = html; + + iframe.onload = function () { + var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); + setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); + }; + }; + + if (!document.body) { + if (_wizCounter < 6) { + _wizCounter++; + setTimeout(_tr, 1000, msg, { + device: _device, + session: _session, + request: _request, + logger: _logger + }); + } - if (sessionStorage.hasOwnProperty('WZRK_D')) { - dataObject.debug = true; - } + return; + } - return dataObject; - } - }, { - key: "addFlags", - value: function addFlags(data) { - // check if cookie should be cleared. - _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); + var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { + Object.keys(arrInAppNotifs).map(function (key) { + var elementId, id; - if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { - data.rc = true; + if (arrInAppNotifs[key].display.divId) { + elementId = arrInAppNotifs[key].display.divId; + id = document.getElementById(elementId); + } else { + elementId = arrInAppNotifs[key].display.divSelector; + id = document.querySelector(elementId); + } - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug('reset cookie sent in request and cleared from meta for future requests.'); + if (id !== null) { + arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key]); + delete arrInAppNotifs[key]; } + }); + }; - if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { - var lastSyncTime = StorageManager.getMetaProp('lsTime'); - var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server + var addLoadListener = function addLoadListener(arrInAppNotifs) { + window.addEventListener('load', function () { + var count = 0; - if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { - data.dsync = true; - return; - } + if (count < 20) { + var t = setInterval(function () { + processNativeDisplayArr(arrInAppNotifs); - var now = getNow(); // last sync time has expired - get fresh data from server + if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { + clearInterval(t); + arrInAppNotifs = {}; + } - if (lastSyncTime + expirySeconds < now) { - data.dsync = true; - } + count++; + }, 500); } - } // saves url to backup cache and fires the request + }); + }; - /** - * - * @param {string} url - * @param {boolean} override whether the request can go through or not - * @param {Boolean} sendOULFlag - true in case of a On User Login request - */ + if (msg.inapp_notifs != null) { + var arrInAppNotifs = {}; - }, { - key: "saveAndFireRequest", - value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { - var now = getNow(); - url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); - var data = url + '&i=' + now + '&sn=' + seqNo; - StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); // if offline is set to true, save the request in backup and return + for (var index = 0; index < msg.inapp_notifs.length; index++) { + var targetNotif = msg.inapp_notifs[index]; - if ($ct.offline) return; // if there is no override - // and an OUL request is not in progress - // then process the request as it is - // else block the request - // note - $ct.blockRequest should ideally be used for override + if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { + showFooterNotification(targetNotif); + } else if (targetNotif.display.wtarget_type === 1) { + // if display['wtarget_type']==1 then exit intent + exitintentObj = targetNotif; + window.document.body.onmouseleave = showExitIntent; + } else if (targetNotif.display.wtarget_type === 2) { + // if display['wtarget_type']==2 then web native display + if (targetNotif.msgContent.type === 1) { + handleKVpairCampaign(targetNotif); + } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { + // Check for banner and carousel + var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); - if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { - if (now === requestTime) { - seqNo++; + if (element !== null) { + targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); + } else { + arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif; // Add targetNotif to object + } + } else if (targetNotif.msgContent.type === 4) { + renderVisualBuilder(targetNotif, false); } else { - requestTime = now; - seqNo = 0; + showFooterNotification(targetNotif); } + } + } // Process banner or carousel campaign array - window.oulReqN = $ct.globalCache.REQ_N; - RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + + if (Object.keys(arrInAppNotifs).length) { + if (document.readyState === 'complete') { + processNativeDisplayArr(arrInAppNotifs); } else { - _classPrivateFieldLooseBase(this, _logger$6)[_logger$6].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); + addLoadListener(arrInAppNotifs); } } - }, { - key: "unregisterTokenForGuid", - value: function unregisterTokenForGuid(givenGUID) { - var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available + } - if (payload) { - var data = {}; - data.type = 'data'; + var handleInboxNotifications = function handleInboxNotifications() { + if (msg.inbox_preview) { + processInboxNotifs(msg); + return; + } - if (isValueValid(givenGUID)) { - data.g = givenGUID; + if (msg.inbox_notifs) { + var msgArr = []; + + for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { + if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { + msgArr.push(msg.inbox_notifs[_index]); } + } - data.action = 'unregister'; - data.id = _classPrivateFieldLooseBase(this, _account$2)[_account$2].id; + processInboxNotifs(msgArr); + } + }; - var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + if (msg.webInboxSetting || msg.inbox_notifs != null) { + /** + * When the user visits a website for the 1st time after web inbox channel is setup, + * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed + * as we would not have any entry related to webInboxSettings in the LS + */ + if (hasWebInboxSettingsInLS()) { + checkAndRegisterWebInboxElements(); + } - data.s = obj.s; // session cookie + if ($ct.inbox === null) { + msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); + initializeWebInbox(_logger).then(function () { + handleInboxNotifications(); + }).catch(function (e) {}); + } else { + handleInboxNotifications(); + } + } - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + if (msg.webPushConfig) { + processWebPushConfig(msg.webPushConfig, logger, request); + } - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + if (msg.vars) { + $ct.variableStore.mergeVariables(msg.vars); + return; + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - RequestDispatcher.fireRequest(pageLoadUrl, true); - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); - } // REGISTER TOKEN + if (StorageManager._isLocalStorageSupported()) { + try { + if (msg.evpr != null) { + var eventsMap = msg.evpr.events; + var profileMap = msg.evpr.profile; + var syncExpiry = msg.evpr.expires_in; + var now = getNow(); + StorageManager.setMetaProp('lsTime', now); + StorageManager.setMetaProp('exTs', syncExpiry); + mergeEventMap(eventsMap); + StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap); + if ($ct.globalProfileMap == null) { + addToLocalProfileMap(profileMap, true); + } else { + addToLocalProfileMap(profileMap, false); + } + } - this.registerToken(payload); - } - }, { - key: "registerToken", - value: function registerToken(payload) { - if (!payload) return; // add gcookie etc to the payload + if (msg.arp != null) { + arp(msg.arp); + } - payload = this.addSystemDataToObject(payload, true); - payload = JSON.stringify(payload); + if (msg.inapp_stale != null && msg.inapp_stale.length > 0) { + // web popup stale + staleDataUpdate(msg.inapp_stale, 'wp'); + } - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + if (msg.inbox_stale != null && msg.inbox_stale.length > 0) { + // web inbox stale + staleDataUpdate(msg.inbox_stale, 'wi'); + } + } catch (e) { + _logger.error('Unable to persist evrp/arp: ' + e); + } + } + }; - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$6)[_logger$6])); - RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage + var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); - StorageManager.save(WEBPUSH_LS_KEY, 'ok'); - } - }, { - key: "processEvent", - value: function processEvent(data) { - _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + var User = /*#__PURE__*/function () { + function User(_ref) { + var isPersonalisationActive = _ref.isPersonalisationActive; - data = this.addSystemDataToObject(data, undefined); - this.addFlags(data); - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$6)[_logger$6]); + _classCallCheck(this, User); - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$2)[_account$2].dataPostURL; + Object.defineProperty(this, _isPersonalisationActive$2, { + writable: true, + value: void 0 + }); + _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); - } - }, { - key: "post", - value: function post(url, body) { - var _this = this; + _createClass(User, [{ + key: "getTotalVisits", + value: function getTotalVisits() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - return fetch(url, { - method: 'post', - headers: { - 'Content-Type': 'application/json' - }, - body: body - }).then(function (response) { - if (response.ok) { - return response.json(); - } + var visitCount = StorageManager.getMetaProp('sc'); - throw response; - }).then(function (data) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Sync data successful', data); + if (visitCount == null) { + visitCount = 1; + } - return data; - }).catch(function (e) { - _classPrivateFieldLooseBase(_this, _logger$6)[_logger$6].debug('Error in syncing variables', e); + return visitCount; + } + }, { + key: "getLastVisit", + value: function getLastVisit() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - throw e; - }); + var prevSession = StorageManager.getMetaProp('ps'); + + if (prevSession != null) { + return new Date(prevSession * 1000); + } } }]); - return RequestManager; + return User; }(); - var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { - if (StorageManager._isLocalStorageSupported()) { - if (typeof $ct.globalEventsMap === 'undefined') { - $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); + var logLevels = { + DISABLE: 0, + ERROR: 1, + INFO: 2, + DEBUG: 3, + DEBUG_PE: 4 + }; - if (typeof $ct.globalEventsMap === 'undefined') { - $ct.globalEventsMap = {}; - } - } + var _logLevel = _classPrivateFieldLooseKey("logLevel"); - var nowTs = getNow(); - var evtDetail = $ct.globalEventsMap[evtName]; + var _log = _classPrivateFieldLooseKey("log"); - if (typeof evtDetail !== 'undefined') { - evtDetail[2] = nowTs; - evtDetail[0]++; - } else { - evtDetail = []; - evtDetail.push(1); - evtDetail.push(nowTs); - evtDetail.push(nowTs); - } + var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); - $ct.globalEventsMap[evtName] = evtDetail; - StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap); - } - }; + var Logger = /*#__PURE__*/function () { + function Logger(logLevel) { + _classCallCheck(this, Logger); - var _request$4 = _classPrivateFieldLooseKey("request"); + Object.defineProperty(this, _isLegacyDebug, { + get: _get_isLegacyDebug, + set: void 0 + }); + Object.defineProperty(this, _log, { + value: _log2 + }); + Object.defineProperty(this, _logLevel, { + writable: true, + value: void 0 + }); + this.wzrkError = {}; + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel == null ? logLevel : logLevels.INFO; + this.wzrkError = {}; + } - var _account$3 = _classPrivateFieldLooseKey("account"); + _createClass(Logger, [{ + key: "error", + value: function error(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { + _classPrivateFieldLooseBase(this, _log)[_log]('error', message); + } + } + }, { + key: "info", + value: function info(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { + _classPrivateFieldLooseBase(this, _log)[_log]('log', message); + } + } + }, { + key: "debug", + value: function debug(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); + } + } + }, { + key: "debugPE", + value: function debugPE(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); + } + } + }, { + key: "reportError", + value: function reportError(code, description) { + this.wzrkError.c = code; + this.wzrkError.d = description; + this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } + }, { + key: "logLevel", + get: function get() { + return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; + }, + set: function set(logLevel) { + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + }]); - var _oldValues$3 = _classPrivateFieldLooseKey("oldValues"); + return Logger; + }(); - var _logger$7 = _classPrivateFieldLooseKey("logger"); + var _log2 = function _log2(level, message) { + if (window.console) { + try { + var ts = new Date().getTime(); + console[level]("CleverTap [".concat(ts, "]: ").concat(message)); + } catch (e) {} + } + }; - var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); + var _get_isLegacyDebug = function _get_isLegacyDebug() { + return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; + }; - var Privacy = /*#__PURE__*/function (_Array) { - _inherits(Privacy, _Array); + var _logger$6 = _classPrivateFieldLooseKey("logger"); - var _super = _createSuper(Privacy); + var _sessionId = _classPrivateFieldLooseKey("sessionId"); - function Privacy(_ref, values) { - var _this; + var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var request = _ref.request, - account = _ref.account, - logger = _ref.logger; + var SessionManager = /*#__PURE__*/function () { + // SCOOKIE_NAME + function SessionManager(_ref) { + var logger = _ref.logger, + isPersonalisationActive = _ref.isPersonalisationActive; - _classCallCheck(this, Privacy); + _classCallCheck(this, SessionManager); - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { - value: _processPrivacyArray2 - }); - Object.defineProperty(_assertThisInitialized(_this), _request$4, { - writable: true, - value: void 0 - }); - Object.defineProperty(_assertThisInitialized(_this), _account$3, { + Object.defineProperty(this, _logger$6, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { + Object.defineProperty(this, _sessionId, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$7, { + Object.defineProperty(this, _isPersonalisationActive$3, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$7)[_logger$7] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$3)[_account$3] = account; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; - return _this; + this.cookieName = void 0; + this.scookieObj = void 0; + this.sessionId = StorageManager.getMetaProp('cs'); + _classPrivateFieldLooseBase(this, _logger$6)[_logger$6] = logger; + _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; } - _createClass(Privacy, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { - privacyArr[_key] = arguments[_key]; + _createClass(SessionManager, [{ + key: "getSessionCookieObject", + value: function getSessionCookieObject() { + var scookieStr = StorageManager.readCookie(this.cookieName); + var obj = {}; + + if (scookieStr != null) { + // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera + scookieStr = scookieStr.replace(singleQuoteRegex, '"'); + obj = JSON.parse(scookieStr); + + if (!isObject(obj)) { + obj = {}; + } else { + if (typeof obj.t !== 'undefined') { + // check time elapsed since last request + var lastTime = obj.t; + var now = getNow(); + + if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { + // adding 60 seconds to compensate for in-journey requests + // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read + // hence we shouldn't use it. + obj = {}; + } + } + } + } + + this.scookieObj = obj; + return obj; + } + }, { + key: "setSessionCookieObject", + value: function setSessionCookieObject(obj) { + var objStr = JSON.stringify(obj); + StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); + } + }, { + key: "manageSession", + value: function manageSession(session) { + // first time. check if current session id in localstorage is same + // if not same then prev = current and current = this new session + if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { + var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + + if (typeof currentSessionInLS === 'undefined') { + StorageManager.setMetaProp('ps', session); + StorageManager.setMetaProp('cs', session); + StorageManager.setMetaProp('sc', 1); + } else if (currentSessionInLS !== session) { + // not same as session in local storage. new session + StorageManager.setMetaProp('ps', currentSessionInLS); + StorageManager.setMetaProp('cs', session); + var sessionCount = StorageManager.getMetaProp('sc'); + + if (typeof sessionCount === 'undefined') { + sessionCount = 0; + } + + StorageManager.setMetaProp('sc', sessionCount + 1); + } + + this.sessionId = session; + } + } + }, { + key: "getTimeElapsed", + value: function getTimeElapsed() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } + + if (this.scookieObj != null) { + // TODO: check logic? + this.scookieObj = this.getSessionCookieObject(); } - if ($ct.isPrivacyArrPushed) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); - } else { - var _$ct$privacyArray; + var sessionStart = this.scookieObj.s; - (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); + if (sessionStart != null) { + var ts = getNow(); + return Math.floor(ts - sessionStart); } - - return 0; } }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); + key: "getPageCount", + value: function getPageCount() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; } - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; - } - }]); - - return Privacy; - }( /*#__PURE__*/_wrapNativeSuper(Array)); - - var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { - if (Array.isArray(privacyArr) && privacyArr.length > 0) { - var privacyObj = privacyArr.reduce(function (prev, curr) { - return _objectSpread2(_objectSpread2({}, prev), curr); - }, {}); - var data = {}; - var profileObj = {}; - var optOut = false; - - if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { - optOut = privacyObj[OPTOUT_KEY]; - - if (typeof optOut === 'boolean') { - profileObj[CT_OPTOUT_KEY] = optOut; // should be true when user wants to opt in - - $ct.isOptInRequest = !optOut; + if (this.scookieObj != null) { + // TODO: check logic + this.scookieObj = this.getSessionCookieObject(); } - } - if (privacyObj.hasOwnProperty(USEIP_KEY)) { - var useIP = privacyObj[USEIP_KEY]; - var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; - StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); + return this.scookieObj.p; } - - if (!isObjectEmpty(profileObj)) { - data.type = 'profile'; - data.profile = profileObj; - data = _classPrivateFieldLooseBase(this, _request$4)[_request$4].addSystemDataToObject(data, undefined); - var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - - var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; - - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false'); - - _classPrivateFieldLooseBase(this, _request$4)[_request$4].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); - - privacyArr.splice(0, privacyArr.length); + }, { + key: "sessionId", + get: function get() { + return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; + }, + set: function set(sessionId) { + _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; } - } - }; - - var _oldValues$4 = _classPrivateFieldLooseKey("oldValues"); - - var _logger$8 = _classPrivateFieldLooseKey("logger"); - - var _request$5 = _classPrivateFieldLooseKey("request"); - - var _account$4 = _classPrivateFieldLooseKey("account"); - - var _wizAlertJSPath = _classPrivateFieldLooseKey("wizAlertJSPath"); - - var _fcmPublicKey = _classPrivateFieldLooseKey("fcmPublicKey"); - - var _setUpWebPush = _classPrivateFieldLooseKey("setUpWebPush"); - - var _setUpWebPushNotifications = _classPrivateFieldLooseKey("setUpWebPushNotifications"); + }]); - var _setApplicationServerKey = _classPrivateFieldLooseKey("setApplicationServerKey"); + return SessionManager; + }(); - var _setUpSafariNotifications = _classPrivateFieldLooseKey("setUpSafariNotifications"); + var seqNo = 0; + var requestTime = 0; - var _setUpChromeFirefoxNotifications = _classPrivateFieldLooseKey("setUpChromeFirefoxNotifications"); + var _logger$7 = _classPrivateFieldLooseKey("logger"); - var _addWizAlertJS = _classPrivateFieldLooseKey("addWizAlertJS"); + var _account$3 = _classPrivateFieldLooseKey("account"); - var _removeWizAlertJS = _classPrivateFieldLooseKey("removeWizAlertJS"); + var _device$2 = _classPrivateFieldLooseKey("device"); - var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); + var _session$2 = _classPrivateFieldLooseKey("session"); - var NotificationHandler = /*#__PURE__*/function (_Array) { - _inherits(NotificationHandler, _Array); + var _isPersonalisationActive$4 = _classPrivateFieldLooseKey("isPersonalisationActive"); - var _super = _createSuper(NotificationHandler); + var _clearCookie = _classPrivateFieldLooseKey("clearCookie"); - function NotificationHandler(_ref, values) { - var _this; + var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); + var RequestManager = /*#__PURE__*/function () { + function RequestManager(_ref) { var logger = _ref.logger, + account = _ref.account, + device = _ref.device, session = _ref.session, - request = _ref.request, - account = _ref.account; + isPersonalisationActive = _ref.isPersonalisationActive; - _classCallCheck(this, NotificationHandler); + _classCallCheck(this, RequestManager); - _this = _super.call(this); - Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { - value: _handleNotificationRegistration2 - }); - Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { - value: _removeWizAlertJS2 - }); - Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { - value: _addWizAlertJS2 - }); - Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { - value: _setUpChromeFirefoxNotifications2 - }); - Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { - value: _setUpSafariNotifications2 - }); - Object.defineProperty(_assertThisInitialized(_this), _setApplicationServerKey, { - value: _setApplicationServerKey2 - }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPushNotifications, { - value: _setUpWebPushNotifications2 - }); - Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { - value: _setUpWebPush2 + Object.defineProperty(this, _addToLocalEventMap, { + value: _addToLocalEventMap2 }); - Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { + Object.defineProperty(this, _logger$7, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _logger$8, { + Object.defineProperty(this, _account$3, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _request$5, { + Object.defineProperty(this, _device$2, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _account$4, { + Object.defineProperty(this, _session$2, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { + Object.defineProperty(this, _isPersonalisationActive$4, { writable: true, value: void 0 }); - Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { + Object.defineProperty(this, _clearCookie, { writable: true, - value: void 0 + value: false }); - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; - _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; - return _this; + this.processingBackup = false; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7] = logger; + _classPrivateFieldLooseBase(this, _account$3)[_account$3] = account; + _classPrivateFieldLooseBase(this, _device$2)[_device$2] = device; + _classPrivateFieldLooseBase(this, _session$2)[_session$2] = session; + _classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4] = isPersonalisationActive; + RequestDispatcher.logger = logger; + RequestDispatcher.device = device; + RequestDispatcher.account = account; } - _createClass(NotificationHandler, [{ - key: "push", - value: function push() { - for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { - displayArgs[_key] = arguments[_key]; + _createClass(RequestManager, [{ + key: "processBackupEvents", + value: function processBackupEvents() { + var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); + + if (typeof backupMap === 'undefined' || backupMap === null) { + return; } - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); + this.processingBackup = true; - return 0; - } - }, { - key: "_processOldValues", - value: function _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + for (var idx in backupMap) { + if (backupMap.hasOwnProperty(idx)) { + var backupEvent = backupMap[idx]; + + if (typeof backupEvent.fired === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('Processing backup event : ' + backupEvent.q); + + if (typeof backupEvent.q !== 'undefined') { + RequestDispatcher.fireRequest(backupEvent.q); + } + + backupEvent.fired = true; + } + } } - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); + this.processingBackup = false; } }, { - key: "_enableWebPush", - value: function _enableWebPush(enabled, applicationServerKey) { - $ct.webPushEnabled = enabled; - - if (applicationServerKey != null) { - _classPrivateFieldLooseBase(this, _setApplicationServerKey)[_setApplicationServerKey](applicationServerKey); + key: "addSystemDataToObject", + value: function addSystemDataToObject(dataObject, ignoreTrim) { + // ignore trim for chrome notifications; undefined everywhere else + if (typeof ignoreTrim === 'undefined') { + dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); } - if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); - } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError)) { + dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError = {}; } - } - }]); - - return NotificationHandler; - }( /*#__PURE__*/_wrapNativeSuper(Array)); - - var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { - if ($ct.webPushEnabled && displayArgs.length > 0) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration](displayArgs); - } else if ($ct.webPushEnabled == null && displayArgs.length > 0) { - $ct.notifApi.notifEnabledFromApi = true; - $ct.notifApi.displayArgs = displayArgs.slice(); - } else if ($ct.webPushEnabled === false && displayArgs.length > 0) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Make sure push notifications are fully enabled and integrated'); - } - }; - - var _setUpWebPushNotifications2 = function _setUpWebPushNotifications2(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) { - if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) { - _classPrivateFieldLooseBase(this, _setUpChromeFirefoxNotifications)[_setUpChromeFirefoxNotifications](subscriptionCallback, serviceWorkerPath); - } else if (navigator.userAgent.indexOf('Safari') !== -1) { - _classPrivateFieldLooseBase(this, _setUpSafariNotifications)[_setUpSafariNotifications](subscriptionCallback, apnsWebPushId, apnsServiceUrl); - } - }; - - var _setApplicationServerKey2 = function _setApplicationServerKey2(applicationServerKey) { - _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = applicationServerKey; - }; - - var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { - var _this2 = this; - // ensure that proper arguments are passed - if (typeof apnsWebPushId === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that APNS Web Push ID is supplied'); - } + dataObject.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; - if (typeof apnsServiceUrl === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Ensure that APNS Web Push service path is supplied'); - } + if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { + dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + } - if ('safari' in window && 'pushNotification' in window.safari) { - window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { - if (subscription.permission === 'granted') { - var subscriptionData = JSON.parse(JSON.stringify(subscription)); - subscriptionData.endpoint = subscription.deviceToken; - subscriptionData.browser = 'Safari'; - StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - _classPrivateFieldLooseBase(_this2, _request$5)[_request$5].registerToken(subscriptionData); + dataObject.s = obj.s; // session cookie - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); - } else if (subscription.permission === 'denied') { - _classPrivateFieldLooseBase(_this2, _logger$8)[_logger$8].info('Error subscribing to Safari web push'); + dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + + var proto = document.location.protocol; + proto = proto.replace(':', ''); + dataObject.af = _objectSpread2(_objectSpread2({}, dataObject.af), {}, { + lib: 'web-sdk-v1.11.2', + protocol: proto + }, $ct.flutterVersion); // app fields + + if (sessionStorage.hasOwnProperty('WZRK_D')) { + dataObject.debug = true; } - }); - } - }; - var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { - var _this3 = this; + return dataObject; + } + }, { + key: "addFlags", + value: function addFlags(data) { + // check if cookie should be cleared. + _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - var registrationScope = ''; + if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { + data.rc = true; - if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { - if (typeof __wzrk_account_id !== 'undefined') { - // eslint-disable-line - // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. - // hence add a timeout and hope serviceWroker is ready within that time. - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('reset cookie sent in request and cleared from meta for future requests.'); } - registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE - // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS - // OR getRegistrations PROMISE IF ITS FIREFOX - - var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; - var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); + if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { + var lastSyncTime = StorageManager.getMetaProp('lsTime'); + var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server - if (isServiceWorkerAtRoot) { - return navigator.serviceWorker.ready; - } else { - if (navigator.userAgent.indexOf('Chrome') !== -1) { - return new Promise(function (resolve) { - return setTimeout(function () { - return resolve(registration); - }, 5000); - }); - } else { - return navigator.serviceWorker.getRegistrations(); + if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { + data.dsync = true; + return; } - } - }).then(function (serviceWorkerRegistration) { - // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE - if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { - serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { - return i.scope === registrationScope; - })[0]; - } - var subscribeObj = { - userVisibleOnly: true - }; + var now = getNow(); // last sync time has expired - get fresh data from server - if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { - subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); + if (lastSyncTime + expirySeconds < now) { + data.dsync = true; + } } + } // saves url to backup cache and fires the request - serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC + /** + * + * @param {string} url + * @param {boolean} override whether the request can go through or not + * @param {Boolean} sendOULFlag - true in case of a On User Login request + */ + }, { + key: "saveAndFireRequest", + value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { + var now = getNow(); + url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); + var data = url + '&i=' + now + '&sn=' + seqNo; + StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); // if offline is set to true, save the request in backup and return - var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token + if ($ct.offline) return; // if there is no override + // and an OUL request is not in progress + // then process the request as it is + // else block the request + // note - $ct.blockRequest should ideally be used for override - if (navigator.userAgent.indexOf('Chrome') !== -1) { - subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); - subscriptionData.browser = 'Chrome'; - } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); - subscriptionData.browser = 'Firefox'; + if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { + if (now === requestTime) { + seqNo++; + } else { + requestTime = now; + seqNo = 0; } - StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); + window.oulReqN = $ct.globalCache.REQ_N; + RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); + } else { + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); + } + } + }, { + key: "unregisterTokenForGuid", + value: function unregisterTokenForGuid(givenGUID) { + var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - _classPrivateFieldLooseBase(_this3, _request$5)[_request$5].registerToken(subscriptionData); + if (payload) { + var data = {}; + data.type = 'data'; - if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { - subscriptionCallback(); + if (isValueValid(givenGUID)) { + data.g = givenGUID; } - }).catch(function (error) { - // unsubscribe from webpush if error - serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { - if (subscription !== null) { - subscription.unsubscribe().then(function (successful) { - // You've successfully unsubscribed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].info('Unsubscription successful'); - window.clevertap.notifications.push({ - skipDialog: true - }); - }).catch(function (e) { - // Unsubscription failed - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error unsubscribing: ' + e); - }); - } - }); + data.action = 'unregister'; + data.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('Error subscribing: ' + error); - }); - }).catch(function (err) { - _classPrivateFieldLooseBase(_this3, _logger$8)[_logger$8].error('error registering service worker: ' + err); - }); - } - }; + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - var _addWizAlertJS2 = function _addWizAlertJS2() { - var scriptTag = document.createElement('script'); - scriptTag.setAttribute('type', 'text/javascript'); - scriptTag.setAttribute('id', 'wzrk-alert-js'); - scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body + data.s = obj.s; // session cookie - document.getElementsByTagName('body')[0].appendChild(scriptTag); - return scriptTag; - }; + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - var _removeWizAlertJS2 = function _removeWizAlertJS2() { - var scriptTag = document.getElementById('wzrk-alert-js'); - scriptTag.parentNode.removeChild(scriptTag); - }; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; - var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { - var _this4 = this; + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + RequestDispatcher.fireRequest(pageLoadUrl, true); + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); + } // REGISTER TOKEN - // make sure everything is specified - var titleText; - var bodyText; - var okButtonText; - var rejectButtonText; - var okButtonColor; - var skipDialog; - var askAgainTimeInSeconds; - var okCallback; - var rejectCallback; - var subscriptionCallback; - var serviceWorkerPath; - var httpsPopupPath; - var httpsIframePath; - var apnsWebPushId; - var apnsWebPushServiceUrl; - if (displayArgs.length === 1) { - if (isObject(displayArgs[0])) { - var notifObj = displayArgs[0]; - titleText = notifObj.titleText; - bodyText = notifObj.bodyText; - okButtonText = notifObj.okButtonText; - rejectButtonText = notifObj.rejectButtonText; - okButtonColor = notifObj.okButtonColor; - skipDialog = notifObj.skipDialog; - askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds; - okCallback = notifObj.okCallback; - rejectCallback = notifObj.rejectCallback; - subscriptionCallback = notifObj.subscriptionCallback; - serviceWorkerPath = notifObj.serviceWorkerPath; - httpsPopupPath = notifObj.httpsPopupPath; - httpsIframePath = notifObj.httpsIframePath; - apnsWebPushId = notifObj.apnsWebPushId; - apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl; + this.registerToken(payload); } - } else { - titleText = displayArgs[0]; - bodyText = displayArgs[1]; - okButtonText = displayArgs[2]; - rejectButtonText = displayArgs[3]; - okButtonColor = displayArgs[4]; - skipDialog = displayArgs[5]; - askAgainTimeInSeconds = displayArgs[6]; - } + }, { + key: "registerToken", + value: function registerToken(payload) { + if (!payload) return; // add gcookie etc to the payload - if (skipDialog == null) { - skipDialog = false; - } + payload = this.addSystemDataToObject(payload, true); + payload = JSON.stringify(payload); - if (serviceWorkerPath == null) { - serviceWorkerPath = '/clevertap_sw.js'; - } // ensure that the browser supports notifications + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7])); + RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage - if (typeof navigator.serviceWorker === 'undefined') { - return; - } + StorageManager.save(WEBPUSH_LS_KEY, 'ok'); + } + }, { + key: "processEvent", + value: function processEvent(data) { + _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + + data = this.addSystemDataToObject(data, undefined); + this.addFlags(data); + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); + } + }, { + key: "post", + value: function post(url, body) { + var _this = this; + + return fetch(url, { + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: body + }).then(function (response) { + if (response.ok) { + return response.json(); + } - var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications + throw response; + }).then(function (data) { + _classPrivateFieldLooseBase(_this, _logger$7)[_logger$7].debug('Sync data successful', data); - if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Make sure you are https or localhost to register for notifications'); + return data; + }).catch(function (e) { + _classPrivateFieldLooseBase(_this, _logger$7)[_logger$7].debug('Error in syncing variables', e); - return; - } // right now, we only support Chrome V50 & higher & Firefox + throw e; + }); + } + }]); + return RequestManager; + }(); - if (navigator.userAgent.indexOf('Chrome') !== -1) { - var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); + var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { + if (StorageManager._isLocalStorageSupported()) { + if (typeof $ct.globalEventsMap === 'undefined') { + $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); - if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { - return; + if (typeof $ct.globalEventsMap === 'undefined') { + $ct.globalEventsMap = {}; + } } - } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); - if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { - return; - } - } else if (navigator.userAgent.indexOf('Safari') !== -1) { - var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); + var nowTs = getNow(); + var evtDetail = $ct.globalEventsMap[evtName]; - if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { - return; + if (typeof evtDetail !== 'undefined') { + evtDetail[2] = nowTs; + evtDetail[0]++; + } else { + evtDetail = []; + evtDetail.push(1); + evtDetail.push(nowTs); + evtDetail.push(nowTs); } - } else { - return; - } // we check for the cookie in setUpChromeNotifications() the tokens may have changed + $ct.globalEventsMap[evtName] = evtDetail; + StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap); + } + }; - if (!isHTTP) { - if (Notification == null) { - return; - } // handle migrations from other services -> chrome notifications may have already been asked for before + var _request$5 = _classPrivateFieldLooseKey("request"); + var _account$4 = _classPrivateFieldLooseKey("account"); - if (Notification.permission === 'granted') { - // skip the dialog and register - _classPrivateFieldLooseBase(this, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + var _oldValues$4 = _classPrivateFieldLooseKey("oldValues"); - return; - } else if (Notification.permission === 'denied') { - // we've lost this profile :'( - return; - } + var _logger$8 = _classPrivateFieldLooseKey("logger"); - if (skipDialog) { - _classPrivateFieldLooseBase(this, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); - return; - } - } // make sure the right parameters are passed + var Privacy = /*#__PURE__*/function (_Array) { + _inherits(Privacy, _Array); + var _super = _createSuper(Privacy); - if (!titleText || !bodyText || !okButtonText || !rejectButtonText) { - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8].error('Missing input parameters; please specify title, body, ok button and cancel button text'); + function Privacy(_ref, values) { + var _this; - return; - } // make sure okButtonColor is formatted properly + var request = _ref.request, + account = _ref.account, + logger = _ref.logger; + _classCallCheck(this, Privacy); - if (okButtonColor == null || !okButtonColor.match(/^#[a-f\d]{6}$/i)) { - okButtonColor = '#f28046'; // default color for positive button - } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { + value: _processPrivacyArray2 + }); + Object.defineProperty(_assertThisInitialized(_this), _request$5, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _account$4, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { + writable: true, + value: void 0 + }); + Object.defineProperty(_assertThisInitialized(_this), _logger$8, { + writable: true, + value: void 0 + }); + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; + return _this; + } + _createClass(Privacy, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { + privacyArr[_key] = arguments[_key]; + } - var now = new Date().getTime() / 1000; + if ($ct.isPrivacyArrPushed) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); + } else { + var _$ct$privacyArray; - if (StorageManager.getMetaProp('notif_last_time') == null) { - StorageManager.setMetaProp('notif_last_time', now); - } else { - if (askAgainTimeInSeconds == null) { - // 7 days by default - askAgainTimeInSeconds = 7 * 24 * 60 * 60; - } + (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); + } - if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) { - return; - } else { - // continue asking - StorageManager.setMetaProp('notif_last_time', now); + return 0; } - } + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + } - if (isHTTP) { - // add the https iframe - var httpsIframe = document.createElement('iframe'); - httpsIframe.setAttribute('style', 'display:none;'); - httpsIframe.setAttribute('src', httpsIframePath); - document.body.appendChild(httpsIframe); - window.addEventListener('message', function (event) { - if (event.data != null) { - var obj = {}; + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + } + }]); - try { - obj = JSON.parse(event.data); - } catch (e) { - // not a call from our iframe - return; - } + return Privacy; + }( /*#__PURE__*/_wrapNativeSuper(Array)); - if (obj.state != null) { - if (obj.from === 'ct' && obj.state === 'not') { - _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { - // create our wizrocket popup - window.wzrkPermissionPopup.wizAlert({ - title: titleText, - body: bodyText, - confirmButtonText: okButtonText, - confirmButtonColor: okButtonColor, - rejectButtonText: rejectButtonText - }, function (enabled) { - // callback function - if (enabled) { - // the user accepted on the dialog box - if (typeof okCallback === 'function') { - okCallback(); - } // redirect to popup.html + var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { + if (Array.isArray(privacyArr) && privacyArr.length > 0) { + var privacyObj = privacyArr.reduce(function (prev, curr) { + return _objectSpread2(_objectSpread2({}, prev), curr); + }, {}); + var data = {}; + var profileObj = {}; + var optOut = false; + if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { + optOut = privacyObj[OPTOUT_KEY]; - window.open(httpsPopupPath); - } else { - if (typeof rejectCallback === 'function') { - rejectCallback(); - } - } + if (typeof optOut === 'boolean') { + profileObj[CT_OPTOUT_KEY] = optOut; // should be true when user wants to opt in - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); - }); - }; - } - } + $ct.isOptInRequest = !optOut; } - }, false); - } else { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { - // create our wizrocket popup - window.wzrkPermissionPopup.wizAlert({ - title: titleText, - body: bodyText, - confirmButtonText: okButtonText, - confirmButtonColor: okButtonColor, - rejectButtonText: rejectButtonText - }, function (enabled) { - // callback function - if (enabled) { - // the user accepted on the dialog box - if (typeof okCallback === 'function') { - okCallback(); - } + } - _classPrivateFieldLooseBase(_this4, _setUpWebPushNotifications)[_setUpWebPushNotifications](subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); - } else { - if (typeof rejectCallback === 'function') { - rejectCallback(); - } - } + if (privacyObj.hasOwnProperty(USEIP_KEY)) { + var useIP = privacyObj[USEIP_KEY]; + var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; + StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); + } - _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); - }); - }; + if (!isObjectEmpty(profileObj)) { + data.type = 'profile'; + data.profile = profileObj; + data = _classPrivateFieldLooseBase(this, _request$5)[_request$5].addSystemDataToObject(data, undefined); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$8)[_logger$8]); + + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$4)[_account$4].dataPostURL; + + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false'); + + _classPrivateFieldLooseBase(this, _request$5)[_request$5].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + + privacyArr.splice(0, privacyArr.length); + } } }; @@ -8961,6 +9527,8 @@ }; api.enableWebPush = function (enabled, applicationServerKey) { + setServerKey(applicationServerKey); + _this.notifications._enableWebPush(enabled, applicationServerKey); }; @@ -9067,7 +9635,6 @@ return; } - checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], accountId); StorageManager.removeCookie('WZRK_P', window.location.hostname); if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { @@ -9080,6 +9647,7 @@ _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; } + checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], _classPrivateFieldLooseBase(this, _account$6)[_account$6].id); _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; if (region) { @@ -9256,7 +9824,7 @@ }, { key: "getSDKVersion", value: function getSDKVersion() { - return 'web-sdk-v1.9.6'; + return 'web-sdk-v1.11.2'; } }, { key: "defineVariable", diff --git a/clevertap.js.map b/clevertap.js.map index 729c9d59..96accec9 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/notification.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {}\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n // console.log('Raise notification clicked event for ', item)\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: '$$PACKAGE_VERSION$$'\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n console.log('updateFormData called with', selector.values.form, isPreview)\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject,\n closeIframe\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID,\n CAMP_COOKIE_G,\n GCOOKIE_NAME\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport {\n compressToBase64\n} from './encoder'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPersonalisationBanner } from './web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from './web-personalisation/carousel'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n if (targetingMsgJson[DISPLAY].delay != null && targetingMsgJson[DISPLAY].delay > 0) {\n const delay = targetingMsgJson[DISPLAY].delay\n targetingMsgJson[DISPLAY].delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const getCookieParams = () => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n }\n\n const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams()\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n\n const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy)\n }\n\n const incrementImpression = (targetingMsgJson) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n }\n\n const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n }\n\n const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n }\n\n const renderPopUpImageOnly = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n }\n\n const renderFooterNotification = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.wtarget_type === 2) { // Handling Web Native display\n // Logic for kv pair data\n if (targetingMsgJson.msgContent.type === 1) {\n const inaObj = {}\n\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n return\n }\n }\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson)\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n\n const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams()\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n renderFooterNotification(targetingMsgJson)\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n let targetingMsgJson\n if (event != null && event.clientY > 0) {\n return\n }\n if (targetObj == null) {\n targetingMsgJson = exitintentObj\n } else {\n targetingMsgJson = targetObj\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0 && document.getElementById('intentPreview') != null && document.getElementById('intentOpacityDiv') != null) {\n const element = document.getElementById('intentPreview')\n element.remove()\n document.getElementById('intentOpacityDiv').remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n #setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n #setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.#setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.#setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n checkBuilder(this.#logger, accountId)\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPersonalisationBanner","_details","shadow","attachShadow","mode","innerHTML","getBannerContent","trackClick","addEventListener","onClickUrl","details","onClick","open","parent","renderNotificationClicked","msgId","pivotId","renderNotificationViewed","divHeight","css","desktopImageURL","mobileImageURL","html","renderBanner","HTMLElement","CTWebPersonalisationCarousel","_target","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","customElements","define","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","target","wzrk_id","wzrk_pivot","event","eventID","startsWith","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearInterval","clearTimeout","detail","banner","classList","add","navBtnsCss","navArrowsCss","prevItem","prevButton","remove","button","setInterval","sliderTime","goTo","prev","cur","renderCarousel","CTWebPopupImageOnly","_session","popup","container","resizeObserver","sessionId","getImageOnlyPopupContent","shadowRoot","closeIcon","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","width","getRenderedImageWidth","setProperty","msgContent","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","observeUrlChange","previousHref","MutationObserver","childList","subtree","_tr","_device","_request","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","parseInt","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","delay","campKey","newCampObj","getCookieParams","scookieObj","setupClickEvent","contentDiv","isLegacy","ctaElement","jsCTAElements","jsFunc","preview","invokeExternalJs","func","setupClickUrl","incrementImpression","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","renderPopUpImageOnly","popupImageOnly","renderFooterNotification","displayObj","layout","showExitIntent","msgDiv","isBanner","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","userAgent","proto","iFrameStyle","iframe","borderRadius","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","titleText","descriptionText","imageTd","onClickStr","closeCampaign","Event","appendScriptForCustomEvent","srcdoc","adjustIFrameHeight","contentDocument","scrollHeight","margin","ua","inDoc","contentWindow","_timer","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","exitintentObj","targetObj","clientY","opacityDiv","opacity","rgbaColor","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","targetNotif","onmouseleave","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","handleInboxNotifications","msgArr","vars","mergeVariables","staleDataUpdate","staledata","campType","evpr","eventsMap","events","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","protocol","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","registerToken","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","NotificationHandler","displayArgs","enabled","applicationServerKey","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","getSubscription","unsubscribe","successful","notifications","skipDialog","scriptTag","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","chromeAgent","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChang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IAAvB,wBAAnC;;EACA,MAAI6O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB3U,QAAtB,CAAtB;EACA2U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8C/M,GAAG,CAAC+B,YAAlD;EACD;;MC3yBGsL,SAAS,GAAG,IAAI8/B,SAAJ,CAAcztC,MAAM,CAAC2N,SAArB;EAElB3N,MAAM,CAAC2N,SAAP,GAAmB3N,MAAM,CAAC4N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/versionCompare.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, isPreview) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => window.open(url, '_blank').focus()\n : () => { window.location.href = url }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","export const versionCompare = (currentVersion) => {\n const requiredVersion = '1.9.2'\n if (requiredVersion === currentVersion) return true\n const splitRequiredVersion = requiredVersion.split('.')\n const splitCurrentVersion = currentVersion.split('.')\n\n let p1 = 0\n let isWebsiteVersionHigher = false\n\n while (p1 < splitRequiredVersion.length && !isWebsiteVersionHigher) {\n if (parseInt(splitRequiredVersion[p1]) < parseInt(splitCurrentVersion[p1])) {\n isWebsiteVersionHigher = true\n }\n p1++\n }\n\n return isWebsiteVersionHigher\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\nimport { versionCompare } from './versionCompare'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n const isRequiredVersion = versionCompare(sdkVersion)\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion: isRequiredVersion ? '1.9.3' : sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n console.log(targetingMsgJson.details)\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let elementDisplayed = false\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n console.log('updateFormData called with', selector.values.form, isPreview)\n updateFormData(element, selector.values.form, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n processElement(element, s)\n elementDisplayed = true\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n\n if (elementDisplayed && !isPreview) {\n window.clevertap.renderNotificationViewed({\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n })\n }\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40O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NzgxMlY0MS43ODQyQzI5Ljc4MTIgNDMuMDA3NyAzMC43NzMxIDQzLjk5OTYgMzEuOTk2NiA0My45OTk2QzMzLjIyMDIgNDMuOTk5NiAzNC4yMTIgNDMuMDA3NyAzNC4yMTIgNDEuNzg0MlY0MS4wNDk3SDQwLjEyMzNDNDAuOTM4IDQxLjA0OTcgNDEuNTk4NCA0MC4zODkzIDQxLjU5ODQgMzkuNTc0NkM0MS41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","imgURL","src","elementCss","head","versionCompare","currentVersion","requiredVersion","splitRequiredVersion","splitCurrentVersion","p1","isWebsiteVersionHigher","parseInt","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","isRequiredVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","elementDisplayed","processElement","selector","outerHTML","json","dispatchJsonData","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationClicked","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","msgCTkv","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings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C,IAAI,CAAC6rC,EAApB,GAA2B/pC,GAAG,CAACF,QAA/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc+W,qBAAd,CAAoC/W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcgX,QAAd,CAAuBhX,IAAvB;;EACA,MAAMiX,cAAc,GAAG5K,YAAY,CAACvM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI8O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB7U,QAAtB,CAAtB;EACA6U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAImnC,SAAJ,CAAc/0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index f835532a..8e4be11f 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw r}}}}var w=0;function k(e){return"__private_"+w+++"_"+e}function C(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var x,P="clevertap-prod.com",S="https:",O=k("accountId"),I=k("region"),_=k("targetDomain"),E=k("dcSdkversion"),A=k("token"),L=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:""}),Object.defineProperty(this,_,{writable:!0,value:P}),Object.defineProperty(this,E,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=n,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return n(e,[{key:"id",get:function(){return C(this,O)[O]},set:function(e){C(this,O)[O]=e}},{key:"region",get:function(){return C(this,I)[I]},set:function(e){C(this,I)[I]=e}},{key:"dcSDKVersion",get:function(){return C(this,E)[E]},set:function(e){C(this,E)[E]=e}},{key:"targetDomain",get:function(){return C(this,_)[_]},set:function(e){C(this,_)[_]=e}},{key:"token",get:function(){return C(this,A)[A]},set:function(e){C(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===P?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),M=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),T=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),R=new RegExp("'","g"),j="clear",D="Charged ID",z="WZRK_CHARGED_ID",B="WZRK_G",N="WZRK_K",U="WZRK_CAMP",F="WZRK_CAMP_G",V="WZRK_EV",q="WZRK_META",W="WZRK_PR",K="WZRK_ARP",H="WZRK_L",G="global",J="optOut",Z="useIP",$="WZRK_X",Y="push",Q=31536e3,X="2",ee="wzrk_",te="wzrk_id",ie="Notification Viewed",ne="Notification Clicked",oe="WZRK_FPU",re="WZRK_PSD",ae="$incr",se="$decr",le="$set",ce="$add",de="$remove",ue="$delete",pe="WZRK_INBOX_CONFIG",he="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ge=["Stayed","UTM Visited","App Launched","Notification Sent",ie,ne],ye=function(e){return"string"==typeof e||e instanceof String},be=function(e){return"[object Object]"===Object.prototype.toString.call(e)},me=function(t){return"object"===e(t)&&t instanceof Date},we=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},ke=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ce=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},xe=function(e){return null!=e&&"undefined"!==e},Pe=function t(i,n){var o;if("object"!==e(i))return ye(i)?(o=Se(i,T)).length>1024&&(o=o.substring(0,1024),n.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=i,o;for(var r in i)if(i.hasOwnProperty(r)){var a=t(i[r],n),s=void 0;(s=Se(r,M)).length>1024&&(s=s.substring(0,1024),n.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete i[r],i[s]=a}return i},Se=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ie=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ee=function(e){if(Ae(e))return"$D_"+e},Ae=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var i=t[3],n=t[2]-1,o=t[1],r=new Date(o,n,i);return r.getDate()==i&&r.getMonth()==n&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return n(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}},{key:"createCookie",value:function(e,t,i,n){var o="",r="";if(i){var a=new Date;a.setTime(a.getTime()+1e3*i),o="; expires="+a.toGMTString()}n&&(r="; domain="+n),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,i,a),this.readCookie(e)==t){o=a,Me.broadDomain=o;break}}else this.createCookie(e,t,i,o)}else this.createCookie(e,t,i,n)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var i=this.readFromLSorCookie(q);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(q,i)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(N);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(N,e)}},{key:"backupEvent",value:function(e,t,i){var n=this.readFromLSorCookie(H);void 0===n&&(n={}),n[t]={q:e},this.saveToLSorCookie(H,n),i.debug("stored in ".concat(H," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var i=this.readFromLSorCookie(H);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(H,i))}}]),e}(),Me={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{}},Te=k("keyOrder"),Re=k("deleteFromObject"),je=function(){function e(i){t(this,e),Object.defineProperty(this,Re,{value:De}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=i;var n=Le.readFromLSorCookie($);if(n){var o={};for(var r in C(this,Te)[Te]=[],n=n.cache)n.hasOwnProperty(r)&&(o[n[r][0]]=n[r][1],C(this,Te)[Te].push(n[r][0]));this.cache=o}else this.cache={},C(this,Te)[Te]=[]}return n(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=C(this,Re)[Re](e,this.cache),this.cache[e]=t,C(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var i=this.cache[e],n=C(this,Te)[Te];null!=i?this.cache=C(this,Re)[Re](e,this.cache):n.length===this.max&&(this.cache=C(this,Re)[Re](n[0],this.cache)),this.cache[e]=t,C(this,Te)[Te][C(this,Te)[Te]-1]!==e&&C(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],i=C(this,Te)[Te];for(var n in i)if(i.hasOwnProperty(n)){var o=[];o.push(i[n]),o.push(e[i[n]]),t.push(o)}Le.saveToLSorCookie($,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=C(this,Te)[Te];for(var i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}},{key:"getSecondLastKey",value:function(){var e=C(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=C(this,Te)[Te].length;if(e)return C(this,Te)[Te][e-1]}}]),e}(),De=function(e,t){var i,n=JSON.parse(JSON.stringify(C(this,Te)[Te])),o={};for(var r in n)n.hasOwnProperty(r)&&(n[r]!==e?o[n[r]]=t[n[r]]:i=r);return n.splice(i,1),C(this,Te)[Te]=JSON.parse(JSON.stringify(n)),o},ze=k("logger"),Be=k("request"),Ne=k("device"),Ue=k("session"),Fe=function(){function e(i){var n=i.logger,o=i.request,r=i.device,a=i.session;t(this,e),Object.defineProperty(this,ze,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),C(this,ze)[ze]=n,C(this,Be)[Be]=o,C(this,Ne)[Ne]=r,C(this,Ue)[Ue]=a}return n(e,[{key:"s",value:function(e,t,i,n,o){var r=!1,a=!1;if(window.isOULInProgress&&(i||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===n&&(n=0),Le.removeBackup(n,C(this,ze)[ze]),!(n>Me.globalCache.REQ_N)){if(xe(C(this,Ne)[Ne].gcookie)||e&&(a=!0),!xe(C(this,Ne)[Ne].gcookie)||i||"boolean"==typeof o){var s=C(this,Ue)[Ue].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(n)&&(!be(e[i][n])||!it(e[i][n])))return!1}else{if(be(e[i])||Array.isArray(e[i]))return!1;me(e[i])&&(e[i]=_e(e[i]))}if(ye(e[D])||Ce(e[D])){var o=e[D]+"";if(void 0===x&&(x=Le.readFromLSorCookie(z)),void 0!==x&&x.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;x=o,Le.saveToLSorCookie(z,o)}return!0}return!1},ot=k("logger"),rt=k("oldValues"),at=k("request"),st=k("isPersonalisationActive"),lt=k("processEventArray"),ct=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=i.call(this),Object.defineProperty(h(r),lt,{value:dt}),Object.defineProperty(h(r),ot,{writable:!0,value:void 0}),Object.defineProperty(h(r),rt,{writable:!0,value:void 0}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),C(h(r),ot)[ot]=a,C(h(r),rt)[rt]=n,C(h(r),at)[at]=s,C(h(r),st)[st]=l,r}return n(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0;){var t=e.shift();if(ye(t))if(t.length>1024&&(t=t.substring(0,1024),C(this,ot)[ot].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),ge.includes(t))C(this,ot)[ot].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var i={type:"event"};if(i.evtName=Se(t,M),0!==e.length){var n=e.shift();if(be(n)){if("Charged"===t){if(!nt(n,C(this,ot)[ot])){C(this,ot)[ot].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!it(n)){C(this,ot)[ot].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=n}else e.unshift(n)}C(this,at)[at].processEvent(i)}else C(this,ot)[ot].error(Ge)}},ut=function(e){var t={},i=e.indexOf("?");if(i>1){var n,o=e.substring(i+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=a.exec(o);n;)t[s(n[1])]=s(n[2]),n=a.exec(o)}return t},pt=function(e,t,i){return e+"&"+t+"="+encodeURIComponent(i)},ht=function(){return window.location.hostname},ft=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),gt(e)},vt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),gt=function(e){if(null==e)return"";var t,i,n,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,i,n,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,f=0,v=String.fromCharCode;for(n=0;n>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(h<<=1,15==f){p+=v(h);break}f++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),n=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,n=255&e.charCodeAt((c+1)/2)):i=n=NaN),c+=3,o=t>>2,r=(3&t)<<4|i>>4,a=(15&i)<<2|n>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),l=l+vt.charAt(o)+vt.charAt(r)+vt.charAt(a)+vt.charAt(s);return l},yt=k("fireRequest"),bt=k("dropRequestDueToOptOut"),mt=k("addUseIPToRequest"),wt=k("addARPToRequest"),kt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return n(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,i,n){C(this,yt)[yt](e,1,t,i,n)}}]),e}();kt.logger=void 0,kt.device=void 0,kt.account=void 0,Object.defineProperty(kt,yt,{value:function(e,t,i,n,o){var r,a,s=this;if(C(this,bt)[bt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(xe(this.device.gcookie)||(Me.blockRequest=!0),o&&o===ve)!xe(this.device.gcookie)&&Me.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(kt,bt,{value:function(){return!Me.isOptInRequest&&xe(this.device.gcookie)&&ye(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(Me.isOptInRequest=!1,!1)}}),Object.defineProperty(kt,mt,{value:function(e){var t=Le.getMetaProp(Z);return"boolean"!=typeof t&&(t=!1),pt(e,Z,t?"true":"false")}}),Object.defineProperty(kt,wt,{value:function(e,t){if(!0===t){var i={skipResARP:!0};return pt(e,"arp",ft(JSON.stringify(i),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(K)&&null!==localStorage.getItem(K)?pt(e,"arp",ft(JSON.stringify(Le.readFromLSorCookie(K)),this.logger)):e}});var Ct,xt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(U);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(R,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},Pt=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},xt()),e),i=JSON.stringify(t);Le.save(U,encodeURIComponent(i)),St()}},St=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(xe(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(F)?JSON.parse(decodeURIComponent(Le.read(F))):{};if(e&&Le._isLocalStorageSupported()){var i={},n=xt();Object.keys(n).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=n[r].global,c=Oe(),d=n[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var f=0,v=0,g=u[p];if("tc"===g)continue;void 0!==d&&void 0!==d[g]&&(f=d[g]),void 0!==l&&void 0!==l[g]&&(v=l[g]),h=[g,f,v],s[g]=h}}}i=a(a({},i),{},o({},r,s))})),t[e]=i,Le.save(F,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=xt();var i=Le.read(F),n=i?decodeURIComponent(i):null,o=n?JSON.parse(n):null,r=e&&null!=i&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=i&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},It=function(e,t){var i=t.logger,n=!1;if(be(e))for(var o in e)if(e.hasOwnProperty(o)){n=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(n=!1,i.error(Je)),"Employed"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error(Ze)),"Married"!==o||r.match(/^Y$|^N$/)||(n=!1,i.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(n=!1,i.error(Ye)),"Age"===o&&null!=r&&(ke(r)?e.Age=+r:(n=!1,i.error(Qe))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||me(r)||(n=!1,i.error(Xe)),me(r)&&(e[o]=_e(r))):me(r)&&(e[o]=_e(r)),"Phone"!==o||we(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),ke(r)?e.Phone=+r:(n=!1,i.error(tt+". Removed."))):(n=!1,i.error(tt+". Removed."))),n||delete e[o]}return n},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var i=function(e){if(null!=e){for(var t="",i="",n=0;n0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ee(o[2]+o[0]+o[1])}return t},Et=function(e,t){var i=t.logger,n={};if(null!=e.displayName&&(n.Name=e.displayName),null!=e.id&&(n.GPID=e.id+""),null!=e.gender&&("male"===e.gender?n.Gender="M":"female"===e.gender?n.Gender="F":"other"===e.gender&&(n.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(n.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var i=e[t],n={},o=void 0;if(null!=i.Site){if(o=i.Site,we(o)||!It(o,{logger:C(this,Rt)[Rt]}))return}else if(null!=i.Facebook){var r=i.Facebook;we(r)||r.error||(o=_t(r))}else if(null!=i["Google Plus"]){var a=i["Google Plus"];we(a)||a.error||(o=Et(a,{logger:C(this,Rt)[Rt]}))}if(null!=o&&!we(o)){n.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=o,At(o,!0),n=C(this,jt)[jt].addSystemDataToObject(n,void 0),C(this,jt)[jt].addFlags(n);var s=ft(JSON.stringify(n),C(this,Rt)[Rt]),l=C(this,Dt)[Dt].dataPostURL;l=pt(l,"type",Y),l=pt(l,"d",s),C(this,jt)[jt].saveAndFireRequest(l,Me.blockRequest)}}},Vt=k("request"),qt=k("logger"),Wt=k("account"),Kt=k("session"),Ht=k("oldValues"),Gt=k("device"),Jt=k("processOUL"),Zt=k("handleCookieFromCache"),$t=k("deleteUser"),Yt=k("processLoginArray"),Qt=function(e){s(o,e);var i=v(o);function o(e,n){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=i.call(this),Object.defineProperty(h(r),Yt,{value:ii}),Object.defineProperty(h(r),$t,{value:ti}),Object.defineProperty(h(r),Zt,{value:ei}),Object.defineProperty(h(r),Jt,{value:Xt}),Object.defineProperty(h(r),Vt,{writable:!0,value:void 0}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Wt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),C(h(r),Vt)[Vt]=a,C(h(r),Wt)[Wt]=s,C(h(r),Kt)[Kt]=l,C(h(r),qt)[qt]=c,C(h(r),Ht)[Ht]=n,C(h(r),Gt)[Gt]=d,r}return n(o,[{key:"clear",value:function(){C(this,qt)[qt].debug("clear called. Reset flag has been set."),C(this,$t)[$t](),Le.setMetaProp(j,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,we(s)||!It(s,{logger:C(this,qt)[qt]}))return}else if(null!=r.Facebook){var l=r.Facebook;we(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];we(c)&&!c.error&&(s=Et(c,{logger:C(this,qt)[qt]}))}if(null!=s&&!we(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&n(d)),At(s,!0),a=C(this,Vt)[Vt].addSystemDataToObject(a,void 0),C(this,Vt)[Vt].addFlags(a),i&&(a.isOUL=!0);var u=ft(JSON.stringify(a),C(this,qt)[qt]),p=C(this,Wt)[Wt].dataPostURL;p=pt(p,"type",Y),p=pt(p,"d",u),C(this,Vt)[Vt].saveAndFireRequest(p,Me.blockRequest,i)}}},ei=function(){Me.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(U,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Kt)[Kt].setSessionCookieObject("")},ti=function(){Me.blockRequest=!0,C(this,qt)[qt].debug("Block request is true"),Me.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,Me.broadDomain),Le.removeCookie(U,ht()),Le.removeCookie(N,ht()),Le.removeCookie(C(this,Kt)[Kt].cookieName,Me.broadDomain),Le.removeCookie(K,Me.broadDomain),C(this,Gt)[Gt].gcookie=null,C(this,Kt)[Kt].setSessionCookieObject("")},ii=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&be(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{C(this,Jt)[Jt]([t])}catch(e){C(this,qt)[qt].debug(e)}}else C(this,qt)[qt].error("Profile object is in incorrect format")}},ni=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),oi=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni),e}return n(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var i=t.target.id;if(i.startsWith("carousel__button")){var n=+i.split("-")[1];n!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=n,e.updateSelectedItem(),e.startAutoSlide())}else if(i.startsWith("carousel__arrow"))i.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(i.indexOf("-")>-1){var o=+i.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,i){var n=document.createElement("ct-web-personalisation-banner");n.classList.add("carousel__item"),n.trackClick=!1,n.setAttribute("id","carousel__item-".concat(i+1)),n.details=t,e.appendChild(n)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var i=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),n=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));i.classList.add("carousel__item--selected"),n&&n.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),ri=function(e){s(o,e);var i=v(o);function o(){var e;return t(this,o),(e=i.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return n(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],i=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var n=xt(),o=n.wp[i];null==o&&(o={},n[i]=o),o[t]="dnd",Pt(n)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),ai=function(e){s(o,e);var i=v(o);function o(e,n){var r;return t(this,o),(r=i.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=n,r.renderMessage(n),r}return n(o,[{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var i=this.createEl("div","timeStamp");if(i.innerHTML="".concat(gi(e.id.split("_")[1]),""),!e.viewed){var n=this.createEl("span","unreadMarker");i.appendChild(n)}this.wrapper.appendChild(i),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}var n=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");n.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&n.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(n),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.createEl("div","buttonsContainer"),n=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(n=!0),i.appendChild(r)})),n&&this.addSnackbar(i),i}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=mi;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var i=this.createEl("div","".concat(t,"Container")),n=this.createEl("img",t);return n.setAttribute("src",e),n.setAttribute("loading","lazy"),i.appendChild(n),i}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var i=this,n=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=n.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){i.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&n.onClickUrl&&(n.openUrlInNewTab?window.open(n.onClickUrl,"_blank"):window.location=n.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),si=function(e){s(o,e);var i=v(o);function o(e){var n;return t(this,o),(n=i.call(this)).isInboxOpen=!1,n.isInboxFromFlutter=!1,n.selectedCategory=null,n.unviewedMessages={},n.unviewedCounter=0,n.isPreview=!1,n.inboxConfigForPreview={},n.inboxSelector=null,n.inbox=null,n.emptyInboxMsg=null,n.inboxCard=null,n.unviewedBadge=null,n.observer=null,n.selectedCategoryRef=null,n.addClickListenerOnDocument=function(e){if(e.composedPath().includes(n.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var i=t[0].id;if("closeInbox"===i)n.toggleInbox();else if(i.startsWith("category-"))n.prevCategoryRef=n.selectedCategoryRef,n.selectedCategoryRef=t[0],n.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],n.isPreview)}}}else(n.inboxSelector.contains(e.target)||n.isInboxOpen)&&(n.isInboxFromFlutter?n.isInboxFromFlutter=!1:n.toggleInbox(e))},n.setBadgeStyle=function(e){null!==n.unviewedBadge&&(n.unviewedBadge.innerText=e>9?"9+":e,n.unviewedBadge.style.display=e>0?"flex":"none")},n.logger=e,n.shadow=n.attachShadow({mode:"open"}),n}return n(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(pe)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),i=t?Object.keys(t):[];0!==i.length&&(i.forEach((function(i){t[i].viewed||(e.unviewedMessages[i]=t[i],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=ui(),i=Math.floor(Date.now()/1e3);for(var n in t)if(t[n].wzrk_ttl&&t[n].wzrk_ttl>0&&t[n].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),pi(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=this.deleteExpiredAndGetUnexpiredMsgs(),n=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=n-r,t.viewed=0,i[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),pi(i),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,i){var n=document.createElement(e);return n.setAttribute("id",t),n.setAttribute("part",i||t),n}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,i=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(i-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),i=this.createEl("div","headerTitle");i.innerText=this.config.title;var n=this.createEl("div","closeInbox");if(n.innerHTML="×",t.appendChild(i),t.appendChild(n),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,i){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),i=this.createEl("div","leftArrow");i.innerHTML=bi,i.children[0].style="transform: rotate(180deg)",i.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(i);var n=this.createEl("div","categoriesWrapper");["All"].concat(g(this.config.categories)).forEach((function(t,i){var o=e.createEl("div","category-".concat(i),"category");o.innerText=t,0===i&&(e.selectedCategoryRef=o),n.appendChild(o)})),t.appendChild(n);var o=this.createEl("div","rightArrow");o.innerHTML=bi,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=n.children[0],s=n.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(i,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var i=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&i++)})),0===i?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var i,n=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=m(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=new ai(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>n;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,i=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,i?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var i=ui();i[e]=t,pi(i)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,i=getComputedStyle(Me.inbox),n=i.getPropertyValue("--inbox-top"),o=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),a=i.getPropertyValue("--inbox-right");if(t>481&&!(n||o||r||a)){var s=vi(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var i=ui();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=gi(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var i,n,o,r,a,s,l,c,d,u,p,h,f,v,g,y,b,m,w,k,C,x=(n=(i=t).panelBackgroundColor,o=i.panelBorderColor,r=i.headerBackgroundColor,a=i.headerTitleColor,s=i.closeIconColor,l=i.categoriesTabColor,c=i.categoriesTitleColor,d=i.categoriesBorderColor,u=i.selectedCategoryTabColor,p=i.selectedCategoryTitleColor,h=i.selectedCategoryBorderColor,f=i.headerCategoryHeight,'\n \n ")),P=this.config.styles.cards;return x+(v={backgroundColor:P.backgroundColor,borderColor:P.borderColor,titleColor:P.titleColor,descriptionColor:P.descriptionColor,buttonColor:P.buttonColor,buttonTextColor:P.buttonTextColor,unreadMarkerColor:P.unreadMarkerColor},g=v.backgroundColor,y=v.borderColor,b=v.titleColor,m=v.descriptionColor,w=v.buttonColor,k=v.buttonTextColor,C=v.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var n="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=n,i[n]=t,e.unviewedMessages[n]=t,e.unviewedCounter++})),this.buildUIForMessages(i),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),li=function(e){e.inbox_preview?Me.inbox.incomingMessagesForPreview=e.inbox_notifs:Me.inbox.incomingMessages=e},ci=function(e){fi(),Me.inbox=new si({logger:e}),document.body.appendChild(Me.inbox)},di=function(e){var t=Le.readFromLSorCookie(he)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var i={};return i[e]=t,Le.saveToLSorCookie(he,i),i}return t},ui=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!xe(e))return{};var t=di(e);return t.hasOwnProperty(e)?t[e]:{}},pi=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(xe(t)){var i=a(a({},di(t)),{},o({},t,e));Le.saveToLSorCookie(he,i)}},hi=function(e){return new Promise((function(t,i){if("complete"===document.readyState)ci(e),t();else{var n=Le.readFromLSorCookie(pe)||{},o=function(){null===Me.inbox&&ci(e),t()};window.addEventListener("load",(function(){if(document.getElementById(n.inboxSelector))o();else{var i=0;if(i<20)var r=setInterval((function(){document.getElementById(n.inboxSelector)?(o(),clearInterval(r),t()):i>=20&&(clearInterval(r),e.debug("Failed to add inbox")),i++}),500)}}))}}))},fi=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",si),customElements.define("ct-inbox-message",ai))},vi=function(e,t,i){var n,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,f=c.top+a,v=c.bottom,g=c.height,y=c.width,b=!1,m=16;if(v+t<=l){var w=l-(v+t);o=w>=m?v+m:v+w}else if(f-t>=a){var k=f-t;o=k>=m?f-t-m:f-t-k}else b=!0,(o=u+g/2-t/2)l&&(o=l-t);if(b){var C=h+i;if(C<=s){n=h+(C+m<=s?m:s-C)}else{var x=p-i;n=x-(x-m>=r?m:x-r)}}else(n=d+y/2-i/2)s&&(n=h-i>=r?h-i:s-i);return{xPos:n,yPos:o}},gi=function(e){var t=Date.now(),i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60))<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago"))},yi=function(){return Object.keys(Le.readFromLSorCookie(pe)||{}).length>0},bi='\n\n\n',mi='\n\n\n',wi="https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css",ki="wve-anti-flicker-show",Ci="wve-anti-flicker-hide",xi="wve-flicker-style",Pi=function(e,t){var i=window.location.search,n=window.opener;if("?ctBuilder"===i)return e.debug("open in visual builder mode"),window.addEventListener("message",Si,!1),void(n&&n.postMessage({message:"builder",originUrl:window.location.href},"*"));"?ctBuilderPreview"===i&&(window.addEventListener("message",Si,!1),n&&n.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===i&&n&&n.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.9.6"},"*")},Si=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,i,n=new URL(e.data.originUrl).origin;if(e.origin===n)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Oi(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&Ai(e.data,!0)}},Oi=function(e,t,i,n){"complete"===document.readyState?Ei(e,t,i,n):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&Ei(e,t,i,n)}))},Ii=!1,_i=!1;function Ei(e,t,i,n){if(!Ii){window.Shopify&&(_i=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(Ct=document.createElement("div")).id="overlayDiv",Ct.style.position="relative",Ct.style.display="flex",document.body.appendChild(Ct);(function(e,t,i,n,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:n,isShopify:_i,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js",e,t,i,n).then((function(){console.log("Overlay script loaded successfully."),Ii=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=wi,document.head.appendChild(o)}var o}var Ai=function(e,t){console.log(e.details);var i=t?e.details:e.display.details,n=!1,o=function(i,n){var o;n.values&&(n.values.html?i.outerHTML=n.values.html:(null===(o=n.values)||void 0===o?void 0:o.json)?function(e,t){var i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);var n=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(n)}(e,n.values):(console.log("updateFormData called with",n.values.form,t),function(e,t,i){if(void 0!==t.style&&Object.keys(t.style).forEach((function(i){e.style.setProperty(i,t.style[i])})),void 0!==t.underline){var n=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(n," underline").trim():e.style.textDecoration=n.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text),void 0!==t.clickDetails){var o=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){return window.open(o,"_blank").focus()}:function(){window.location.href=o}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var r=document.createElement("style");r.innerHTML=t.elementCss,document.head.appendChild(r)}}(i,n.values.form,t)))};i.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,i,r,a=document.querySelector(e.selector);a?(o(a,e),n=!0):(t=e,i=0,r=setInterval((function(){var e=document.querySelector(t.selector);e?(o(e,t),clearInterval(r)):++i>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(r))}),500))}))})),n&&!t&&window.clevertap.renderNotificationViewed({msgId:e.wzrk_id,pivotId:e.wzrk_pivot})};function Li(e){var t,i=e.personalizedSelectors,n=void 0===i?[]:i,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function i(e){var t=[];e.forEach((function(e){var i=document.querySelectorAll(e);i.length?(i.forEach((function(e){var i,n,o,r;i=e.getBoundingClientRect(),n=window,o=n.innerHeight,r=n.innerWidth,i.bottom>0&&i.right>0&&i.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=xi;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(n))})).observe(document.body,{childList:!0,subtree:!0}),l(n)}))}var Mi=function e(t,i){var n,r=i.device,s=i.session,l=i.request,c=i.logger,d=r,u=s,p=l,h=c,f=0,v=function(i){var n=i.wzrk_id.split("_")[0],r=Oe(),a=function(e,t,i){var n=0,o=0;null!=e[t]&&(n=e[t]),n++,null!=e.tc&&(o=e.tc),i<0&&o++,e.tc=o,e[t]=n};if(Le._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var s={},l=xt();s=3===i.display.wtarget_type&&l.hasOwnProperty("wi")?l.wi:0!==i.display.wtarget_type&&1!==i.display.wtarget_type||!l.hasOwnProperty("wp")?{}:l.wp,l.hasOwnProperty("global")&&(s.wp=l),null==i.display.wmc&&(i.display.wmc=1),null==i.display.wimc&&(i.display.wimc=1);var c=-1,f=-1,v=-1,g=-1,y=-1,b=-1,m=-1;null!=i.display.efc&&(c=parseInt(i.display.efc,10)),null!=i.display.mdc&&(f=parseInt(i.display.mdc,10)),null!=i.display.tdc&&(v=parseInt(i.display.tdc,10)),null!=i.display.tlc&&(g=parseInt(i.display.tlc,10)),null!=i.display.wmp&&(y=parseInt(i.display.wmp,10)),null!=i.display.wmc&&(b=parseInt(i.display.wmc,10)),null!=i.display.wimc&&(m=parseInt(i.display.wimc,10));var w=s[u.sessionId];if(w){var k=w[n],C=w.tc;if("dnd"===k&&!Me.dismissSpamControl)return!1;if(3===i.display.wtarget_type){if(m>0&&C>=m&&c<0)return!1}else if(b>0&&C>=b&&c<0)return!1;if(f>0&&k>=f)return!1}else w={},s[u.sessionId]=w;var x=s[r];if(null!=x){var P=x[n],S=x.tc;if(y>0&&S>=y&&c<0)return!1;if(v>0&&P>=v)return!1}else x={},s[r]=x;var O=s.global;if(null!=O){var I=O[n];if(g>0&&I>=g)return!1}else O={},s.global=O}if(null!=i.display.delay&&i.display.delay>0){var _=i.display.delay;return i.display.delay=0,setTimeout(e,1e3*_,t,{device:d,session:u,request:p,logger:h}),!1}a(w,n,c),a(x,n,c),a(O,n,c);var E="wp";3===i.display.wtarget_type&&(E="wi");var A={};A[u.sessionId]=w,A[r]=x,A.global=O,Pt(o({},E,A))},g=function(){var e=d.getGuid(),t=u.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(gt(e+"|"+t.p+"|"+t.s))},y=function(e,t){var i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},b=function(e,t,i,n,o){w(t),function(e,t,i,n,o){if(""!==e&&null!=e){var r,a;o?r=i:null!==i&&null!=(a=i.getElementsByClassName("jsCT_CTA"))&&1===a.length&&(r=a[0]);var s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=g()),null!=r&&(r.onclick=function(){if(null!=s)return null==l&&kt.fireRequest(e),y(s,t),void Lt("-1",0,u.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}}(e,t,i,0,o)},w=function(e){var t={type:"event"};t.evtName=ie,t.evtData=o({},te,e.wzrk_id),e.wzrk_pivot&&(t.evtData=a(a({},t.evtData),{},{wzrk_pivot:e.wzrk_pivot})),p.processEvent(t)},k=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ni);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-banner");n.msgId=e.wzrk_id,n.pivotId=e.wzrk_pivot,n.divHeight=e.display.divHeight,n.details=e.display.details[0];var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},C=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",oi);var i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,n=document.createElement("ct-web-personalisation-carousel");n.target=e;var o=e.display.divId?document.getElementById(i):document.querySelector(i);o.innerHTML="",o.appendChild(n)},x=function(e){var t=e.wzrk_id.split("_")[0],i=e.display;if(2!==i.wtarget_type||1!==e.msgContent.type){if(1===i.layout)return I(void 0,e);if(3===i.layout){var n="wzrkImageOnlyDiv";if(!1===v(e))return;if(Me.dismissSpamControl&&null!=document.getElementById(n))document.getElementById(n).remove();if(null!=document.getElementById(n)||null!=document.getElementById("intentPreview"))return;var o=document.createElement("div");return o.id=n,document.body.appendChild(o),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",ri),function(e){var t=document.createElement("ct-web-popup-imageonly");t.session=u,t.target=e;var i=document.getElementById("wzrkImageOnlyDiv");i.innerHTML="",i.style.visibility="hidden",i.appendChild(t)}(e)}if(!1!==v(e)){var r="wizParDiv"+i.layout;if(Me.dismissSpamControl&&null!=document.getElementById(r))document.getElementById(r).remove();if(null==document.getElementById(r)){Me.campaignDivMap[t]=r;var a=2===i.layout,s=document.createElement("div");s.id=r;var l=window.innerHeight,c=window.innerWidth,d=!1;if(a)s.setAttribute("style",i.iFrameStyle);else{var p=10,h=5*c/100,f=p+5*l/100,g=30*c/100+20,y="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(g=85*c/100+20,h=5*c/100,f=5*l/100,y="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(g=50*c/100+20,h=5*c/100,f=5*l/100,y="width:50%;"),null==i.proto?(d=!0,s.setAttribute("style","display:block;overflow:hidden; bottom:"+f+"px !important;width:"+g+"px !important;right:"+h+"px !important;position:fixed;z-index:2147483647;")):s.setAttribute("style",y+i.iFrameStyle)}document.body.appendChild(s);var m=document.createElement("iframe"),w=!1===i.br?"0":"8";m.frameborder="0px",m.marginheight="0px",m.marginwidth="0px",m.scrolling="no",m.id="wiz-iframe";var k,C=e.display.onClick,x="";if(""!==C&&null!=C&&(x="cursor:pointer;"),i.preview&&i["custom-editor"]&&(m.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)k=(k=(k=e.msgContent.html).replace(/##campaignId##/g,t)).replace(/##campaignId_batchId##/g,e.wzrk_id);else{var S,O,_,E,A,L='";"dark"===e.display.theme?(S="#2d2d2e",O="#eaeaea",_="#353535",E="#353535",A="#ffffff"):(S="#ffffff",O="#000000",E="#f4f4f4",_="#a5a6a6",A="#ffffff");var M=e.msgContent.title,T=e.msgContent.description,R="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(R=""),k=L+("
×
"+R+"
"+M+"
")+("
"+T+"
")}m.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),s.appendChild(m);var j=new Event("CT_campaign_rendered");document.dispatchEvent(j),i["custom-editor"]&&(k=P(e,k)),m.srcdoc=k;var D=function(){p=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||a||(p+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=p+"px"},z=navigator.userAgent.toLowerCase();if(-1!==z.indexOf("safari"))if(z.indexOf("chrome")>-1)m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)};else{var B=m.contentDocument||m.contentWindow;B.document&&(B=B.document);var N=setInterval((function(){if("complete"===B.readyState){clearInterval(N),D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}),300)}else m.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");b(C,e,t,0,d)}}}}else{var U={};U.msgId=e.wzrk_id,e.wzrk_pivot&&(U.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(U.kv=e.msgContent.kv);var F=new CustomEvent("CT_web_native_display",{detail:U});document.dispatchEvent(F)}},P=function(e,t){var i="\n "); + var appendScriptForCustomEvent = function appendScriptForCustomEvent(targetingMsgJson, html) { + var script = "\n "); return html.replace(/(<\s*\/\s*body)/, "".concat(script, "\n$1")); }; - const staleDataUpdate = (staledata, campType) => { - const campObj = getCampaignObject(); - const globalObj = campObj[campType].global; + var staleDataUpdate = function staleDataUpdate(staledata, campType) { + var campObj = getCampaignObject(); + var globalObj = campObj[campType].global; if (globalObj != null && campType) { - for (const idx in staledata) { + for (var idx in staledata) { if (staledata.hasOwnProperty(idx)) { delete globalObj[staledata[idx]]; if (StorageManager.read(CAMP_COOKIE_G)) { - const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); - const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); + var guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))); + var guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME))); if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) { delete guidCampObj[guid][campType][staledata[idx]]; @@ -5014,7 +5657,7 @@ saveCampaignObject(campObj); }; - const mergeEventMap = newEvtMap => { + var mergeEventMap = function mergeEventMap(newEvtMap) { if ($ct.globalEventsMap == null) { $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE); @@ -5024,10 +5667,10 @@ } } - for (const key in newEvtMap) { + for (var key in newEvtMap) { if (newEvtMap.hasOwnProperty(key)) { - const oldEvtObj = $ct.globalEventsMap[key]; - const newEvtObj = newEvtMap[key]; + var oldEvtObj = $ct.globalEventsMap[key]; + var newEvtObj = newEvtMap[key]; if ($ct.globalEventsMap[key] != null) { if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) { @@ -5039,26 +5682,24 @@ } } }; - const incrementImpression = (targetingMsgJson, _request) => { - const data = {}; + var incrementImpression = function incrementImpression(targetingMsgJson, _request) { + var data = {}; data.type = 'event'; data.evtName = NOTIFICATION_VIEWED; - data.evtData = { - [WZRK_ID]: targetingMsgJson.wzrk_id - }; + data.evtData = _defineProperty({}, WZRK_ID, targetingMsgJson.wzrk_id); if (targetingMsgJson.wzrk_pivot) { - data.evtData = { ...data.evtData, + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { wzrk_pivot: targetingMsgJson.wzrk_pivot - }; + }); } _request.processEvent(data); }; - const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => { + var setupClickEvent = function setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) { if (onClick !== '' && onClick != null) { - let ctaElement; - let jsCTAElements; + var ctaElement; + var jsCTAElements; if (isLegacy) { ctaElement = contentDiv; @@ -5070,15 +5711,15 @@ } } - const jsFunc = targetingMsgJson.display.jsFunc; - const isPreview = targetingMsgJson.display.preview; + var jsFunc = targetingMsgJson.display.jsFunc; + var isPreview = targetingMsgJson.display.preview; if (isPreview == null) { onClick += getCookieParams(_device, _session); } if (ctaElement != null) { - ctaElement.onclick = () => { + ctaElement.onclick = function () { // invoke js function call if (jsFunc != null) { // track notification clicked event @@ -5090,8 +5731,8 @@ closeIframe('-1', divId, _session.sessionId); } else { - const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r'); - const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r'); + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; if (rValue === 'pushPrompt') { if (!targetingMsgJson.display.preview) { @@ -5133,33 +5774,33 @@ } } }; - const getCookieParams = (_device, _session) => { - const gcookie = _device.getGuid(); + var getCookieParams = function getCookieParams(_device, _session) { + var gcookie = _device.getGuid(); - const scookieObj = _session.getSessionCookieObject(); + var scookieObj = _session.getSessionCookieObject(); return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s)); }; - const renderPopUpImageOnly = (targetingMsgJson, _session) => { - const divId = 'wzrkImageOnlyDiv'; - const popupImageOnly = document.createElement('ct-web-popup-imageonly'); + var renderPopUpImageOnly = function renderPopUpImageOnly(targetingMsgJson, _session) { + var divId = 'wzrkImageOnlyDiv'; + var popupImageOnly = document.createElement('ct-web-popup-imageonly'); popupImageOnly.session = _session; popupImageOnly.target = targetingMsgJson; - const containerEl = document.getElementById(divId); + var containerEl = document.getElementById(divId); containerEl.innerHTML = ''; containerEl.style.visibility = 'hidden'; containerEl.appendChild(popupImageOnly); }; - const getBoxPromptStyles = style => { - const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0; - const cardPadding = 16 * 2; // Left and right padding + var getBoxPromptStyles = function getBoxPromptStyles(style) { + var totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0; + var cardPadding = 16 * 2; // Left and right padding - const cardContentWidth = 360 - cardPadding - totalBorderWidth; + var cardContentWidth = 360 - cardPadding - totalBorderWidth; return "\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ".concat(style.overlay.color || 'rgba(0, 0, 0, .15)', ";\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ").concat(style.card.color, ";\n border-radius: ").concat(style.card.borderRadius, "px;\n padding: 16px;\n width: ").concat(cardContentWidth, "px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ").concat(style.card.borderEnabled ? "\n border-width: ".concat(style.card.border.borderWidth, "px;\n border-color: ").concat(style.card.border.borderColor, ";\n border-style: solid;\n ") : '', "\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ").concat(style.text.titleColor, ";\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ").concat(style.text.descriptionColor, ";\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ").concat(style.buttons.primaryButton.buttonColor, ";\n color: ").concat(style.buttons.primaryButton.textColor, ";\n border-radius: ").concat(style.buttons.primaryButton.borderRadius, "px;\n ").concat(style.buttons.primaryButton.borderEnabled ? "\n border-width: ".concat(style.buttons.primaryButton.border.borderWidth, "px;\n border-color: ").concat(style.buttons.primaryButton.border.borderColor, ";\n border-style: solid;\n ") : 'border: none;', "\n }\n\n #secondaryButton {\n background-color: ").concat(style.buttons.secondaryButton.buttonColor, ";\n color: ").concat(style.buttons.secondaryButton.textColor, ";\n border-radius: ").concat(style.buttons.secondaryButton.borderRadius, "px;\n ").concat(style.buttons.secondaryButton.borderEnabled ? "\n border-width: ".concat(style.buttons.secondaryButton.border.borderWidth, "px;\n border-color: ").concat(style.buttons.secondaryButton.border.borderColor, ";\n border-style: solid;\n ") : 'border: none;', "\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n "); }; - const getBellIconStyles = style => { + var getBellIconStyles = function getBellIconStyles(style) { return "\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ".concat(style.card.backgroundColor, ";\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n "); }; @@ -5187,118 +5828,133 @@ var _handleNotificationRegistration = _classPrivateFieldLooseKey("handleNotificationRegistration"); - class NotificationHandler extends Array { - constructor(_ref, values) { - let { - logger, - session, - request, - account - } = _ref; - super(); - Object.defineProperty(this, _handleNotificationRegistration, { + var NotificationHandler = /*#__PURE__*/function (_Array) { + _inherits(NotificationHandler, _Array); + + var _super = _createSuper(NotificationHandler); + + function NotificationHandler(_ref, values) { + var _this; + + var logger = _ref.logger, + session = _ref.session, + request = _ref.request, + account = _ref.account; + + _classCallCheck(this, NotificationHandler); + + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _handleNotificationRegistration, { value: _handleNotificationRegistration2 }); - Object.defineProperty(this, _removeWizAlertJS, { + Object.defineProperty(_assertThisInitialized(_this), _removeWizAlertJS, { value: _removeWizAlertJS2 }); - Object.defineProperty(this, _addWizAlertJS, { + Object.defineProperty(_assertThisInitialized(_this), _addWizAlertJS, { value: _addWizAlertJS2 }); - Object.defineProperty(this, _setUpChromeFirefoxNotifications, { + Object.defineProperty(_assertThisInitialized(_this), _setUpChromeFirefoxNotifications, { value: _setUpChromeFirefoxNotifications2 }); - Object.defineProperty(this, _setUpSafariNotifications, { + Object.defineProperty(_assertThisInitialized(_this), _setUpSafariNotifications, { value: _setUpSafariNotifications2 }); - Object.defineProperty(this, _setUpWebPush, { + Object.defineProperty(_assertThisInitialized(_this), _setUpWebPush, { value: _setUpWebPush2 }); - Object.defineProperty(this, _oldValues$3, { + Object.defineProperty(_assertThisInitialized(_this), _oldValues$3, { writable: true, value: void 0 }); - Object.defineProperty(this, _logger$5, { + Object.defineProperty(_assertThisInitialized(_this), _logger$5, { writable: true, value: void 0 }); - Object.defineProperty(this, _request$4, { + Object.defineProperty(_assertThisInitialized(_this), _request$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _account$2, { + Object.defineProperty(_assertThisInitialized(_this), _account$2, { writable: true, value: void 0 }); - Object.defineProperty(this, _wizAlertJSPath, { + Object.defineProperty(_assertThisInitialized(_this), _wizAlertJSPath, { writable: true, value: void 0 }); - Object.defineProperty(this, _fcmPublicKey, { + Object.defineProperty(_assertThisInitialized(_this), _fcmPublicKey, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; - _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = null; - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = values; - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5] = logger; - _classPrivateFieldLooseBase(this, _request$4)[_request$4] = request; - _classPrivateFieldLooseBase(this, _account$2)[_account$2] = account; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _wizAlertJSPath)[_wizAlertJSPath] = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _fcmPublicKey)[_fcmPublicKey] = null; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$3)[_oldValues$3] = values; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$5)[_logger$5] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$4)[_request$4] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$2)[_account$2] = account; + return _this; } - push() { - for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { - displayArgs[_key] = arguments[_key]; - } - - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - - return 0; - } + _createClass(NotificationHandler, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, displayArgs = new Array(_len), _key = 0; _key < _len; _key++) { + displayArgs[_key] = arguments[_key]; + } - enable() { - let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - const { - swPath - } = options; - enablePush(_classPrivateFieldLooseBase(this, _logger$5)[_logger$5], _classPrivateFieldLooseBase(this, _account$2)[_account$2], _classPrivateFieldLooseBase(this, _request$4)[_request$4], swPath); - } + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](displayArgs); - _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { - _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); + return 0; } - - _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; - } - - setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) { - if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) { - _classPrivateFieldLooseBase(this, _setUpChromeFirefoxNotifications)[_setUpChromeFirefoxNotifications](subscriptionCallback, serviceWorkerPath); - } else if (navigator.userAgent.indexOf('Safari') !== -1) { - _classPrivateFieldLooseBase(this, _setUpSafariNotifications)[_setUpSafariNotifications](subscriptionCallback, apnsWebPushId, apnsServiceUrl); + }, { + key: "enable", + value: function enable() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var swPath = options.swPath; + enablePush(_classPrivateFieldLooseBase(this, _logger$5)[_logger$5], _classPrivateFieldLooseBase(this, _account$2)[_account$2], _classPrivateFieldLooseBase(this, _request$4)[_request$4], swPath); } - } - - setApplicationServerKey(applicationServerKey) { - _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = applicationServerKey; - } - - _enableWebPush(enabled, applicationServerKey) { - $ct.webPushEnabled = enabled; + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]) { + _classPrivateFieldLooseBase(this, _setUpWebPush)[_setUpWebPush](_classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3]); + } - if (applicationServerKey != null) { - this.setApplicationServerKey(applicationServerKey); + _classPrivateFieldLooseBase(this, _oldValues$3)[_oldValues$3] = null; + } + }, { + key: "setUpWebPushNotifications", + value: function setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) { + if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) { + _classPrivateFieldLooseBase(this, _setUpChromeFirefoxNotifications)[_setUpChromeFirefoxNotifications](subscriptionCallback, serviceWorkerPath); + } else if (navigator.userAgent.indexOf('Safari') !== -1) { + _classPrivateFieldLooseBase(this, _setUpSafariNotifications)[_setUpSafariNotifications](subscriptionCallback, apnsWebPushId, apnsServiceUrl); + } + } + }, { + key: "setApplicationServerKey", + value: function setApplicationServerKey(applicationServerKey) { + _classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] = applicationServerKey; } + }, { + key: "_enableWebPush", + value: function _enableWebPush(enabled, applicationServerKey) { + $ct.webPushEnabled = enabled; + + if (applicationServerKey != null) { + this.setApplicationServerKey(applicationServerKey); + } - if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); - } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _handleNotificationRegistration)[_handleNotificationRegistration]($ct.notifApi.displayArgs); + } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) { + _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that web push notifications are fully enabled and integrated before requesting them'); + } } - } + }]); - } + return NotificationHandler; + }( /*#__PURE__*/_wrapNativeSuper(Array)); var _setUpWebPush2 = function _setUpWebPush2(displayArgs) { if ($ct.webPushEnabled && displayArgs.length > 0) { @@ -5312,6 +5968,8 @@ }; var _setUpSafariNotifications2 = function _setUpSafariNotifications2(subscriptionCallback, apnsWebPushId, apnsServiceUrl) { + var _this2 = this; + // ensure that proper arguments are passed if (typeof apnsWebPushId === 'undefined') { _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Ensure that APNS Web Push ID is supplied'); @@ -5322,70 +5980,82 @@ } if ('safari' in window && 'pushNotification' in window.safari) { - window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, subscription => { + window.safari.pushNotification.requestPermission(apnsServiceUrl, apnsWebPushId, {}, function (subscription) { if (subscription.permission === 'granted') { - const subscriptionData = JSON.parse(JSON.stringify(subscription)); + var subscriptionData = JSON.parse(JSON.stringify(subscription)); subscriptionData.endpoint = subscription.deviceToken; subscriptionData.browser = 'Safari'; StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(this, _request$4)[_request$4].registerToken(subscriptionData); + _classPrivateFieldLooseBase(_this2, _request$4)[_request$4].registerToken(subscriptionData); - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); + _classPrivateFieldLooseBase(_this2, _logger$5)[_logger$5].info('Safari Web Push registered. Device Token: ' + subscription.deviceToken); } else if (subscription.permission === 'denied') { - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].info('Error subscribing to Safari web push'); + _classPrivateFieldLooseBase(_this2, _logger$5)[_logger$5].info('Error subscribing to Safari web push'); } }); } }; var _setUpChromeFirefoxNotifications2 = function _setUpChromeFirefoxNotifications2(subscriptionCallback, serviceWorkerPath) { - let registrationScope = ''; + var _this3 = this; + + var registrationScope = ''; if ('serviceWorker' in navigator) { - navigator.serviceWorker.register(serviceWorkerPath).then(registration => { + navigator.serviceWorker.register(serviceWorkerPath).then(function (registration) { if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved. // hence add a timeout and hope serviceWroker is ready within that time. - return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); } registrationScope = registration.scope; // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS // OR getRegistrations PROMISE IF ITS FIREFOX - const rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; - const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); + var rootDirRegex = /^(\.?)(\/?)([^/]*).js$/; + var isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath); if (isServiceWorkerAtRoot) { return navigator.serviceWorker.ready; } else { if (navigator.userAgent.indexOf('Chrome') !== -1) { - return new Promise(resolve => setTimeout(() => resolve(registration), 5000)); + return new Promise(function (resolve) { + return setTimeout(function () { + return resolve(registration); + }, 5000); + }); } else { return navigator.serviceWorker.getRegistrations(); } } - }).then(serviceWorkerRegistration => { + }).then(function (serviceWorkerRegistration) { // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) { - serviceWorkerRegistration = serviceWorkerRegistration.filter(i => i.scope === registrationScope)[0]; + serviceWorkerRegistration = serviceWorkerRegistration.filter(function (i) { + return i.scope === registrationScope; + })[0]; } - const subscribeObj = { + var subscribeObj = { userVisibleOnly: true }; - if (_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey] != null) { - subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(this, _fcmPublicKey)[_fcmPublicKey]); + if (_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey] != null) { + subscribeObj.applicationServerKey = urlBase64ToUint8Array(_classPrivateFieldLooseBase(_this3, _fcmPublicKey)[_fcmPublicKey]); } - serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(subscription => { - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC + serviceWorkerRegistration.pushManager.subscribe(subscribeObj).then(function (subscription) { + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].info('Service Worker registered. Endpoint: ' + subscription.endpoint); // convert the subscription keys to strings; this sets it up nicely for pushing to LC - const subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token + var subscriptionData = JSON.parse(JSON.stringify(subscription)); // remove the common chrome/firefox endpoint at the beginning of the token if (navigator.userAgent.indexOf('Chrome') !== -1) { subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop(); @@ -5397,45 +6067,45 @@ StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData); - _classPrivateFieldLooseBase(this, _request$4)[_request$4].registerToken(subscriptionData); + _classPrivateFieldLooseBase(_this3, _request$4)[_request$4].registerToken(subscriptionData); if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') { subscriptionCallback(); } - const existingBellWrapper = document.getElementById('bell_wrapper'); + var existingBellWrapper = document.getElementById('bell_wrapper'); if (existingBellWrapper) { existingBellWrapper.parentNode.removeChild(existingBellWrapper); } - }).catch(error => { + }).catch(function (error) { // unsubscribe from webpush if error - serviceWorkerRegistration.pushManager.getSubscription().then(subscription => { + serviceWorkerRegistration.pushManager.getSubscription().then(function (subscription) { if (subscription !== null) { - subscription.unsubscribe().then(successful => { + subscription.unsubscribe().then(function (successful) { // You've successfully unsubscribed - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].info('Unsubscription successful'); + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].info('Unsubscription successful'); window.clevertap.notifications.push({ skipDialog: true }); - }).catch(e => { + }).catch(function (e) { // Unsubscription failed - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Error unsubscribing: ' + e); + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('Error unsubscribing: ' + e); }); } }); - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Error subscribing: ' + error); + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('Error subscribing: ' + error); }); - }).catch(err => { - _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('error registering service worker: ' + err); + }).catch(function (err) { + _classPrivateFieldLooseBase(_this3, _logger$5)[_logger$5].error('error registering service worker: ' + err); }); } }; var _addWizAlertJS2 = function _addWizAlertJS2() { - const scriptTag = document.createElement('script'); + var scriptTag = document.createElement('script'); scriptTag.setAttribute('type', 'text/javascript'); scriptTag.setAttribute('id', 'wzrk-alert-js'); scriptTag.setAttribute('src', _classPrivateFieldLooseBase(this, _wizAlertJSPath)[_wizAlertJSPath]); // add the script tag to the end of the body @@ -5445,31 +6115,33 @@ }; var _removeWizAlertJS2 = function _removeWizAlertJS2() { - const scriptTag = document.getElementById('wzrk-alert-js'); + var scriptTag = document.getElementById('wzrk-alert-js'); scriptTag.parentNode.removeChild(scriptTag); }; var _handleNotificationRegistration2 = function _handleNotificationRegistration2(displayArgs) { + var _this4 = this; + // make sure everything is specified - let titleText; - let bodyText; - let okButtonText; - let rejectButtonText; - let okButtonColor; - let skipDialog; - let askAgainTimeInSeconds; - let okCallback; - let rejectCallback; - let subscriptionCallback; - let serviceWorkerPath; - let httpsPopupPath; - let httpsIframePath; - let apnsWebPushId; - let apnsWebPushServiceUrl; + var titleText; + var bodyText; + var okButtonText; + var rejectButtonText; + var okButtonColor; + var skipDialog; + var askAgainTimeInSeconds; + var okCallback; + var rejectCallback; + var subscriptionCallback; + var serviceWorkerPath; + var httpsPopupPath; + var httpsIframePath; + var apnsWebPushId; + var apnsWebPushServiceUrl; if (displayArgs.length === 1) { if (isObject(displayArgs[0])) { - const notifObj = displayArgs[0]; + var notifObj = displayArgs[0]; titleText = notifObj.titleText; bodyText = notifObj.bodyText; okButtonText = notifObj.okButtonText; @@ -5509,7 +6181,7 @@ return; } - const isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications + var isHTTP = httpsPopupPath != null && httpsIframePath != null; // make sure the site is on https for chrome notifications if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) { _classPrivateFieldLooseBase(this, _logger$5)[_logger$5].error('Make sure you are https or localhost to register for notifications'); @@ -5519,19 +6191,19 @@ if (navigator.userAgent.indexOf('Chrome') !== -1) { - const chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); + var chromeAgent = navigator.userAgent.match(/Chrome\/(\d+)/); if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Firefox') !== -1) { - const firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); + var firefoxAgent = navigator.userAgent.match(/Firefox\/(\d+)/); if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return; } } else if (navigator.userAgent.indexOf('Safari') !== -1) { - const safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); + var safariAgent = navigator.userAgent.match(/Safari\/(\d+)/); if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return; @@ -5575,7 +6247,7 @@ } // make sure the user isn't asked for notifications more than askAgainTimeInSeconds - const now = new Date().getTime() / 1000; + var now = new Date().getTime() / 1000; if (StorageManager.getMetaProp('notif_last_time') == null) { StorageManager.setMetaProp('notif_last_time', now); @@ -5595,13 +6267,13 @@ if (isHTTP) { // add the https iframe - const httpsIframe = document.createElement('iframe'); + var httpsIframe = document.createElement('iframe'); httpsIframe.setAttribute('style', 'display:none;'); httpsIframe.setAttribute('src', httpsIframePath); document.body.appendChild(httpsIframe); - window.addEventListener('message', event => { + window.addEventListener('message', function (event) { if (event.data != null) { - let obj = {}; + var obj = {}; try { obj = JSON.parse(event.data); @@ -5612,7 +6284,7 @@ if (obj.state != null) { if (obj.from === 'ct' && obj.state === 'not') { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { + _classPrivateFieldLooseBase(_this4, _addWizAlertJS)[_addWizAlertJS]().onload = function () { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -5620,7 +6292,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, enabled => { + }, function (enabled) { // callback function if (enabled) { // the user accepted on the dialog box @@ -5636,7 +6308,7 @@ } } - _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } @@ -5644,7 +6316,7 @@ } }, false); } else { - _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = () => { + _classPrivateFieldLooseBase(this, _addWizAlertJS)[_addWizAlertJS]().onload = function () { // create our wizrocket popup window.wzrkPermissionPopup.wizAlert({ title: titleText, @@ -5652,7 +6324,7 @@ confirmButtonText: okButtonText, confirmButtonColor: okButtonColor, rejectButtonText: rejectButtonText - }, enabled => { + }, function (enabled) { // callback function if (enabled) { // the user accepted on the dialog box @@ -5660,29 +6332,29 @@ okCallback(); } - this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); + _this4.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl); } else { if (typeof rejectCallback === 'function') { rejectCallback(); } } - _classPrivateFieldLooseBase(this, _removeWizAlertJS)[_removeWizAlertJS](); + _classPrivateFieldLooseBase(_this4, _removeWizAlertJS)[_removeWizAlertJS](); }); }; } }; - const B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Key = null; - let swPath = '/clevertap_sw.js'; - let notificationHandler = null; - const processWebPushConfig = (webPushConfig, logger, request) => { - const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; + var appServerKey = null; + var swPath = '/clevertap_sw.js'; + var notificationHandler = null; + var processWebPushConfig = function processWebPushConfig(webPushConfig, logger, request) { + var _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; - const updatePushConfig = () => { + var updatePushConfig = function updatePushConfig() { $ct.pushConfig = webPushConfig; StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig); }; @@ -5694,8 +6366,8 @@ updatePushConfig(); } }; - const enablePush = (logger, account, request, customSwPath) => { - const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; + var enablePush = function enablePush(logger, account, request, customSwPath) { + var _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}; $ct.pushConfig = _pushConfig; @@ -5709,17 +6381,16 @@ } notificationHandler = new NotificationHandler({ - logger, + logger: logger, session: {}, - request, - account + request: request, + account: account }); - const { - showBox, - boxType, - showBellIcon, - isPreview - } = $ct.pushConfig; + var _$ct$pushConfig = $ct.pushConfig, + showBox = _$ct$pushConfig.showBox, + boxType = _$ct$pushConfig.boxType, + showBellIcon = _$ct$pushConfig.showBellIcon, + isPreview = _$ct$pushConfig.isPreview; if (isPreview) { if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig); @@ -5730,43 +6401,43 @@ } }; - const createElementWithAttributes = function (tag) { - let attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const element = document.createElement(tag); - Object.entries(attributes).forEach((_ref) => { - let [key, value] = _ref; + var createElementWithAttributes = function createElementWithAttributes(tag) { + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var element = document.createElement(tag); + Object.entries(attributes).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + element[key] = value; }); return element; }; - const createNotificationBox = configData => { + var createNotificationBox = function createNotificationBox(configData) { if (document.getElementById('pnWrapper')) return; - const { - boxConfig: { - content, - style - } - } = configData; // Create the wrapper div + var _configData$boxConfig = configData.boxConfig, + content = _configData$boxConfig.content, + style = _configData$boxConfig.style; // Create the wrapper div - const wrapper = createElementWithAttributes('div', { + var wrapper = createElementWithAttributes('div', { id: 'pnWrapper' }); - const overlayDiv = createElementWithAttributes('div', { + var overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' }); - const pnCard = createElementWithAttributes('div', { + var pnCard = createElementWithAttributes('div', { id: 'pnCard' }); - const iconTitleDescWrapper = createElementWithAttributes('div', { + var iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' }); - const iconContainer = createElementWithAttributes('img', { + var iconContainer = createElementWithAttributes('img', { id: 'iconContainer', src: content.icon.type === 'default' ? "data:image/svg+xml;base64,".concat(PROMPT_BELL_BASE64) : content.icon.url }); iconTitleDescWrapper.appendChild(iconContainer); - const titleDescWrapper = createElementWithAttributes('div', { + var titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' }); titleDescWrapper.appendChild(createElementWithAttributes('div', { @@ -5778,14 +6449,14 @@ textContent: content.description })); iconTitleDescWrapper.appendChild(titleDescWrapper); - const buttonsContainer = createElementWithAttributes('div', { + var buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' }); - const primaryButton = createElementWithAttributes('button', { + var primaryButton = createElementWithAttributes('button', { id: 'primaryButton', textContent: content.buttons.primaryButtonText }); - const secondaryButton = createElementWithAttributes('button', { + var secondaryButton = createElementWithAttributes('button', { id: 'secondaryButton', textContent: content.buttons.secondaryButtonText }); @@ -5794,16 +6465,16 @@ pnCard.appendChild(iconTitleDescWrapper); pnCard.appendChild(buttonsContainer); // Apply styles - const styleElement = createElementWithAttributes('style', { + var styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) }); wrapper.appendChild(styleElement); wrapper.appendChild(pnCard); wrapper.appendChild(overlayDiv); setElementPosition(pnCard, style.card.position); - const now = new Date().getTime() / 1000; - const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time'); - const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60; + var now = new Date().getTime() / 1000; + var lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time'); + var popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60; if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) { document.body.appendChild(wrapper); @@ -5813,31 +6484,28 @@ } } }; - const createBellIcon = configData => { + var createBellIcon = function createBellIcon(configData) { if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return; - const { - bellIconConfig: { - content, - style - } - } = configData; - const bellWrapper = createElementWithAttributes('div', { + var _configData$bellIconC = configData.bellIconConfig, + content = _configData$bellIconC.content, + style = _configData$bellIconC.style; + var bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' }); - const bellIcon = createElementWithAttributes('img', { + var bellIcon = createElementWithAttributes('img', { id: 'bell_icon', src: content.icon.type === 'default' ? "data:image/svg+xml;base64,".concat(BELL_BASE64) : content.icon.url }); // For playing gif - const gifModal = createElementWithAttributes('div', { + var gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' }); - const gifImage = createElementWithAttributes('img', { + var gifImage = createElementWithAttributes('img', { id: 'gif_image', src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif' }); - const closeModal = createElementWithAttributes('div', { + var closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' }); @@ -5847,7 +6515,7 @@ bellWrapper.appendChild(gifModal); if (content.hoverText.enabled) { - const tooltip = createElementWithAttributes('div', { + var tooltip = createElementWithAttributes('div', { id: 'bell_tooltip', textContent: content.hoverText.text }); @@ -5856,7 +6524,7 @@ setElementPosition(bellWrapper, style.card.position); // Apply styles - const styleElement = createElementWithAttributes('style', { + var styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) }); document.head.appendChild(styleElement); @@ -5868,32 +6536,32 @@ return bellWrapper; }; - const setServerKey = serverKey => { + var setServerKey = function setServerKey(serverKey) { appServerKey = serverKey; }; - const addEventListeners = wrapper => { - const primaryButton = wrapper.querySelector('#primaryButton'); - const secondaryButton = wrapper.querySelector('#secondaryButton'); + var addEventListeners = function addEventListeners(wrapper) { + var primaryButton = wrapper.querySelector('#primaryButton'); + var secondaryButton = wrapper.querySelector('#secondaryButton'); - const removeWrapper = () => { + var removeWrapper = function removeWrapper() { var _wrapper$parentNode; return (_wrapper$parentNode = wrapper.parentNode) === null || _wrapper$parentNode === void 0 ? void 0 : _wrapper$parentNode.removeChild(wrapper); }; - primaryButton.addEventListener('click', () => { + primaryButton.addEventListener('click', function () { removeWrapper(); notificationHandler.setApplicationServerKey(appServerKey); notificationHandler.setUpWebPushNotifications(null, swPath, null, null); }); - secondaryButton.addEventListener('click', () => { + secondaryButton.addEventListener('click', function () { StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000); removeWrapper(); }); }; - const addBellEventListeners = bellWrapper => { - const bellIcon = bellWrapper.querySelector('#bell_icon'); - bellIcon.addEventListener('click', () => { + var addBellEventListeners = function addBellEventListeners(bellWrapper) { + var bellIcon = bellWrapper.querySelector('#bell_icon'); + bellIcon.addEventListener('click', function () { if (Notification.permission === 'denied') { toggleGifModal(bellWrapper); } else { @@ -5905,16 +6573,22 @@ } } }); - bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper)); - bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper)); - bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper)); + bellIcon.addEventListener('mouseenter', function () { + return displayTooltip(bellWrapper); + }); + bellIcon.addEventListener('mouseleave', function () { + return clearTooltip(bellWrapper); + }); + bellWrapper.querySelector('#close_modal').addEventListener('click', function () { + return toggleGifModal(bellWrapper); + }); }; - const setElementPosition = (element, position) => { + var setElementPosition = function setElementPosition(element, position) { Object.assign(element.style, { inset: 'auto', transform: 'none' }); - const positions = { + var positions = { 'Top Right': { inset: '16px 16px auto auto' }, @@ -5943,61 +6617,59 @@ Object.assign(element.style, positions[position] || positions['top-right']); }; - const displayTooltip = bellWrapper => { - const gifModal = bellWrapper.querySelector('#gif_modal'); + var displayTooltip = function displayTooltip(bellWrapper) { + var gifModal = bellWrapper.querySelector('#gif_modal'); if (gifModal.style.display === 'flex') { return; } - const tooltip = bellWrapper.querySelector('#bell_tooltip'); + var tooltip = bellWrapper.querySelector('#bell_tooltip'); if (tooltip) { tooltip.style.display = 'flex'; } - const bellIcon = bellWrapper.querySelector('#bell_icon'); - const bellRect = bellIcon.getBoundingClientRect(); + var bellIcon = bellWrapper.querySelector('#bell_icon'); + var bellRect = bellIcon.getBoundingClientRect(); var midX = window.innerWidth / 2; var midY = window.innerHeight / 2; bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'; bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'; }; - const clearTooltip = bellWrapper => { - const tooltip = bellWrapper.querySelector('#bell_tooltip'); + var clearTooltip = function clearTooltip(bellWrapper) { + var tooltip = bellWrapper.querySelector('#bell_tooltip'); if (tooltip) { tooltip.style.display = 'none'; } }; - const toggleGifModal = bellWrapper => { + var toggleGifModal = function toggleGifModal(bellWrapper) { clearTooltip(bellWrapper); - const gifModal = bellWrapper.querySelector('#gif_modal'); + var gifModal = bellWrapper.querySelector('#gif_modal'); gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'; }; - const _tr = (msg, _ref) => { - let { - device, - session, - request, - logger - } = _ref; - const _device = device; - const _session = session; - const _request = request; - const _logger = logger; - let _wizCounter = 0; // Campaign House keeping - - const doCampHouseKeeping = targetingMsgJson => { - const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - const today = getToday(); - - const incrCount = (obj, campaignId, excludeFromFreqCaps) => { - let currentCount = 0; - let totalCount = 0; + var _tr = function _tr(msg, _ref) { + var device = _ref.device, + session = _ref.session, + request = _ref.request, + logger = _ref.logger; + var _device = device; + var _session = session; + var _request = request; + var _logger = logger; + var _wizCounter = 0; // Campaign House keeping + + var doCampHouseKeeping = function doCampHouseKeeping(targetingMsgJson) { + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var today = getToday(); + + var incrCount = function incrCount(obj, campaignId, excludeFromFreqCaps) { + var currentCount = 0; + var totalCount = 0; if (obj[campaignId] != null) { currentCount = obj[campaignId]; @@ -6021,7 +6693,7 @@ if (StorageManager._isLocalStorageSupported()) { delete sessionStorage[CAMP_COOKIE_NAME]; var campTypeObj = {}; - const campObj = getCampaignObject(); + var campObj = getCampaignObject(); if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) { campTypeObj = campObj.wi; @@ -6047,16 +6719,16 @@ var excludeFromFreqCaps = -1; // efc - Exclude from frequency caps - let campaignSessionLimit = -1; // mdc - Once per session + var campaignSessionLimit = -1; // mdc - Once per session - let campaignDailyLimit = -1; // tdc - Once per day + var campaignDailyLimit = -1; // tdc - Once per day - let campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign + var campaignTotalLimit = -1; // tlc - Once per user for the duration of campaign - let totalDailyLimit = -1; - let totalSessionLimit = -1; // wmc - Web Popup Global Session Limit + var totalDailyLimit = -1; + var totalSessionLimit = -1; // wmc - Web Popup Global Session Limit - let totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit + var totalInboxSessionLimit = -1; // wimc - Web Inbox Global Session Limit if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap @@ -6097,8 +6769,8 @@ var sessionObj = campTypeObj[_session.sessionId]; if (sessionObj) { - const campaignSessionCount = sessionObj[campaignId]; - const totalSessionCount = sessionObj.tc; // dnd + var campaignSessionCount = sessionObj[campaignId]; + var totalSessionCount = sessionObj.tc; // dnd if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) { return false; @@ -6129,8 +6801,8 @@ var dailyObj = campTypeObj[today]; if (dailyObj != null) { - const campaignDailyCount = dailyObj[campaignId]; - const totalDailyCount = dailyObj.tc; // daily + var campaignDailyCount = dailyObj[campaignId]; + var totalDailyCount = dailyObj.tc; // daily if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) { return false; @@ -6148,7 +6820,7 @@ var globalObj = campTypeObj[GLOBAL]; if (globalObj != null) { - const campaignTotalCount = globalObj[campaignId]; // campaign total + var campaignTotalCount = globalObj[campaignId]; // campaign total if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) { return false; @@ -6160,10 +6832,10 @@ } // delay - const displayObj = targetingMsgJson.display; + var displayObj = targetingMsgJson.display; if (displayObj.delay != null && displayObj.delay > 0) { - const delay = displayObj.delay; + var delay = displayObj.delay; displayObj.delay = 0; setTimeout(_tr, delay * 1000, msg, { device: _device, @@ -6177,36 +6849,34 @@ incrCount(sessionObj, campaignId, excludeFromFreqCaps); incrCount(dailyObj, campaignId, excludeFromFreqCaps); incrCount(globalObj, campaignId, excludeFromFreqCaps); - let campKey = 'wp'; + var campKey = 'wp'; if (targetingMsgJson[DISPLAY].wtarget_type === 3) { campKey = 'wi'; } // get ride of stale sessions and day entries - const newCampObj = {}; + var newCampObj = {}; newCampObj[_session.sessionId] = sessionObj; newCampObj[today] = dailyObj; newCampObj[GLOBAL] = globalObj; - saveCampaignObject({ - [campKey]: newCampObj - }); + saveCampaignObject(_defineProperty({}, campKey, newCampObj)); }; - const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => { + var setupClickUrl = function setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, isLegacy) { incrementImpression(targetingMsgJson, _request); setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session); }; - const handleImageOnlyPopup = targetingMsgJson => { - const divId = 'wzrkImageOnlyDiv'; + var handleImageOnlyPopup = function handleImageOnlyPopup(targetingMsgJson) { + var divId = 'wzrkImageOnlyDiv'; if (doCampHouseKeeping(targetingMsgJson) === false) { return; } if ($ct.dismissSpamControl && document.getElementById(divId) != null) { - const element = document.getElementById(divId); + var element = document.getElementById(divId); element.remove(); } // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist @@ -6215,7 +6885,7 @@ return; } - const msgDiv = document.createElement('div'); + var msgDiv = document.createElement('div'); msgDiv.id = divId; document.body.appendChild(msgDiv); @@ -6226,20 +6896,20 @@ return renderPopUpImageOnly(targetingMsgJson, _session); }; - const isExistingCampaign = campaignId => { - const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe'); + var isExistingCampaign = function isExistingCampaign(campaignId) { + var testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe'); if (testIframe) { - const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document; + var iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document; return iframeDocument.documentElement.innerHTML.includes(campaignId); } return false; }; - const createTemplate = (targetingMsgJson, isExitIntent) => { - const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - const displayObj = targetingMsgJson.display; + var createTemplate = function createTemplate(targetingMsgJson, isExitIntent) { + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var displayObj = targetingMsgJson.display; if (displayObj.layout === 1) { // Handling Web Exit Intent @@ -6256,12 +6926,12 @@ return; } - const divId = 'wizParDiv' + displayObj.layout; - const opacityDivId = 'intentOpacityDiv' + displayObj.layout; + var divId = 'wizParDiv' + displayObj.layout; + var opacityDivId = 'intentOpacityDiv' + displayObj.layout; if ($ct.dismissSpamControl && document.getElementById(divId) != null) { - const element = document.getElementById(divId); - const opacityElement = document.getElementById(opacityDivId); + var element = document.getElementById(divId); + var opacityElement = document.getElementById(opacityDivId); if (element) { element.remove(); @@ -6279,30 +6949,30 @@ } $ct.campaignDivMap[campaignId] = divId; - const isBanner = displayObj.layout === 2; + var isBanner = displayObj.layout === 2; if (isExitIntent) { - const opacityDiv = document.createElement('div'); + var opacityDiv = document.createElement('div'); opacityDiv.id = opacityDivId; - const opacity = targetingMsgJson.display.opacity || 0.7; - const rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + var opacity = targetingMsgJson.display.opacity || 0.7; + var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); document.body.appendChild(opacityDiv); } - const msgDiv = document.createElement('div'); + var msgDiv = document.createElement('div'); msgDiv.id = divId; - const viewHeight = window.innerHeight; - const viewWidth = window.innerWidth; - let legacy = false; + var viewHeight = window.innerHeight; + var viewWidth = window.innerWidth; + var legacy = false; if (!isBanner) { - const marginBottom = viewHeight * 5 / 100; + var marginBottom = viewHeight * 5 / 100; var contentHeight = 10; - let right = viewWidth * 5 / 100; - let bottomPosition = contentHeight + marginBottom; - let width = viewWidth * 30 / 100 + 20; - let widthPerct = 'width:30%;'; // for small devices - mobile phones + var right = viewWidth * 5 / 100; + var bottomPosition = contentHeight + marginBottom; + var width = viewWidth * 30 / 100 + 20; + var widthPerct = 'width:30%;'; // for small devices - mobile phones if ((/mobile/i.test(navigator.userAgent) || /mini/i.test(navigator.userAgent)) && /iPad/i.test(navigator.userAgent) === false) { width = viewWidth * 85 / 100 + 20; @@ -6328,15 +6998,15 @@ } document.body.appendChild(msgDiv); - const iframe = document.createElement('iframe'); - const borderRadius = displayObj.br === false ? '0' : '8'; + var iframe = document.createElement('iframe'); + var borderRadius = displayObj.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe'; - const onClick = targetingMsgJson.display.onClick; - let pointerCss = ''; + var onClick = targetingMsgJson.display.onClick; + var pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; @@ -6346,15 +7016,15 @@ iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; } - let html; // direct html + var html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - const css = '' + ''; - let bgColor, textColor, btnBg, leftTd, btColor; + var css = '' + ''; + var bgColor, textColor, btnBg, leftTd, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -6370,25 +7040,25 @@ btColor = '#ffffff'; } - const titleText = targetingMsgJson.msgContent.title; - const descriptionText = targetingMsgJson.msgContent.description; - let imageTd = ''; + var titleText = targetingMsgJson.msgContent.title; + var descriptionText = targetingMsgJson.msgContent.description; + var imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = ""; } - const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; - const title = "
" + "×" + "
" + "" + // ""+ + var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'" + divId + "');"; + var title = "
" + "×" + "
" + "
" + // ""+ '' + imageTd + "
" + "
" + titleText + '
'; - const body = "
" + descriptionText + '
'; + var body = "
" + descriptionText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); // Dispatch event for popup box/banner close - const closeCampaign = new Event('CT_campaign_rendered'); + var closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); if (displayObj['custom-editor']) { @@ -6397,7 +7067,7 @@ iframe.srcdoc = html; - const adjustIFrameHeight = () => { + var adjustIFrameHeight = function adjustIFrameHeight() { // adjust iframe and body height of html inside correctly contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight; @@ -6409,54 +7079,54 @@ document.getElementById('wiz-iframe').style.height = contentHeight + 'px'; }; - const ua = navigator.userAgent.toLowerCase(); + var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf('safari') !== -1) { if (ua.indexOf('chrome') > -1) { - iframe.onload = () => { + iframe.onload = function () { adjustIFrameHeight(); - const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); }; } else { - let inDoc = iframe.contentDocument || iframe.contentWindow; + var inDoc = iframe.contentDocument || iframe.contentWindow; if (inDoc.document) inDoc = inDoc.document; // safari iphone 7+ needs this. - const _timer = setInterval(() => { + var _timer = setInterval(function () { if (inDoc.readyState === 'complete') { clearInterval(_timer); // adjust iframe and body height of html inside correctly adjustIFrameHeight(); - const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); } }, 300); } } else { - iframe.onload = () => { + iframe.onload = function () { // adjust iframe and body height of html inside correctly adjustIFrameHeight(); - const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); + var contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy); }; } }; - const renderFooterNotification = targetingMsgJson => { + var renderFooterNotification = function renderFooterNotification(targetingMsgJson) { createTemplate(targetingMsgJson, false); }; - let _callBackCalled = false; + var _callBackCalled = false; - const showFooterNotification = targetingMsgJson => { - let onClick = targetingMsgJson.display.onClick; - const displayObj = targetingMsgJson.display; // TODO: Needs wizrocket as a global variable + var showFooterNotification = function showFooterNotification(targetingMsgJson) { + var onClick = targetingMsgJson.display.onClick; + var displayObj = targetingMsgJson.display; // TODO: Needs wizrocket as a global variable if (window.clevertap.hasOwnProperty('notificationCallback') && typeof window.clevertap.notificationCallback !== 'undefined' && typeof window.clevertap.notificationCallback === 'function') { - const notificationCallback = window.clevertap.notificationCallback; + var notificationCallback = window.clevertap.notificationCallback; if (!_callBackCalled) { - const inaObj = {}; + var inaObj = {}; inaObj.msgContent = targetingMsgJson.msgContent; inaObj.msgId = targetingMsgJson.wzrk_id; @@ -6468,9 +7138,9 @@ inaObj.kv = targetingMsgJson.display.kv; } - window.clevertap.raiseNotificationClicked = () => { + window.clevertap.raiseNotificationClicked = function () { if (onClick !== '' && onClick != null) { - const jsFunc = targetingMsgJson.display.jsFunc; + var jsFunc = targetingMsgJson.display.jsFunc; onClick += getCookieParams(_device, _session); // invoke js function call if (jsFunc != null) { @@ -6489,7 +7159,7 @@ } }; - window.clevertap.raiseNotificationViewed = () => { + window.clevertap.raiseNotificationViewed = function () { incrementImpression(targetingMsgJson); }; @@ -6514,10 +7184,10 @@ } // delay - const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed; + var delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed; if (delay != null && delay > 0) { - setTimeout(() => { + setTimeout(function () { renderFooterNotification(targetingMsgJson); }, delay * 1000); } @@ -6526,13 +7196,13 @@ } if (window.clevertap.hasOwnProperty('popupCallbacks') && typeof window.clevertap.popupCallbacks !== 'undefined' && typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') { - const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; - const inaObj = {}; - inaObj.msgContent = targetingMsgJson.msgContent; - inaObj.msgId = targetingMsgJson.wzrk_id; + var popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]; + var _inaObj = {}; + _inaObj.msgContent = targetingMsgJson.msgContent; + _inaObj.msgId = targetingMsgJson.wzrk_id; if (targetingMsgJson.wzrk_pivot) { - inaObj.pivotId = targetingMsgJson.wzrk_pivot; + _inaObj.pivotId = targetingMsgJson.wzrk_pivot; } var msgCTkv = []; @@ -6540,83 +7210,92 @@ for (var wzrkPrefixKey in targetingMsgJson) { // ADD WZRK PREFIX KEY VALUE PAIRS if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) { - const wzrkJson = { - [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] - }; + var wzrkJson = _defineProperty({}, wzrkPrefixKey, targetingMsgJson[wzrkPrefixKey]); + msgCTkv.push(wzrkJson); } } if (msgCTkv.length > 0) { - inaObj.msgCTkv = msgCTkv; + _inaObj.msgCTkv = msgCTkv; } if (targetingMsgJson.display.kv != null) { - inaObj.kv = targetingMsgJson.display.kv; + _inaObj.kv = targetingMsgJson.display.kv; } // PUBLIC API TO RECORD CLICKED EVENT - window.clevertap.raisePopupNotificationClicked = notificationData => { + window.clevertap.raisePopupNotificationClicked = function (notificationData) { if (!notificationData || !notificationData.msgId) { return; } - const eventData = {}; + var eventData = {}; eventData.type = 'event'; eventData.evtName = NOTIFICATION_CLICKED; - eventData.evtData = { - [WZRK_ID]: notificationData.msgId - }; + eventData.evtData = _defineProperty({}, WZRK_ID, notificationData.msgId); if (targetingMsgJson.wzrk_pivot) { - eventData.evtData = { ...eventData.evtData, + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), {}, { wzrk_pivot: notificationData.pivotId - }; + }); } // WZRK PREFIX KEY VALUE PAIRS if (notificationData.msgCTkv) { - for (var wzrkPrefixObj of notificationData.msgCTkv) { - eventData.evtData = { ...eventData.evtData, - ...wzrkPrefixObj - }; + var _iterator = _createForOfIteratorHelper(notificationData.msgCTkv), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var wzrkPrefixObj = _step.value; + eventData.evtData = _objectSpread2(_objectSpread2({}, eventData.evtData), wzrkPrefixObj); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } _request.processEvent(eventData); }; - popupCallback(inaObj); + popupCallback(_inaObj); } } }; - const triggerByInactivity = targetNotif => { - const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000; // Convert to milliseconds + var triggerByInactivity = function triggerByInactivity(targetNotif) { + var IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000; // Convert to milliseconds - let idleTimer; - const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']; + var idleTimer; + var events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']; - const resetIdleTimer = () => { + var resetIdleTimer = function resetIdleTimer() { clearTimeout(idleTimer); - idleTimer = setTimeout(() => { + idleTimer = setTimeout(function () { renderFooterNotification(targetNotif); removeEventListeners(); }, IDLE_TIME_THRESHOLD); }; - const eventHandler = () => { + var eventHandler = function eventHandler() { resetIdleTimer(); }; - const setupEventListeners = () => { - events.forEach(eventType => window.addEventListener(eventType, eventHandler, { - passive: true - })); + var setupEventListeners = function setupEventListeners() { + events.forEach(function (eventType) { + return window.addEventListener(eventType, eventHandler, { + passive: true + }); + }); }; - const removeEventListeners = () => { - events.forEach(eventType => window.removeEventListener(eventType, eventHandler)); + var removeEventListeners = function removeEventListeners() { + events.forEach(function (eventType) { + return window.removeEventListener(eventType, eventHandler); + }); }; setupEventListeners(); @@ -6624,18 +7303,17 @@ return removeEventListeners; // Return a cleanup function }; - const triggerByScroll = targetNotif => { - const calculateScrollPercentage = () => { - const { - scrollHeight, - clientHeight, - scrollTop - } = document.documentElement; + var triggerByScroll = function triggerByScroll(targetNotif) { + var calculateScrollPercentage = function calculateScrollPercentage() { + var _document$documentEle = document.documentElement, + scrollHeight = _document$documentEle.scrollHeight, + clientHeight = _document$documentEle.clientHeight, + scrollTop = _document$documentEle.scrollTop; return scrollTop / (scrollHeight - clientHeight) * 100; }; - const scrollListener = () => { - const scrollPercentage = calculateScrollPercentage(); + var scrollListener = function scrollListener() { + var scrollPercentage = calculateScrollPercentage(); if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) { renderFooterNotification(targetNotif); @@ -6643,10 +7321,10 @@ } }; - const throttle = (func, limit) => { - let inThrottle = false; + var throttle = function throttle(func, limit) { + var inThrottle = false; return function () { - const context = this; + var context = this; if (!inThrottle) { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { @@ -6655,27 +7333,29 @@ func.apply(context, args); inThrottle = true; - setTimeout(() => { + setTimeout(function () { inThrottle = false; }, limit); } }; }; - const throttledScrollListener = throttle(scrollListener, 200); + var throttledScrollListener = throttle(scrollListener, 200); window.addEventListener('scroll', throttledScrollListener, { passive: true }); - return () => window.removeEventListener('scroll', throttledScrollListener); // Return a cleanup function + return function () { + return window.removeEventListener('scroll', throttledScrollListener); + }; // Return a cleanup function }; - let exitintentObj; + var exitintentObj; - const showExitIntent = (event, targetObj) => { + var showExitIntent = function showExitIntent(event, targetObj) { if ((event === null || event === void 0 ? void 0 : event.clientY) > 0) return; - const targetingMsgJson = targetObj || exitintentObj; - const campaignId = targetingMsgJson.wzrk_id.split('_')[0]; - const layout = targetingMsgJson.display.layout; + var targetingMsgJson = targetObj || exitintentObj; + var campaignId = targetingMsgJson.wzrk_id.split('_')[0]; + var layout = targetingMsgJson.display.layout; if (isExistingCampaign(campaignId)) return; if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) { @@ -6688,8 +7368,8 @@ } if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) { - const intentPreview = document.getElementById('intentPreview'); - const intentOpacityDiv = document.getElementById('intentOpacityDiv'); + var intentPreview = document.getElementById('intentPreview'); + var intentOpacityDiv = document.getElementById('intentOpacityDiv'); if (intentPreview && intentOpacityDiv) { intentPreview.remove(); @@ -6708,14 +7388,14 @@ } $ct.campaignDivMap[campaignId] = 'intentPreview'; - let legacy = false; - const opacityDiv = document.createElement('div'); + var legacy = false; + var opacityDiv = document.createElement('div'); opacityDiv.id = 'intentOpacityDiv'; - const opacity = targetingMsgJson.display.opacity || 0.7; - const rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); + var opacity = targetingMsgJson.display.opacity || 0.7; + var rgbaColor = "rgba(0,0,0,".concat(opacity, ")"); opacityDiv.setAttribute('style', "position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(rgbaColor, ";")); document.body.appendChild(opacityDiv); - const msgDiv = document.createElement('div'); + var msgDiv = document.createElement('div'); msgDiv.id = 'intentPreview'; if (targetingMsgJson.display.proto == null) { @@ -6726,15 +7406,15 @@ } document.body.appendChild(msgDiv); - const iframe = document.createElement('iframe'); - const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; + var iframe = document.createElement('iframe'); + var borderRadius = targetingMsgJson.display.br === false ? '0' : '8'; iframe.frameborder = '0px'; iframe.marginheight = '0px'; iframe.marginwidth = '0px'; iframe.scrolling = 'no'; iframe.id = 'wiz-iframe-intent'; - const onClick = targetingMsgJson.display.onClick; - let pointerCss = ''; + var onClick = targetingMsgJson.display.onClick; + var pointerCss = ''; if (onClick !== '' && onClick != null) { pointerCss = 'cursor:pointer;'; @@ -6744,15 +7424,15 @@ iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'; } - let html; // direct html + var html; // direct html if (targetingMsgJson.msgContent.type === 1) { html = targetingMsgJson.msgContent.html; html = html.replace(/##campaignId##/g, campaignId); html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id); } else { - const css = '' + ''; - let bgColor, textColor, btnBg, btColor; + var css = '' + ''; + var bgColor, textColor, btnBg, btColor; if (targetingMsgJson.display.theme === 'dark') { bgColor = '#2d2d2e'; @@ -6766,30 +7446,30 @@ btColor = '#ffffff'; } - const titleText = targetingMsgJson.msgContent.title; - const descriptionText = targetingMsgJson.msgContent.description; - let ctaText = ''; + var titleText = targetingMsgJson.msgContent.title; + var descriptionText = targetingMsgJson.msgContent.description; + var ctaText = ''; if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') { ctaText = "'; } - let imageTd = ''; + var imageTd = ''; if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') { imageTd = "
 + titleText + ' /></div>';
         }
 
-        const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + " + "×" + "
" + "
" + titleText + '
'; - const body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; + var onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + ",'intentPreview');"; + var title = "
" + "×" + "
" + "
" + titleText + '
'; + var body = "
" + descriptionText + '
' + imageTd + ctaText + '
'; html = css + title + body; } iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;'); msgDiv.appendChild(iframe); // Dispatch event for interstitial/exit intent close - const closeCampaign = new Event('CT_campaign_rendered'); + var closeCampaign = new Event('CT_campaign_rendered'); document.dispatchEvent(closeCampaign); if (targetingMsgJson.display['custom-editor']) { @@ -6798,8 +7478,8 @@ iframe.srcdoc = html; - iframe.onload = () => { - const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); + iframe.onload = function () { + var contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv'); setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy); }; }; @@ -6818,8 +7498,8 @@ return; } - const processNativeDisplayArr = arrInAppNotifs => { - Object.keys(arrInAppNotifs).map(key => { + var processNativeDisplayArr = function processNativeDisplayArr(arrInAppNotifs) { + Object.keys(arrInAppNotifs).map(function (key) { var elementId, id; if (arrInAppNotifs[key].display.divId) { @@ -6837,12 +7517,12 @@ }); }; - const addLoadListener = arrInAppNotifs => { - window.addEventListener('load', () => { - let count = 0; + var addLoadListener = function addLoadListener(arrInAppNotifs) { + window.addEventListener('load', function () { + var count = 0; if (count < 20) { - const t = setInterval(() => { + var t = setInterval(function () { processNativeDisplayArr(arrInAppNotifs); if (Object.keys(arrInAppNotifs).length === 0 || count === 20) { @@ -6857,10 +7537,10 @@ }; if (msg.inapp_notifs != null) { - const arrInAppNotifs = {}; + var arrInAppNotifs = {}; - for (let index = 0; index < msg.inapp_notifs.length; index++) { - const targetNotif = msg.inapp_notifs[index]; + for (var index = 0; index < msg.inapp_notifs.length; index++) { + var targetNotif = msg.inapp_notifs[index]; if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) { showFooterNotification(targetNotif); @@ -6874,7 +7554,7 @@ handleKVpairCampaign(targetNotif); } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel - const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); + var element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector); if (element !== null) { targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif); @@ -6899,18 +7579,18 @@ } } - const handleInboxNotifications = () => { + var handleInboxNotifications = function handleInboxNotifications() { if (msg.inbox_preview) { processInboxNotifs(msg); return; } if (msg.inbox_notifs) { - const msgArr = []; + var msgArr = []; - for (let index = 0; index < msg.inbox_notifs.length; index++) { - if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) { - msgArr.push(msg.inbox_notifs[index]); + for (var _index = 0; _index < msg.inbox_notifs.length; _index++) { + if (doCampHouseKeeping(msg.inbox_notifs[_index]) !== false) { + msgArr.push(msg.inbox_notifs[_index]); } } @@ -6930,9 +7610,9 @@ if ($ct.inbox === null) { msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting); - initializeWebInbox(_logger).then(() => { + initializeWebInbox(_logger).then(function () { handleInboxNotifications(); - }).catch(e => {}); + }).catch(function (e) {}); } else { handleInboxNotifications(); } @@ -6950,10 +7630,10 @@ if (StorageManager._isLocalStorageSupported()) { try { if (msg.evpr != null) { - const eventsMap = msg.evpr.events; - const profileMap = msg.evpr.profile; - const syncExpiry = msg.evpr.expires_in; - const now = getNow(); + var eventsMap = msg.evpr.events; + var profileMap = msg.evpr.profile; + var syncExpiry = msg.evpr.expires_in; + var now = getNow(); StorageManager.setMetaProp('lsTime', now); StorageManager.setMetaProp('exTs', syncExpiry); mergeEventMap(eventsMap); @@ -6987,11 +7667,12 @@ var _isPersonalisationActive$2 = _classPrivateFieldLooseKey("isPersonalisationActive"); - class User { - constructor(_ref) { - let { - isPersonalisationActive - } = _ref; + var User = /*#__PURE__*/function () { + function User(_ref) { + var isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, User); + Object.defineProperty(this, _isPersonalisationActive$2, { writable: true, value: void 0 @@ -6999,35 +7680,40 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2] = isPersonalisationActive; } - getTotalVisits() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; - } - - let visitCount = StorageManager.getMetaProp('sc'); + _createClass(User, [{ + key: "getTotalVisits", + value: function getTotalVisits() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - if (visitCount == null) { - visitCount = 1; - } + var visitCount = StorageManager.getMetaProp('sc'); - return visitCount; - } + if (visitCount == null) { + visitCount = 1; + } - getLastVisit() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { - return; + return visitCount; } + }, { + key: "getLastVisit", + value: function getLastVisit() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$2)[_isPersonalisationActive$2]()) { + return; + } - const prevSession = StorageManager.getMetaProp('ps'); + var prevSession = StorageManager.getMetaProp('ps'); - if (prevSession != null) { - return new Date(prevSession * 1000); + if (prevSession != null) { + return new Date(prevSession * 1000); + } } - } + }]); - } + return User; + }(); - const logLevels = { + var logLevels = { DISABLE: 0, ERROR: 1, INFO: 2, @@ -7041,8 +7727,10 @@ var _isLegacyDebug = _classPrivateFieldLooseKey("isLegacyDebug"); - class Logger { - constructor(logLevel) { + var Logger = /*#__PURE__*/function () { + function Logger(logLevel) { + _classCallCheck(this, Logger); + Object.defineProperty(this, _isLegacyDebug, { get: _get_isLegacyDebug, set: void 0 @@ -7059,56 +7747,64 @@ this.wzrkError = {}; } - get logLevel() { - return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; - } - - set logLevel(logLevel) { - _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; - } - - error(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { - _classPrivateFieldLooseBase(this, _log)[_log]('error', message); + _createClass(Logger, [{ + key: "error", + value: function error(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.ERROR) { + _classPrivateFieldLooseBase(this, _log)[_log]('error', message); + } } - } - - info(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { - _classPrivateFieldLooseBase(this, _log)[_log]('log', message); + }, { + key: "info", + value: function info(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.INFO) { + _classPrivateFieldLooseBase(this, _log)[_log]('log', message); + } } - } - - debug(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); + }, { + key: "debug", + value: function debug(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG || _classPrivateFieldLooseBase(this, _isLegacyDebug)[_isLegacyDebug]) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug', message); + } } - } - - debugPE(message) { - if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { - _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); + }, { + key: "debugPE", + value: function debugPE(message) { + if (_classPrivateFieldLooseBase(this, _logLevel)[_logLevel] >= logLevels.DEBUG_PE) { + _classPrivateFieldLooseBase(this, _log)[_log]('debug_pe', message); + } } - } - - reportError(code, description) { - this.wzrkError.c = code; - this.wzrkError.d = description; - this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); - } + }, { + key: "reportError", + value: function reportError(code, description) { + this.wzrkError.c = code; + this.wzrkError.d = description; + this.error("".concat(CLEVERTAP_ERROR_PREFIX, " ").concat(code, ": ").concat(description)); + } + }, { + key: "logLevel", + get: function get() { + return _classPrivateFieldLooseBase(this, _logLevel)[_logLevel]; + }, + set: function set(logLevel) { + _classPrivateFieldLooseBase(this, _logLevel)[_logLevel] = logLevel; + } + }]); - } + return Logger; + }(); var _log2 = function _log2(level, message) { if (window.console) { try { - const ts = new Date().getTime(); + var ts = new Date().getTime(); console[level]("CleverTap [".concat(ts, "]: ").concat(message)); } catch (e) {} } }; - var _get_isLegacyDebug = function () { + var _get_isLegacyDebug = function _get_isLegacyDebug() { return typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === ''; }; @@ -7118,13 +7814,14 @@ var _isPersonalisationActive$3 = _classPrivateFieldLooseKey("isPersonalisationActive"); - class SessionManager { + var SessionManager = /*#__PURE__*/function () { // SCOOKIE_NAME - constructor(_ref) { - let { - logger, - isPersonalisationActive - } = _ref; + function SessionManager(_ref) { + var logger = _ref.logger, + isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, SessionManager); + Object.defineProperty(this, _logger$6, { writable: true, value: void 0 @@ -7144,112 +7841,120 @@ _classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3] = isPersonalisationActive; } - get sessionId() { - return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; - } - - set sessionId(sessionId) { - _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; - } - - getSessionCookieObject() { - let scookieStr = StorageManager.readCookie(this.cookieName); - let obj = {}; + _createClass(SessionManager, [{ + key: "getSessionCookieObject", + value: function getSessionCookieObject() { + var scookieStr = StorageManager.readCookie(this.cookieName); + var obj = {}; - if (scookieStr != null) { - // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera - scookieStr = scookieStr.replace(singleQuoteRegex, '"'); - obj = JSON.parse(scookieStr); + if (scookieStr != null) { + // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera + scookieStr = scookieStr.replace(singleQuoteRegex, '"'); + obj = JSON.parse(scookieStr); - if (!isObject(obj)) { - obj = {}; - } else { - if (typeof obj.t !== 'undefined') { - // check time elapsed since last request - const lastTime = obj.t; - const now = getNow(); - - if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { - // adding 60 seconds to compensate for in-journey requests - // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read - // hence we shouldn't use it. - obj = {}; + if (!isObject(obj)) { + obj = {}; + } else { + if (typeof obj.t !== 'undefined') { + // check time elapsed since last request + var lastTime = obj.t; + var now = getNow(); + + if (now - lastTime > SCOOKIE_EXP_TIME_IN_SECS + 60) { + // adding 60 seconds to compensate for in-journey requests + // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read + // hence we shouldn't use it. + obj = {}; + } } } } - } - - this.scookieObj = obj; - return obj; - } - - setSessionCookieObject(obj) { - const objStr = JSON.stringify(obj); - StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); - } - - manageSession(session) { - // first time. check if current session id in localstorage is same - // if not same then prev = current and current = this new session - if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { - const currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both - if (typeof currentSessionInLS === 'undefined') { - StorageManager.setMetaProp('ps', session); - StorageManager.setMetaProp('cs', session); - StorageManager.setMetaProp('sc', 1); - } else if (currentSessionInLS !== session) { - // not same as session in local storage. new session - StorageManager.setMetaProp('ps', currentSessionInLS); - StorageManager.setMetaProp('cs', session); - let sessionCount = StorageManager.getMetaProp('sc'); + this.scookieObj = obj; + return obj; + } + }, { + key: "setSessionCookieObject", + value: function setSessionCookieObject(obj) { + var objStr = JSON.stringify(obj); + StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName()); + } + }, { + key: "manageSession", + value: function manageSession(session) { + // first time. check if current session id in localstorage is same + // if not same then prev = current and current = this new session + if (typeof this.sessionId === 'undefined' || this.sessionId !== session) { + var currentSessionInLS = StorageManager.getMetaProp('cs'); // if sessionId in meta is undefined - set current to both + + if (typeof currentSessionInLS === 'undefined') { + StorageManager.setMetaProp('ps', session); + StorageManager.setMetaProp('cs', session); + StorageManager.setMetaProp('sc', 1); + } else if (currentSessionInLS !== session) { + // not same as session in local storage. new session + StorageManager.setMetaProp('ps', currentSessionInLS); + StorageManager.setMetaProp('cs', session); + var sessionCount = StorageManager.getMetaProp('sc'); + + if (typeof sessionCount === 'undefined') { + sessionCount = 0; + } - if (typeof sessionCount === 'undefined') { - sessionCount = 0; + StorageManager.setMetaProp('sc', sessionCount + 1); } - StorageManager.setMetaProp('sc', sessionCount + 1); + this.sessionId = session; } - - this.sessionId = session; - } - } - - getTimeElapsed() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; } + }, { + key: "getTimeElapsed", + value: function getTimeElapsed() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - if (this.scookieObj != null) { - // TODO: check logic? - this.scookieObj = this.getSessionCookieObject(); - } + if (this.scookieObj != null) { + // TODO: check logic? + this.scookieObj = this.getSessionCookieObject(); + } - const sessionStart = this.scookieObj.s; + var sessionStart = this.scookieObj.s; - if (sessionStart != null) { - const ts = getNow(); - return Math.floor(ts - sessionStart); + if (sessionStart != null) { + var ts = getNow(); + return Math.floor(ts - sessionStart); + } } - } + }, { + key: "getPageCount", + value: function getPageCount() { + if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { + return; + } - getPageCount() { - if (!_classPrivateFieldLooseBase(this, _isPersonalisationActive$3)[_isPersonalisationActive$3]()) { - return; - } + if (this.scookieObj != null) { + // TODO: check logic + this.scookieObj = this.getSessionCookieObject(); + } - if (this.scookieObj != null) { - // TODO: check logic - this.scookieObj = this.getSessionCookieObject(); + return this.scookieObj.p; } + }, { + key: "sessionId", + get: function get() { + return _classPrivateFieldLooseBase(this, _sessionId)[_sessionId]; + }, + set: function set(sessionId) { + _classPrivateFieldLooseBase(this, _sessionId)[_sessionId] = sessionId; + } + }]); - return this.scookieObj.p; - } - - } + return SessionManager; + }(); - let seqNo = 0; - let requestTime = 0; + var seqNo = 0; + var requestTime = 0; var _logger$7 = _classPrivateFieldLooseKey("logger"); @@ -7265,15 +7970,16 @@ var _addToLocalEventMap = _classPrivateFieldLooseKey("addToLocalEventMap"); - class RequestManager { - constructor(_ref) { - let { - logger, - account, - device, - session, - isPersonalisationActive - } = _ref; + var RequestManager = /*#__PURE__*/function () { + function RequestManager(_ref) { + var logger = _ref.logger, + account = _ref.account, + device = _ref.device, + session = _ref.session, + isPersonalisationActive = _ref.isPersonalisationActive; + + _classCallCheck(this, RequestManager); + Object.defineProperty(this, _addToLocalEventMap, { value: _addToLocalEventMap2 }); @@ -7312,222 +8018,234 @@ RequestDispatcher.account = account; } - processBackupEvents() { - const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); + _createClass(RequestManager, [{ + key: "processBackupEvents", + value: function processBackupEvents() { + var backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME); - if (typeof backupMap === 'undefined' || backupMap === null) { - return; - } + if (typeof backupMap === 'undefined' || backupMap === null) { + return; + } - this.processingBackup = true; + this.processingBackup = true; - for (const idx in backupMap) { - if (backupMap.hasOwnProperty(idx)) { - const backupEvent = backupMap[idx]; + for (var idx in backupMap) { + if (backupMap.hasOwnProperty(idx)) { + var backupEvent = backupMap[idx]; - if (typeof backupEvent.fired === 'undefined') { - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('Processing backup event : ' + backupEvent.q); + if (typeof backupEvent.fired === 'undefined') { + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('Processing backup event : ' + backupEvent.q); - if (typeof backupEvent.q !== 'undefined') { - RequestDispatcher.fireRequest(backupEvent.q); - } + if (typeof backupEvent.q !== 'undefined') { + RequestDispatcher.fireRequest(backupEvent.q); + } - backupEvent.fired = true; + backupEvent.fired = true; + } } } - } - - StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); - this.processingBackup = false; - } - - addSystemDataToObject(dataObject, ignoreTrim) { - // ignore trim for chrome notifications; undefined everywhere else - if (typeof ignoreTrim === 'undefined') { - dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - } - - if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError)) { - dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError; - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError = {}; - } - - dataObject.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; - if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { - dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap); + this.processingBackup = false; } + }, { + key: "addSystemDataToObject", + value: function addSystemDataToObject(dataObject, ignoreTrim) { + // ignore trim for chrome notifications; undefined everywhere else + if (typeof ignoreTrim === 'undefined') { + dataObject = removeUnsupportedChars(dataObject, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + } - const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); + if (!isObjectEmpty(_classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError)) { + dataObject.wzrk_error = _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].wzrkError = {}; + } - dataObject.s = obj.s; // session cookie + dataObject.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; - dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count + if (isValueValid(_classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie)) { + dataObject.g = _classPrivateFieldLooseBase(this, _device$2)[_device$2].gcookie; + } - let proto = document.location.protocol; - proto = proto.replace(':', ''); - dataObject.af = { ...dataObject.af, - lib: 'web-sdk-v1.11.3', - protocol: proto, - ...$ct.flutterVersion - }; // app fields + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - if (sessionStorage.hasOwnProperty('WZRK_D')) { - dataObject.debug = true; - } + dataObject.s = obj.s; // session cookie - return dataObject; - } + dataObject.pg = typeof obj.p === 'undefined' ? 1 : obj.p; // Page count - addFlags(data) { - // check if cookie should be cleared. - _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); + var proto = document.location.protocol; + proto = proto.replace(':', ''); + dataObject.af = _objectSpread2(_objectSpread2({}, dataObject.af), {}, { + lib: 'web-sdk-v1.11.3', + protocol: proto + }, $ct.flutterVersion); // app fields - if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { - data.rc = true; + if (sessionStorage.hasOwnProperty('WZRK_D')) { + dataObject.debug = true; + } - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('reset cookie sent in request and cleared from meta for future requests.'); + return dataObject; } + }, { + key: "addFlags", + value: function addFlags(data) { + // check if cookie should be cleared. + _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] = StorageManager.getAndClearMetaProp(CLEAR); - if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { - const lastSyncTime = StorageManager.getMetaProp('lsTime'); - const expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server + if (_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) { + data.rc = true; - if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { - data.dsync = true; - return; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('reset cookie sent in request and cleared from meta for future requests.'); } - const now = getNow(); // last sync time has expired - get fresh data from server + if (_classPrivateFieldLooseBase(this, _isPersonalisationActive$4)[_isPersonalisationActive$4]()) { + var lastSyncTime = StorageManager.getMetaProp('lsTime'); + var expirySeconds = StorageManager.getMetaProp('exTs'); // dsync not found in local storage - get data from server - if (lastSyncTime + expirySeconds < now) { - data.dsync = true; - } - } - } // saves url to backup cache and fires the request + if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') { + data.dsync = true; + return; + } - /** - * - * @param {string} url - * @param {boolean} override whether the request can go through or not - * @param {Boolean} sendOULFlag - true in case of a On User Login request - */ + var now = getNow(); // last sync time has expired - get fresh data from server + if (lastSyncTime + expirySeconds < now) { + data.dsync = true; + } + } + } // saves url to backup cache and fires the request - saveAndFireRequest(url, override, sendOULFlag, evtName) { - const now = getNow(); - url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); - const data = url + '&i=' + now + '&sn=' + seqNo; - StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); // if offline is set to true, save the request in backup and return + /** + * + * @param {string} url + * @param {boolean} override whether the request can go through or not + * @param {Boolean} sendOULFlag - true in case of a On User Login request + */ - if ($ct.offline) return; // if there is no override - // and an OUL request is not in progress - // then process the request as it is - // else block the request - // note - $ct.blockRequest should ideally be used for override + }, { + key: "saveAndFireRequest", + value: function saveAndFireRequest(url, override, sendOULFlag, evtName) { + var now = getNow(); + url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N); + var data = url + '&i=' + now + '&sn=' + seqNo; + StorageManager.backupEvent(data, $ct.globalCache.REQ_N, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); // if offline is set to true, save the request in backup and return + + if ($ct.offline) return; // if there is no override + // and an OUL request is not in progress + // then process the request as it is + // else block the request + // note - $ct.blockRequest should ideally be used for override + + if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { + if (now === requestTime) { + seqNo++; + } else { + requestTime = now; + seqNo = 0; + } - if ((!override || _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie] !== undefined && _classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie]) && !window.isOULInProgress) { - if (now === requestTime) { - seqNo++; + window.oulReqN = $ct.globalCache.REQ_N; + RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); } else { - requestTime = now; - seqNo = 0; + _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - - window.oulReqN = $ct.globalCache.REQ_N; - RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName); - } else { - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug("Not fired due to override - ".concat($ct.blockRequest, " or clearCookie - ").concat(_classPrivateFieldLooseBase(this, _clearCookie)[_clearCookie], " or OUL request in progress - ").concat(window.isOULInProgress)); } - } - - unregisterTokenForGuid(givenGUID) { - const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - - if (payload) { - const data = {}; - data.type = 'data'; + }, { + key: "unregisterTokenForGuid", + value: function unregisterTokenForGuid(givenGUID) { + var payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA); // Send unregister event only when token is available - if (isValueValid(givenGUID)) { - data.g = givenGUID; - } - - data.action = 'unregister'; - data.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; + if (payload) { + var data = {}; + data.type = 'data'; - const obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - - data.s = obj.s; // session cookie + if (isValueValid(givenGUID)) { + data.g = givenGUID; + } - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + data.action = 'unregister'; + data.id = _classPrivateFieldLooseBase(this, _account$3)[_account$3].id; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + var obj = _classPrivateFieldLooseBase(this, _session$2)[_session$2].getSessionCookieObject(); - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - RequestDispatcher.fireRequest(pageLoadUrl, true); - StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); - } // REGISTER TOKEN + data.s = obj.s; // session cookie + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - this.registerToken(payload); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; - registerToken(payload) { - if (!payload) return; // add gcookie etc to the payload + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + RequestDispatcher.fireRequest(pageLoadUrl, true); + StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false); + } // REGISTER TOKEN - payload = this.addSystemDataToObject(payload, true); - payload = JSON.stringify(payload); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + this.registerToken(payload); + } + }, { + key: "registerToken", + value: function registerToken(payload) { + if (!payload) return; // add gcookie etc to the payload - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7])); - RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage + payload = this.addSystemDataToObject(payload, true); + payload = JSON.stringify(payload); - StorageManager.save(WEBPUSH_LS_KEY, 'ok'); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; - processEvent(data) { - _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, _classPrivateFieldLooseBase(this, _logger$7)[_logger$7])); + RequestDispatcher.fireRequest(pageLoadUrl); // set in localstorage - data = this.addSystemDataToObject(data, undefined); - this.addFlags(data); - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); + StorageManager.save(WEBPUSH_LS_KEY, 'ok'); + } + }, { + key: "processEvent", + value: function processEvent(data) { + _classPrivateFieldLooseBase(this, _addToLocalEventMap)[_addToLocalEventMap](data.evtName); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; + data = this.addSystemDataToObject(data, undefined); + this.addFlags(data); + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$7)[_logger$7]); - pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); - this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); - } + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$3)[_account$3].dataPostURL; - post(url, body) { - return fetch(url, { - method: 'post', - headers: { - 'Content-Type': 'application/json' - }, - body: body - }).then(response => { - if (response.ok) { - return response.json(); - } + pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); + this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName); + } + }, { + key: "post", + value: function post(url, body) { + var _this = this; + + return fetch(url, { + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: body + }).then(function (response) { + if (response.ok) { + return response.json(); + } - throw response; - }).then(data => { - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('Sync data successful', data); + throw response; + }).then(function (data) { + _classPrivateFieldLooseBase(_this, _logger$7)[_logger$7].debug('Sync data successful', data); - return data; - }).catch(e => { - _classPrivateFieldLooseBase(this, _logger$7)[_logger$7].debug('Error in syncing variables', e); + return data; + }).catch(function (e) { + _classPrivateFieldLooseBase(_this, _logger$7)[_logger$7].debug('Error in syncing variables', e); - throw e; - }); - } + throw e; + }); + } + }]); - } + return RequestManager; + }(); var _addToLocalEventMap2 = function _addToLocalEventMap2(evtName) { if (StorageManager._isLocalStorageSupported()) { @@ -7539,8 +8257,8 @@ } } - const nowTs = getNow(); - let evtDetail = $ct.globalEventsMap[evtName]; + var nowTs = getNow(); + var evtDetail = $ct.globalEventsMap[evtName]; if (typeof evtDetail !== 'undefined') { evtDetail[2] = nowTs; @@ -7567,70 +8285,85 @@ var _processPrivacyArray = _classPrivateFieldLooseKey("processPrivacyArray"); - class Privacy extends Array { - constructor(_ref, values) { - let { - request, - account, - logger - } = _ref; - super(); - Object.defineProperty(this, _processPrivacyArray, { + var Privacy = /*#__PURE__*/function (_Array) { + _inherits(Privacy, _Array); + + var _super = _createSuper(Privacy); + + function Privacy(_ref, values) { + var _this; + + var request = _ref.request, + account = _ref.account, + logger = _ref.logger; + + _classCallCheck(this, Privacy); + + _this = _super.call(this); + Object.defineProperty(_assertThisInitialized(_this), _processPrivacyArray, { value: _processPrivacyArray2 }); - Object.defineProperty(this, _request$5, { + Object.defineProperty(_assertThisInitialized(_this), _request$5, { writable: true, value: void 0 }); - Object.defineProperty(this, _account$4, { + Object.defineProperty(_assertThisInitialized(_this), _account$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _oldValues$4, { + Object.defineProperty(_assertThisInitialized(_this), _oldValues$4, { writable: true, value: void 0 }); - Object.defineProperty(this, _logger$8, { + Object.defineProperty(_assertThisInitialized(_this), _logger$8, { writable: true, value: void 0 }); - _classPrivateFieldLooseBase(this, _logger$8)[_logger$8] = logger; - _classPrivateFieldLooseBase(this, _request$5)[_request$5] = request; - _classPrivateFieldLooseBase(this, _account$4)[_account$4] = account; - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = values; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _logger$8)[_logger$8] = logger; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _request$5)[_request$5] = request; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _account$4)[_account$4] = account; + _classPrivateFieldLooseBase(_assertThisInitialized(_this), _oldValues$4)[_oldValues$4] = values; + return _this; } - push() { - for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { - privacyArr[_key] = arguments[_key]; - } + _createClass(Privacy, [{ + key: "push", + value: function push() { + for (var _len = arguments.length, privacyArr = new Array(_len), _key = 0; _key < _len; _key++) { + privacyArr[_key] = arguments[_key]; + } - if ($ct.isPrivacyArrPushed) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); - } else { - $ct.privacyArray.push(...privacyArr); - } + if ($ct.isPrivacyArrPushed) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray]($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr); + } else { + var _$ct$privacyArray; - return 0; - } + (_$ct$privacyArray = $ct.privacyArray).push.apply(_$ct$privacyArray, privacyArr); + } - _processOldValues() { - if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { - _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + return 0; } + }, { + key: "_processOldValues", + value: function _processOldValues() { + if (_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]) { + _classPrivateFieldLooseBase(this, _processPrivacyArray)[_processPrivacyArray](_classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4]); + } - _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; - } + _classPrivateFieldLooseBase(this, _oldValues$4)[_oldValues$4] = null; + } + }]); - } + return Privacy; + }( /*#__PURE__*/_wrapNativeSuper(Array)); var _processPrivacyArray2 = function _processPrivacyArray2(privacyArr) { if (Array.isArray(privacyArr) && privacyArr.length > 0) { - const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, - ...curr - }), {}); - let data = {}; - const profileObj = {}; + var privacyObj = privacyArr.reduce(function (prev, curr) { + return _objectSpread2(_objectSpread2({}, prev), curr); + }, {}); + var data = {}; + var profileObj = {}; var optOut = false; if (privacyObj.hasOwnProperty(OPTOUT_KEY)) { @@ -7644,8 +8377,8 @@ } if (privacyObj.hasOwnProperty(USEIP_KEY)) { - const useIP = privacyObj[USEIP_KEY]; - const shouldUseIP = typeof useIP === 'boolean' ? useIP : false; + var useIP = privacyObj[USEIP_KEY]; + var shouldUseIP = typeof useIP === 'boolean' ? useIP : false; StorageManager.setMetaProp(USEIP_KEY, shouldUseIP); } @@ -7653,9 +8386,9 @@ data.type = 'profile'; data.profile = profileObj; data = _classPrivateFieldLooseBase(this, _request$5)[_request$5].addSystemDataToObject(data, undefined); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$8)[_logger$8]); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$8)[_logger$8]); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$4)[_account$4].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$4)[_account$4].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -7670,7 +8403,7 @@ var _variableStore = _classPrivateFieldLooseKey("variableStore"); - class Variable { + var Variable = /*#__PURE__*/function () { /** * Creates an instance of the Variable class. * @@ -7683,10 +8416,11 @@ * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally). * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes. */ - constructor(_ref) { - let { - variableStore - } = _ref; + function Variable(_ref) { + var variableStore = _ref.variableStore; + + _classCallCheck(this, Variable); + Object.defineProperty(this, _variableStore, { writable: true, value: void 0 @@ -7700,138 +8434,151 @@ _classPrivateFieldLooseBase(this, _variableStore)[_variableStore] = variableStore; } - getValue() { - return this.value; - } - - getdefaultValue() { - return this.defaultValue; - } - /** - * Defines a new variable with the provided name, default value, and variable store. - * @static - * @param {string} name - The name of the variable. - * @param {*} defaultValue - The default value of the variable. - * @param {VariableStore} variableStore - The VariableStore instance for registration. - * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. - */ - - - static define(name, defaultValue, variableStore) { - if (!name || typeof name !== 'string') { - console.error('Empty or invalid name parameter provided.'); - return null; + _createClass(Variable, [{ + key: "getValue", + value: function getValue() { + return this.value; } - - if (name.startsWith('.') || name.endsWith('.')) { - console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); - return null; + }, { + key: "getdefaultValue", + value: function getdefaultValue() { + return this.defaultValue; } + /** + * Defines a new variable with the provided name, default value, and variable store. + * @static + * @param {string} name - The name of the variable. + * @param {*} defaultValue - The default value of the variable. + * @param {VariableStore} variableStore - The VariableStore instance for registration. + * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided. + */ - const typeOfDefaultValue = typeof defaultValue; + }, { + key: "update", - if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { - console.error('Only primitive types (string, number, boolean) are accepted as value'); - return null; - } + /** + * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. + * @param {*} newValue - The new value to be assigned to the variable. + */ + value: function update(newValue) { + var oldValue = this.value; + this.value = newValue; + + if (newValue === null && oldValue === null) { + return; + } - const existing = variableStore.getVariable(name); + if (newValue !== null && newValue === oldValue && this.hadStarted) { + return; + } - if (existing) { - return existing; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + this.hadStarted = true; + this.triggerValueChanged(); + } } + /** + * Invokes all registered callbacks when the variable value changes. + */ - const varInstance = new Variable({ - variableStore - }); + }, { + key: "triggerValueChanged", + value: function triggerValueChanged() { + var _this = this; - try { - varInstance.name = name; - varInstance.defaultValue = defaultValue; - varInstance.value = defaultValue; - varInstance.type = typeOfDefaultValue; - variableStore.registerVariable(varInstance); - varInstance.update(defaultValue); - } catch (error) { - console.error(error); + this.valueChangedCallbacks.forEach(function (onValueChanged) { + onValueChanged(_this); + }); } + /** + * Adds a callback function to the array and triggers it immediately if variable requests have completed. + * @param {Function} onValueChanged - The callback function to be added. + */ - return varInstance; - } - /** - * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true. - * @param {*} newValue - The new value to be assigned to the variable. - */ - + }, { + key: "addValueChangedCallback", + value: function addValueChangedCallback(onValueChanged) { + if (!onValueChanged) { + console.log('Invalid callback parameter provided.'); + return; + } - update(newValue) { - const oldValue = this.value; - this.value = newValue; + this.valueChangedCallbacks.push(onValueChanged); - if (newValue === null && oldValue === null) { - return; + if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { + onValueChanged(this); + } } + /** + * Removes a callback function from the array. + * @param {Function} onValueChanged - The callback function to be removed. + */ - if (newValue !== null && newValue === oldValue && this.hadStarted) { - return; - } + }, { + key: "removeValueChangedCallback", + value: function removeValueChangedCallback(onValueChanged) { + var index = this.valueChangedCallbacks.indexOf(onValueChanged); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - this.hadStarted = true; - this.triggerValueChanged(); + if (index !== -1) { + this.valueChangedCallbacks.splice(index, 1); + } } - } - /** - * Invokes all registered callbacks when the variable value changes. - */ + /** + * Resets the `hadStarted` flag to false. + */ + }, { + key: "clearStartFlag", + value: function clearStartFlag() { + this.hadStarted = false; + } + }], [{ + key: "define", + value: function define(name, defaultValue, variableStore) { + if (!name || typeof name !== 'string') { + console.error('Empty or invalid name parameter provided.'); + return null; + } - triggerValueChanged() { - this.valueChangedCallbacks.forEach(onValueChanged => { - onValueChanged(this); - }); - } - /** - * Adds a callback function to the array and triggers it immediately if variable requests have completed. - * @param {Function} onValueChanged - The callback function to be added. - */ + if (name.startsWith('.') || name.endsWith('.')) { + console.error('Variable name starts or ends with a `.` which is not allowed: ' + name); + return null; + } + var typeOfDefaultValue = _typeof(defaultValue); - addValueChangedCallback(onValueChanged) { - if (!onValueChanged) { - console.log('Invalid callback parameter provided.'); - return; - } + if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') { + console.error('Only primitive types (string, number, boolean) are accepted as value'); + return null; + } - this.valueChangedCallbacks.push(onValueChanged); + var existing = variableStore.getVariable(name); - if (_classPrivateFieldLooseBase(this, _variableStore)[_variableStore].hasVarsRequestCompleted()) { - onValueChanged(this); - } - } - /** - * Removes a callback function from the array. - * @param {Function} onValueChanged - The callback function to be removed. - */ + if (existing) { + return existing; + } + var varInstance = new Variable({ + variableStore: variableStore + }); - removeValueChangedCallback(onValueChanged) { - const index = this.valueChangedCallbacks.indexOf(onValueChanged); + try { + varInstance.name = name; + varInstance.defaultValue = defaultValue; + varInstance.value = defaultValue; + varInstance.type = typeOfDefaultValue; + variableStore.registerVariable(varInstance); + varInstance.update(defaultValue); + } catch (error) { + console.error(error); + } - if (index !== -1) { - this.valueChangedCallbacks.splice(index, 1); + return varInstance; } - } - /** - * Resets the `hadStarted` flag to false. - */ - + }]); - clearStartFlag() { - this.hadStarted = false; - } - - } + return Variable; + }(); var _logger$9 = _classPrivateFieldLooseKey("logger"); @@ -7855,14 +8602,15 @@ var _runVariablesChangedCallback = _classPrivateFieldLooseKey("runVariablesChangedCallback"); - class VariableStore { - constructor(_ref) { - let { - logger, - request, - account, - event - } = _ref; + var VariableStore = /*#__PURE__*/function () { + function VariableStore(_ref) { + var logger = _ref.logger, + request = _ref.request, + account = _ref.account, + event = _ref.event; + + _classCallCheck(this, VariableStore); + Object.defineProperty(this, _runVariablesChangedCallback, { value: _runVariablesChangedCallback2 }); @@ -7922,178 +8670,211 @@ */ - registerVariable(varInstance) { - const { - name - } = varInstance; - _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; - console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); - } - /** - * Retrieves a variable by its name. - * @param {string} name - The name of the variable to retrieve. - * @returns {Object} - The variable instance. - */ - - - getVariable(name) { - return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; - } - - hasVarsRequestCompleted() { - return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; - } - /** - * Synchronizes variables with the server. - * @param {Function} onSyncSuccess - Callback function on successful synchronization. - * @param {Function} onSyncFailure - Callback function on synchronization failure. - * @throws Will throw an error if the account token is missing. - * @returns {Promise} - The result of the synchronization request. - */ + _createClass(VariableStore, [{ + key: "registerVariable", + value: function registerVariable(varInstance) { + var name = varInstance.name; + _classPrivateFieldLooseBase(this, _variables)[_variables][name] = varInstance; + console.log('registerVariable', _classPrivateFieldLooseBase(this, _variables)[_variables]); + } + /** + * Retrieves a variable by its name. + * @param {string} name - The name of the variable to retrieve. + * @returns {Object} - The variable instance. + */ + }, { + key: "getVariable", + value: function getVariable(name) { + return _classPrivateFieldLooseBase(this, _variables)[_variables][name]; + } + }, { + key: "hasVarsRequestCompleted", + value: function hasVarsRequestCompleted() { + return _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted]; + } + /** + * Synchronizes variables with the server. + * @param {Function} onSyncSuccess - Callback function on successful synchronization. + * @param {Function} onSyncFailure - Callback function on synchronization failure. + * @throws Will throw an error if the account token is missing. + * @returns {Promise} - The result of the synchronization request. + */ - syncVariables(onSyncSuccess, onSyncFailure) { - if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { - const m = 'Account token is missing.'; + }, { + key: "syncVariables", + value: function syncVariables(onSyncSuccess, onSyncFailure) { + var _this = this; - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + if (!_classPrivateFieldLooseBase(this, _account$5)[_account$5].token) { + var m = 'Account token is missing.'; - return Promise.reject(new Error(m)); - } + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); - const payload = { - type: 'varsPayload', - vars: {} - }; + return Promise.reject(new Error(m)); + } - for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - payload.vars[name] = { - defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, - type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type + var payload = { + type: 'varsPayload', + vars: {} }; - } // Check if payload.vars is empty - - - if (Object.keys(payload.vars).length === 0) { - const m = 'No variables are defined.'; - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(m); + for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + payload.vars[name] = { + defaultValue: _classPrivateFieldLooseBase(this, _variables)[_variables][name].defaultValue, + type: _classPrivateFieldLooseBase(this, _variables)[_variables][name].type + }; + } // Check if payload.vars is empty - return Promise.reject(new Error(m)); - } - let meta = {}; - meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); - meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; - meta.type = 'meta'; - const body = JSON.stringify([meta, payload]); + if (Object.keys(payload.vars).length === 0) { + var _m = 'No variables are defined.'; - const url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error(_m); - return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(r => { - if (onSyncSuccess && typeof onSyncSuccess === 'function') { - onSyncSuccess(r); + return Promise.reject(new Error(_m)); } - return r; - }).catch(e => { - if (onSyncFailure && typeof onSyncFailure === 'function') { - onSyncFailure(e); - } + var meta = {}; + meta = _classPrivateFieldLooseBase(this, _request$6)[_request$6].addSystemDataToObject(meta, undefined); + meta.tk = _classPrivateFieldLooseBase(this, _account$5)[_account$5].token; + meta.type = 'meta'; + var body = JSON.stringify([meta, payload]); - if (e.status === 400) { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); - } else if (e.status === 401) { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('This is not a test profile'); - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('Sync variable failed'); - } + var url = _classPrivateFieldLooseBase(this, _account$5)[_account$5].dataPostPEURL; - throw e; - }); - } - /** - * Fetches variables from the server. - * @param {Function} onFetchCallback - Callback function on fetch completion. - */ + return _classPrivateFieldLooseBase(this, _request$6)[_request$6].post(url, body).then(function (r) { + if (onSyncSuccess && typeof onSyncSuccess === 'function') { + onSyncSuccess(r); + } + return r; + }).catch(function (e) { + if (onSyncFailure && typeof onSyncFailure === 'function') { + onSyncFailure(e); + } - fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { - t: 4 - }); + if (e.status === 400) { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Invalid sync payload or clear the existing draft'); + } else if (e.status === 401) { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('This is not a test profile'); + } else { + _classPrivateFieldLooseBase(_this, _logger$9)[_logger$9].error('Sync variable failed'); + } - if (onFetchCallback && typeof onFetchCallback === 'function') { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; + throw e; + }); } - } + /** + * Fetches variables from the server. + * @param {Function} onFetchCallback - Callback function on fetch completion. + */ - mergeVariables(vars) { - console.log('msg vars is ', vars); - _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; - StorageManager.saveToLSorCookie(VARIABLES, vars); - _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; + }, { + key: "fetchVariables", + value: function fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _event)[_event].push(WZRK_FETCH, { + t: 4 + }); - for (const name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { - if (vars.hasOwnProperty(name)) { - _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); + if (onFetchCallback && typeof onFetchCallback === 'function') { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback] = onFetchCallback; } } + }, { + key: "mergeVariables", + value: function mergeVariables(vars) { + console.log('msg vars is ', vars); + _classPrivateFieldLooseBase(this, _hasVarsRequestCompleted)[_hasVarsRequestCompleted] = true; + StorageManager.saveToLSorCookie(VARIABLES, vars); + _classPrivateFieldLooseBase(this, _remoteVariables)[_remoteVariables] = vars; - if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { - _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); - } - - _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); - } - - addVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); + for (var name in _classPrivateFieldLooseBase(this, _variables)[_variables]) { + if (vars.hasOwnProperty(name)) { + _classPrivateFieldLooseBase(this, _variables)[_variables][name].update(vars[name]); + } + } - if (this.hasVarsRequestCompleted()) { - callback(); + if (_classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback]) { + _classPrivateFieldLooseBase(this, _fetchCallback)[_fetchCallback](); } - } else { - _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); + + _classPrivateFieldLooseBase(this, _runVariablesChangedCallback)[_runVariablesChangedCallback](); } - } + }, { + key: "addVariablesChangedCallback", + value: function addVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].push(callback); - addOneTimeVariablesChangedCallback(callback) { - if (callback && typeof callback === 'function') { - if (this.hasVarsRequestCompleted()) { - callback(); + if (this.hasVarsRequestCompleted()) { + callback(); + } } else { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); + _classPrivateFieldLooseBase(this, _logger$9)[_logger$9].error('callback is not a function'); } } - } - - removeVariablesChangedCallback(callback) { - const index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - - if (index !== -1) { - _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + }, { + key: "addOneTimeVariablesChangedCallback", + value: function addOneTimeVariablesChangedCallback(callback) { + if (callback && typeof callback === 'function') { + if (this.hasVarsRequestCompleted()) { + callback(); + } else { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].push(callback); + } + } } - } + }, { + key: "removeVariablesChangedCallback", + value: function removeVariablesChangedCallback(callback) { + var index = _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].indexOf(callback); - removeOneTimeVariablesChangedCallback(callback) { - const index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks].splice(index, 1); + } + } + }, { + key: "removeOneTimeVariablesChangedCallback", + value: function removeOneTimeVariablesChangedCallback(callback) { + var index = _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].indexOf(callback); - if (index !== -1) { - _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); + if (index !== -1) { + _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].splice(index, 1); + } } - } + }]); - } + return VariableStore; + }(); var _runVariablesChangedCallback2 = function _runVariablesChangedCallback2() { - for (var callback of _classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]) { - callback(); + var _iterator = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _variablesChangedCallbacks)[_variablesChangedCallbacks]), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var callback = _step.value; + callback(); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } - for (var callBack of _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]) { - callBack(); + var _iterator2 = _createForOfIteratorHelper(_classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks]), + _step2; + + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var callBack = _step2.value; + callBack(); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } _classPrivateFieldLooseBase(this, _oneTimeVariablesChangedCallbacks)[_oneTimeVariablesChangedCallbacks].length = 0; @@ -8137,40 +8918,50 @@ var _sendLocationData = _classPrivateFieldLooseKey("sendLocationData"); - class CleverTap { - get spa() { - return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; - } - - set spa(value) { - const isSpa = value === true; + var CleverTap = /*#__PURE__*/function () { + _createClass(CleverTap, [{ + key: "spa", + get: function get() { + return _classPrivateFieldLooseBase(this, _isSpa)[_isSpa]; + }, + set: function set(value) { + var isSpa = value === true; - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // if clevertap.spa is changed after init has been called then update the click listeners - if (isSpa) { - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa] !== isSpa && _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // if clevertap.spa is changed after init has been called then update the click listeners + if (isSpa) { + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } } - } - _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; - } + _classPrivateFieldLooseBase(this, _isSpa)[_isSpa] = isSpa; + } + }, { + key: "dismissSpamControl", + get: function get() { + return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; + }, + set: function set(value) { + var dismissSpamControl = value === true; + _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; + $ct.dismissSpamControl = dismissSpamControl; + } + }]); - get dismissSpamControl() { - return _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl]; - } + function CleverTap() { + var _clevertap$account, + _clevertap$account2, + _clevertap$account3, + _clevertap$account4, + _this = this, + _clevertap$account5; - set dismissSpamControl(value) { - const dismissSpamControl = value === true; - _classPrivateFieldLooseBase(this, _dismissSpamControl)[_dismissSpamControl] = dismissSpamControl; - $ct.dismissSpamControl = dismissSpamControl; - } + var clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - constructor() { - var _clevertap$account, _clevertap$account2, _clevertap$account3, _clevertap$account4, _clevertap$account5; + _classCallCheck(this, CleverTap); - let clevertap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; Object.defineProperty(this, _sendLocationData, { value: _sendLocationData2 }); @@ -8246,7 +9037,7 @@ _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 0; this._isPersonalisationActive = this._isPersonalisationActive.bind(this); - this.raiseNotificationClicked = () => {}; + this.raiseNotificationClicked = function () {}; _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] = new Logger(logLevels.INFO); _classPrivateFieldLooseBase(this, _account$6)[_account$6] = new Account((_clevertap$account = clevertap.account) === null || _clevertap$account === void 0 ? void 0 : _clevertap$account[0], clevertap.region || ((_clevertap$account2 = clevertap.account) === null || _clevertap$account2 === void 0 ? void 0 : _clevertap$account2[1]), clevertap.targetDomain || ((_clevertap$account3 = clevertap.account) === null || _clevertap$account3 === void 0 ? void 0 : _clevertap$account3[2]), clevertap.token || ((_clevertap$account4 = clevertap.account) === null || _clevertap$account4 === void 0 ? void 0 : _clevertap$account4[3])); @@ -8313,56 +9104,54 @@ isPersonalisationActive: this._isPersonalisationActive }); this.session = { - getTimeElapsed: () => { - return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getTimeElapsed(); + getTimeElapsed: function getTimeElapsed() { + return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getTimeElapsed(); }, - getPageCount: () => { - return _classPrivateFieldLooseBase(this, _session$3)[_session$3].getPageCount(); + getPageCount: function getPageCount() { + return _classPrivateFieldLooseBase(_this, _session$3)[_session$3].getPageCount(); } }; - this.logout = () => { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('logout called'); + this.logout = function () { + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('logout called'); StorageManager.setInstantDeleteFlagInK(); }; - this.clear = () => { - this.onUserLogin.clear(); + this.clear = function () { + _this.onUserLogin.clear(); }; - this.getCleverTapID = () => { - return _classPrivateFieldLooseBase(this, _device$3)[_device$3].getGuid(); + this.getCleverTapID = function () { + return _classPrivateFieldLooseBase(_this, _device$3)[_device$3].getGuid(); }; - this.getAccountID = () => { - return _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + this.getAccountID = function () { + return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].id; }; - this.getSCDomain = () => { - return _classPrivateFieldLooseBase(this, _account$6)[_account$6].finalTargetDomain; + this.getSCDomain = function () { + return _classPrivateFieldLooseBase(_this, _account$6)[_account$6].finalTargetDomain; }; - this.setLibrary = (libName, libVersion) => { - $ct.flutterVersion = { - [libName]: libVersion - }; + this.setLibrary = function (libName, libVersion) { + $ct.flutterVersion = _defineProperty({}, libName, libVersion); }; // Set the Signed Call sdk version and fire request - this.setSCSDKVersion = ver => { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion = ver; - const data = {}; + this.setSCSDKVersion = function (ver) { + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion = ver; + var data = {}; data.af = { - scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].scSDKVersion + scv: 'sc-sdk-v' + _classPrivateFieldLooseBase(_this, _account$6)[_account$6].scSDKVersion }; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(_this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a])); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + _classPrivateFieldLooseBase(_this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; if (hasWebInboxSettingsInLS()) { @@ -8371,53 +9160,53 @@ } // Get Inbox Message Count - this.getInboxMessageCount = () => { - const msgCount = getInboxMessages(); + this.getInboxMessageCount = function () { + var msgCount = getInboxMessages(); return Object.keys(msgCount).length; }; // Get Inbox Unread Message Count - this.getInboxMessageUnreadCount = () => { + this.getInboxMessageUnreadCount = function () { if ($ct.inbox) { return $ct.inbox.unviewedCounter; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get All Inbox messages - this.getAllInboxMessages = () => { + this.getAllInboxMessages = function () { return getInboxMessages(); }; // Get only Unread messages - this.getUnreadInboxMessages = () => { + this.getUnreadInboxMessages = function () { if ($ct.inbox) { return $ct.inbox.unviewedMessages; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('No unread messages'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('No unread messages'); } }; // Get message object belonging to the given message id only. Message id should be a String - this.getInboxMessageForId = messageId => { - const messages = getInboxMessages(); + this.getInboxMessageForId = function (messageId) { + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { return messages[messageId]; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; // Delete message from the Inbox. Message id should be a String // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list // Then remove the message from local storage and update cookie - this.deleteInboxMessage = messageId => { - const messages = getInboxMessages(); + this.deleteInboxMessage = function (messageId) { + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (messages[messageId].viewed === 0) { $ct.inbox.unviewedCounter--; @@ -8430,7 +9219,7 @@ delete messages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. Message id should be a String @@ -8439,12 +9228,12 @@ - renderNotificationViewed */ - this.markReadInboxMessage = messageId => { - const unreadMsg = $ct.inbox.unviewedMessages; - const messages = getInboxMessages(); + this.markReadInboxMessage = function (messageId) { + var unreadMsg = $ct.inbox.unviewedMessages; + var messages = getInboxMessages(); if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8466,16 +9255,16 @@ delete $ct.inbox.unviewedMessages[messageId]; saveInboxMessages(messages); } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].error('No message available for message Id ' + messageId); } }; /* Mark Message as Read. messageIds should be a an array of string */ - this.markReadInboxMessagesForIds = messageIds => { + this.markReadInboxMessagesForIds = function (messageIds) { if (Array.isArray(messageIds)) { for (var id = 0; id < messageIds.length; id++) { - this.markReadInboxMessage(messageIds[id]); + _this.markReadInboxMessage(messageIds[id]); } } }; @@ -8485,14 +9274,14 @@ */ - this.markReadAllInboxMessage = () => { - const unreadMsg = $ct.inbox.unviewedMessages; - const messages = getInboxMessages(); + this.markReadAllInboxMessage = function () { + var unreadMsg = $ct.inbox.unviewedMessages; + var messages = getInboxMessages(); if (Object.keys(unreadMsg).length > 0) { - const msgIds = Object.keys(unreadMsg); - msgIds.forEach(key => { - const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); + var msgIds = Object.keys(unreadMsg); + msgIds.forEach(function (key) { + var el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key); if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none'; @@ -8510,77 +9299,71 @@ $ct.inbox.unviewedCounter = 0; $ct.inbox.unviewedMessages = {}; } else { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].debug('All messages are already read'); + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].debug('All messages are already read'); } }; - this.toggleInbox = e => { + this.toggleInbox = function (e) { var _$ct$inbox; return (_$ct$inbox = $ct.inbox) === null || _$ct$inbox === void 0 ? void 0 : _$ct$inbox.toggleInbox(e); }; // method for notification viewed - this.renderNotificationViewed = detail => { + this.renderNotificationViewed = function (detail) { processNotificationEvent(NOTIFICATION_VIEWED, detail); }; // method for notification clicked - this.renderNotificationClicked = detail => { + this.renderNotificationClicked = function (detail) { processNotificationEvent(NOTIFICATION_CLICKED, detail); }; - const processNotificationEvent = (eventName, eventDetail) => { + var processNotificationEvent = function processNotificationEvent(eventName, eventDetail) { if (!eventDetail || !eventDetail.msgId) { return; } - const data = {}; + var data = {}; data.type = 'event'; data.evtName = eventName; - data.evtData = { - [WZRK_ID]: eventDetail.msgId - }; + data.evtData = _defineProperty({}, WZRK_ID, eventDetail.msgId); if (eventDetail.pivotId) { - data.evtData = { ...data.evtData, + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { wzrk_pivot: eventDetail.pivotId - }; + }); } if (eventDetail.wzrk_slideNo) { - data.evtData = { ...data.evtData, + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, { wzrk_slideNo: eventDetail.wzrk_slideNo - }; + }); } // Adding kv pair to event data if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) { - for (const key in eventDetail.kv) { + for (var key in eventDetail.kv) { if (key.startsWith(WZRK_PREFIX)) { - data.evtData = { ...data.evtData, - [key]: eventDetail.kv[key] - }; + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, key, eventDetail.kv[key])); } } } // Adding msgCTkv to event data if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) { - for (const key in eventDetail.msgCTkv) { - if (key.startsWith(WZRK_PREFIX)) { - data.evtData = { ...data.evtData, - [key]: eventDetail.msgCTkv[key] - }; + for (var _key in eventDetail.msgCTkv) { + if (_key.startsWith(WZRK_PREFIX)) { + data.evtData = _objectSpread2(_objectSpread2({}, data.evtData), {}, _defineProperty({}, _key, eventDetail.msgCTkv[_key])); } } } - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processEvent(data); + _classPrivateFieldLooseBase(_this, _request$7)[_request$7].processEvent(data); }; - this.setLogLevel = l => { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel = Number(l); + this.setLogLevel = function (l) { + _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a].logLevel = Number(l); if (l === 3) { sessionStorage.WZRK_D = ''; @@ -8594,60 +9377,60 @@ */ - this.handleIncrementValue = (key, value) => { - this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); + this.handleIncrementValue = function (key, value) { + _this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT); }; - this.handleDecrementValue = (key, value) => { - this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); + this.handleDecrementValue = function (key, value) { + _this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT); }; - this.setMultiValuesForKey = (key, value) => { + this.setMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueSet(key, value, COMMAND_SET); + _this.profile._handleMultiValueSet(key, value, COMMAND_SET); } else { console.error('setMultiValuesForKey should be called with a value of type array'); } }; - this.addMultiValueForKey = (key, value) => { + this.addMultiValueForKey = function (key, value) { if (typeof value === 'string' || typeof value === 'number') { - this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValueForKey should be called with a value of type string or number.'); } }; - this.addMultiValuesForKey = (key, value) => { + this.addMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); + _this.profile._handleMultiValueAdd(key, value, COMMAND_ADD); } else { console.error('addMultiValuesForKey should be called with a value of type array.'); } }; - this.removeMultiValueForKey = (key, value) => { + this.removeMultiValueForKey = function (key, value) { if (typeof value === 'string' || typeof value === 'number') { - this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValueForKey should be called with a value of type string or number.'); } }; - this.removeMultiValuesForKey = (key, value) => { + this.removeMultiValuesForKey = function (key, value) { if (Array.isArray(value)) { - this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); + _this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE); } else { console.error('removeMultiValuesForKey should be called with a value of type array.'); } }; - this.removeValueForKey = key => { - this.profile._handleMultiValueDelete(key, COMMAND_DELETE); + this.removeValueForKey = function (key) { + _this.profile._handleMultiValueDelete(key, COMMAND_DELETE); }; - const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => { - handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(this, _account$6)[_account$6], _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + var _handleEmailSubscription = function _handleEmailSubscription(subscription, reEncoded, fetchGroups) { + handleEmailSubscription(subscription, reEncoded, fetchGroups, _classPrivateFieldLooseBase(_this, _account$6)[_account$6], _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); }; /** * @@ -8730,59 +9513,59 @@ } } - const api = _classPrivateFieldLooseBase(this, _api)[_api]; + var api = _classPrivateFieldLooseBase(this, _api)[_api]; api.logout = this.logout; api.clear = this.clear; - api.closeIframe = (campaignId, divIdIgnored) => { - closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(this, _session$3)[_session$3].sessionId); + api.closeIframe = function (campaignId, divIdIgnored) { + closeIframe(campaignId, divIdIgnored, _classPrivateFieldLooseBase(_this, _session$3)[_session$3].sessionId); }; - api.enableWebPush = (enabled, applicationServerKey) => { + api.enableWebPush = function (enabled, applicationServerKey) { setServerKey(applicationServerKey); - this.notifications._enableWebPush(enabled, applicationServerKey); + _this.notifications._enableWebPush(enabled, applicationServerKey); }; - api.tr = msg => { + api.tr = function (msg) { _tr(msg, { - device: _classPrivateFieldLooseBase(this, _device$3)[_device$3], - session: _classPrivateFieldLooseBase(this, _session$3)[_session$3], - request: _classPrivateFieldLooseBase(this, _request$7)[_request$7], - logger: _classPrivateFieldLooseBase(this, _logger$a)[_logger$a] + device: _classPrivateFieldLooseBase(_this, _device$3)[_device$3], + session: _classPrivateFieldLooseBase(_this, _session$3)[_session$3], + request: _classPrivateFieldLooseBase(_this, _request$7)[_request$7], + logger: _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a] }); }; - api.setEnum = enumVal => { - setEnum(enumVal, _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + api.setEnum = function (enumVal) { + setEnum(enumVal, _classPrivateFieldLooseBase(_this, _logger$a)[_logger$a]); }; - api.is_onloadcalled = () => { - return _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1; + api.is_onloadcalled = function () { + return _classPrivateFieldLooseBase(_this, _onloadcalled)[_onloadcalled] === 1; }; - api.subEmail = reEncoded => { + api.subEmail = function (reEncoded) { _handleEmailSubscription('1', reEncoded); }; - api.getEmail = (reEncoded, withGroups) => { + api.getEmail = function (reEncoded, withGroups) { _handleEmailSubscription('-1', reEncoded, withGroups); }; - api.unSubEmail = reEncoded => { + api.unSubEmail = function (reEncoded) { _handleEmailSubscription('0', reEncoded); }; - api.unsubEmailGroups = reEncoded => { + api.unsubEmailGroups = function (reEncoded) { $ct.unsubGroups = []; - const elements = document.getElementsByClassName('ct-unsub-group-input-item'); + var elements = document.getElementsByClassName('ct-unsub-group-input-item'); - for (let i = 0; i < elements.length; i++) { - const element = elements[i]; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; if (element.name) { - const data = { + var data = { name: element.name, isUnsubscribed: element.checked }; @@ -8793,29 +9576,29 @@ _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.setSubscriptionGroups = value => { + api.setSubscriptionGroups = function (value) { $ct.unsubGroups = value; }; - api.getSubscriptionGroups = () => { + api.getSubscriptionGroups = function () { return $ct.unsubGroups; }; - api.changeSubscriptionGroups = (reEncoded, updatedGroups) => { + api.changeSubscriptionGroups = function (reEncoded, updatedGroups) { api.setSubscriptionGroups(updatedGroups); _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded); }; - api.isGlobalUnsubscribe = () => { + api.isGlobalUnsubscribe = function () { return $ct.globalUnsubscribe; }; - api.setIsGlobalUnsubscribe = value => { + api.setIsGlobalUnsubscribe = function (value) { $ct.globalUnsubscribe = value; }; - api.setUpdatedCategoryLong = profile => { + api.setUpdatedCategoryLong = function (profile) { if (profile[categoryLongKey]) { $ct.updatedCategoryLong = profile[categoryLongKey]; } @@ -8832,243 +9615,261 @@ } // starts here - init(accountId, region, targetDomain, token) { - let antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - - if (Object.keys(antiFlicker).length > 0) { - addAntiFlicker(antiFlicker); - } - - if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { - // already initailsed - return; - } + _createClass(CleverTap, [{ + key: "init", + value: function init(accountId, region, targetDomain, token) { + var _this2 = this; - StorageManager.removeCookie('WZRK_P', window.location.hostname); + var antiFlicker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { - if (!accountId) { - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); + if (Object.keys(antiFlicker).length > 0) { + addAntiFlicker(antiFlicker); + } + if (_classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] === 1) { + // already initailsed return; } - _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; - } - - checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], _classPrivateFieldLooseBase(this, _account$6)[_account$6].id); - _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; + StorageManager.removeCookie('WZRK_P', window.location.hostname); - if (region) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; - } - - if (targetDomain) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; - } + if (!_classPrivateFieldLooseBase(this, _account$6)[_account$6].id) { + if (!accountId) { + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(EMBED_ERROR); - if (token) { - _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; - } + return; + } - const currLocation = location.href; - const urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id = accountId; + } - if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { - return; - } + checkBuilder(_classPrivateFieldLooseBase(this, _logger$a)[_logger$a], _classPrivateFieldLooseBase(this, _account$6)[_account$6].id); + _classPrivateFieldLooseBase(this, _session$3)[_session$3].cookieName = SCOOKIE_PREFIX + '_' + _classPrivateFieldLooseBase(this, _account$6)[_account$6].id; - $ct.isPrivacyArrPushed = true; + if (region) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].region = region; + } - if ($ct.privacyArray.length > 0) { - this.privacy.push($ct.privacyArray); - } + if (targetDomain) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].targetDomain = targetDomain; + } - _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); + if (token) { + _classPrivateFieldLooseBase(this, _account$6)[_account$6].token = token; + } - this.pageChanged(); - const backupInterval = setInterval(() => { - if (_classPrivateFieldLooseBase(this, _device$3)[_device$3].gcookie) { - clearInterval(backupInterval); + var currLocation = location.href; + var urlParams = getURLParams(currLocation.toLowerCase()); // eslint-disable-next-line eqeqeq - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') { + return; } - }, 3000); - if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { - // listen to click on the document and check if URL has changed. - document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } else { - // remove existing click listeners if any - document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); - } + $ct.isPrivacyArrPushed = true; - _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; - } // process the option array provided to the clevertap object - // after its been initialized + if ($ct.privacyArray.length > 0) { + this.privacy.push($ct.privacyArray); + } + _classPrivateFieldLooseBase(this, _processOldValues)[_processOldValues](); - pageChanged() { - const currLocation = window.location.href; - const urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count + this.pageChanged(); + var backupInterval = setInterval(function () { + if (_classPrivateFieldLooseBase(_this2, _device$3)[_device$3].gcookie) { + clearInterval(backupInterval); - const obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); + _classPrivateFieldLooseBase(_this2, _request$7)[_request$7].processBackupEvents(); + } + }, 3000); - let pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; - obj.p = ++pgCount; + if (_classPrivateFieldLooseBase(this, _isSpa)[_isSpa]) { + // listen to click on the document and check if URL has changed. + document.addEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } else { + // remove existing click listeners if any + document.removeEventListener('click', _classPrivateFieldLooseBase(this, _boundCheckPageChanged)[_boundCheckPageChanged]); + } - _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count + _classPrivateFieldLooseBase(this, _onloadcalled)[_onloadcalled] = 1; + } // process the option array provided to the clevertap object + // after its been initialized + }, { + key: "pageChanged", + value: function pageChanged() { + var _this3 = this; - let data = {}; - let referrerDomain = getDomain(document.referrer); + var currLocation = window.location.href; + var urlParams = getURLParams(currLocation.toLowerCase()); // -- update page count - if (window.location.hostname !== referrerDomain) { - const maxLen = 120; + var obj = _classPrivateFieldLooseBase(this, _session$3)[_session$3].getSessionCookieObject(); - if (referrerDomain !== '') { - referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; - data.referrer = referrerDomain; - } + var pgCount = typeof obj.p === 'undefined' ? 0 : obj.p; + obj.p = ++pgCount; - let utmSource = urlParams.utm_source || urlParams.wzrk_source; + _classPrivateFieldLooseBase(this, _session$3)[_session$3].setSessionCookieObject(obj); // -- update page count - if (typeof utmSource !== 'undefined') { - utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; - data.us = utmSource; // utm_source - } - let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; + var data = {}; + var referrerDomain = getDomain(document.referrer); - if (typeof utmMedium !== 'undefined') { - utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; - data.um = utmMedium; // utm_medium - } + if (window.location.hostname !== referrerDomain) { + var maxLen = 120; - let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; + if (referrerDomain !== '') { + referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain; + data.referrer = referrerDomain; + } - if (typeof utmCampaign !== 'undefined') { - utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; - data.uc = utmCampaign; // utm_campaign - } // also independently send wzrk_medium to the backend + var utmSource = urlParams.utm_source || urlParams.wzrk_source; + if (typeof utmSource !== 'undefined') { + utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource; + data.us = utmSource; // utm_source + } - if (typeof urlParams.wzrk_medium !== 'undefined') { - const wm = urlParams.wzrk_medium; + var utmMedium = urlParams.utm_medium || urlParams.wzrk_medium; - if (wm.match(/^email$|^social$|^search$/)) { - data.wm = wm; // wzrk_medium + if (typeof utmMedium !== 'undefined') { + utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium; + data.um = utmMedium; // utm_medium } - } - } - data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); - data.cpg = currLocation; - data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); + var utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign; - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + if (typeof utmCampaign !== 'undefined') { + utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign; + data.uc = utmCampaign; // utm_campaign + } // also independently send wzrk_medium to the backend - _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 + if (typeof urlParams.wzrk_medium !== 'undefined') { + var wm = urlParams.wzrk_medium; - if (parseInt(data.pg) === 1) { - _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); - } + if (wm.match(/^email$|^social$|^search$/)) { + data.wm = wm; // wzrk_medium + } + } + } - pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); - pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); + data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); + data.cpg = currLocation; + data[CAMP_COOKIE_NAME] = getCampaignObjForLc(); - _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - if (parseInt(data.pg) === 1) { - this.event.push(WZRK_FETCH, { - t: 4 - }); - } + _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); // send dsync flag when page = 1 - _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; - setTimeout(() => { - if (pgCount <= 3) { - // send ping for up to 3 pages - _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); - } - if (_classPrivateFieldLooseBase(this, _isPingContinuous)[_isPingContinuous]()) { - setInterval(() => { - _classPrivateFieldLooseBase(this, _pingRequest)[_pingRequest](); - }, CONTINUOUS_PING_FREQ_IN_MILLIS); + if (parseInt(data.pg) === 1) { + _classPrivateFieldLooseBase(this, _overrideDSyncFlag)[_overrideDSyncFlag](data); } - }, FIRST_PING_FREQ_IN_MILLIS); - } - _isPersonalisationActive() { - return StorageManager._isLocalStorageSupported() && this.enablePersonalization; - } + pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page'); + pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); - // eslint-disable-next-line accessor-pairs - set popupCallback(callback) { - this.popupCallbacks[this.popupCurrentWzrkId] = callback; - } - /** - * - * @param {object} payload - */ + _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); + if (parseInt(data.pg) === 1) { + this.event.push(WZRK_FETCH, { + t: 4 + }); + } - // offline mode + _classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] = currLocation; + setTimeout(function () { + if (pgCount <= 3) { + // send ping for up to 3 pages + _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); + } - /** - * events will be recorded and queued locally when passed with true - * but will not be sent to the server until offline is disabled by passing false - * @param {boolean} arg - */ - setOffline(arg) { - if (typeof arg !== 'boolean') { - console.error('setOffline should be called with a value of type boolean'); - return; + if (_classPrivateFieldLooseBase(_this3, _isPingContinuous)[_isPingContinuous]()) { + setInterval(function () { + _classPrivateFieldLooseBase(_this3, _pingRequest)[_pingRequest](); + }, CONTINUOUS_PING_FREQ_IN_MILLIS); + } + }, FIRST_PING_FREQ_IN_MILLIS); } - - $ct.offline = arg; // if offline is disabled - // process events from cache - - if (!arg) { - _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + }, { + key: "_isPersonalisationActive", + value: function _isPersonalisationActive() { + return StorageManager._isLocalStorageSupported() && this.enablePersonalization; } - } - - getSDKVersion() { - return 'web-sdk-v1.11.3'; - } - - defineVariable(name, defaultValue) { - return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); - } + }, { + key: "setOffline", + // offline mode - syncVariables(onSyncSuccess, onSyncFailure) { - if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { - return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); - } else { - const m = 'App log level is not set to 4'; + /** + * events will be recorded and queued locally when passed with true + * but will not be sent to the server until offline is disabled by passing false + * @param {boolean} arg + */ + value: function setOffline(arg) { + if (typeof arg !== 'boolean') { + console.error('setOffline should be called with a value of type boolean'); + return; + } - _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); + $ct.offline = arg; // if offline is disabled + // process events from cache - return Promise.reject(new Error(m)); + if (!arg) { + _classPrivateFieldLooseBase(this, _request$7)[_request$7].processBackupEvents(); + } } - } + }, { + key: "getSDKVersion", + value: function getSDKVersion() { + return 'web-sdk-v1.11.3'; + } + }, { + key: "defineVariable", + value: function defineVariable(name, defaultValue) { + return Variable.define(name, defaultValue, _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1]); + } + }, { + key: "syncVariables", + value: function syncVariables(onSyncSuccess, onSyncFailure) { + if (_classPrivateFieldLooseBase(this, _logger$a)[_logger$a].logLevel === 4) { + return _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].syncVariables(onSyncSuccess, onSyncFailure); + } else { + var m = 'App log level is not set to 4'; - fetchVariables(onFetchCallback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); - } + _classPrivateFieldLooseBase(this, _logger$a)[_logger$a].error(m); - addVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); - } + return Promise.reject(new Error(m)); + } + } + }, { + key: "fetchVariables", + value: function fetchVariables(onFetchCallback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].fetchVariables(onFetchCallback); + } + }, { + key: "addVariablesChangedCallback", + value: function addVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addVariablesChangedCallback(callback); + } + }, { + key: "addOneTimeVariablesChangedCallback", + value: function addOneTimeVariablesChangedCallback(callback) { + _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); + } + }, { + key: "popupCallback", + // eslint-disable-next-line accessor-pairs + set: function set(callback) { + this.popupCallbacks[this.popupCurrentWzrkId] = callback; + } + /** + * + * @param {object} payload + */ - addOneTimeVariablesChangedCallback(callback) { - _classPrivateFieldLooseBase(this, _variableStore$1)[_variableStore$1].addOneTimeVariablesChangedCallback(callback); - } + }]); - } + return CleverTap; + }(); var _processOldValues2 = function _processOldValues2() { this.onUserLogin._processOldValues(); @@ -9083,8 +9884,8 @@ }; var _debounce2 = function _debounce2(func) { - let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; - let timeout; + var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300; + var timeout; return function () { clearTimeout(timeout); timeout = setTimeout(func, delay); @@ -9092,9 +9893,11 @@ }; var _checkPageChanged2 = function _checkPageChanged2() { - const debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](() => { - if (_classPrivateFieldLooseBase(this, _previousUrl)[_previousUrl] !== location.href) { - this.pageChanged(); + var _this4 = this; + + var debouncedPageChanged = _classPrivateFieldLooseBase(this, _debounce)[_debounce](function () { + if (_classPrivateFieldLooseBase(_this4, _previousUrl)[_previousUrl] !== location.href) { + _this4.pageChanged(); } }); @@ -9102,9 +9905,9 @@ }; var _pingRequest2 = function _pingRequest2() { - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; - let data = {}; + var data = {}; data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, undefined); pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a])); @@ -9124,9 +9927,9 @@ var _sendLocationData2 = function _sendLocationData2(payload) { // Send the updated value to LC - let data = {}; + var data = {}; data.af = {}; - const profileObj = {}; + var profileObj = {}; data.type = 'profile'; if (profileObj.tz == null) { @@ -9136,25 +9939,23 @@ data.profile = profileObj; if (payload) { - const keys = Object.keys(payload); - keys.forEach(key => { + var keys = Object.keys(payload); + keys.forEach(function (key) { data.af[key] = payload[key]; }); } if ($ct.location) { - data.af = { ...data.af, - ...$ct.location - }; + data.af = _objectSpread2(_objectSpread2({}, data.af), $ct.location); } data = _classPrivateFieldLooseBase(this, _request$7)[_request$7].addSystemDataToObject(data, true); _classPrivateFieldLooseBase(this, _request$7)[_request$7].addFlags(data); - const compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); + var compressedData = compressData(JSON.stringify(data), _classPrivateFieldLooseBase(this, _logger$a)[_logger$a]); - let pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; + var pageLoadUrl = _classPrivateFieldLooseBase(this, _account$6)[_account$6].dataPostURL; pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH); pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData); @@ -9162,7 +9963,7 @@ _classPrivateFieldLooseBase(this, _request$7)[_request$7].saveAndFireRequest(pageLoadUrl, $ct.blockRequest); }; - const clevertap = new CleverTap(window.clevertap); + var clevertap = new CleverTap(window.clevertap); window.clevertap = window.wizrocket = clevertap; return clevertap; diff --git a/clevertap.js.map b/clevertap.js.map index 6dc8e4bd..1a161272 100644 --- a/clevertap.js.map +++ b/clevertap.js.map @@ -1 +1 @@ -{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, payload, isPreview = false) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.open(url, '_blank').focus()\n }\n : () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.location.href = url\n }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n initialiseCTBuilder(event.data.url, event.data.variant ?? null, event.data.details ?? {})\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n */\nconst initialiseCTBuilder = (url, variant, details) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let notificationViewed = false\n const payload = {\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n }\n\n const raiseViewed = () => {\n if (!isPreview && !notificationViewed) {\n notificationViewed = true\n window.clevertap.renderNotificationViewed(payload)\n }\n }\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n payload.msgCTkv = { wzrk_selector: selector.selector }\n updateFormData(element, selector.values.form, payload, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n raiseViewed()\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n raiseViewed()\n processElement(element, s)\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD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USH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","constructor","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","dataPostPEURL","dataPostURL","recorderURL","emailURL","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","save","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","read","data","getItem","parse","e","remove","removeItem","removeCookie","name","domain","cookieStr","document","cookie","createCookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","readCookie","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","saveToLSorCookie","property","location","hostname","$ct","globalCache","readFromLSorCookie","trim","err","createBroadCookie","broadDomain","domainParts","testBroadDomain","testCookieName","tempCookie","getMetaProp","metaObj","setMetaProp","wzrkMetaObj","getAndClearMetaProp","setInstantDeleteFlagInK","k","flag","backupEvent","reqNo","backupArr","q","debug","removeBackup","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","get","item","saveCacheToLS","set","allKeys","objToArray","index","temp","getKey","getSecondLastKey","keysArr","getLastKey","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","s","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","sessionObj","getSessionCookieObject","kIdFromLS","guidFromLRUCache","lastK","lastGUID","unregisterTokenForGuid","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","_processOldValues","getDetails","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","fireRequest","skipARP","sendOULFlag","getDelayFrequency","account","randomDelay","random","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","ProfileHandler","profilesArr","getAttribute","propName","_handleIncrementDecrementValue","command","tz","profile","addSystemDataToObject","addFlags","compressedData","saveAndFireRequest","_handleMultiValueSet","arrayVal","array","toLowerCase","sendMultiValueData","_handleMultiValueAdd","propKey","propVal","existingValue","addValue","normalizedValue","_handleMultiValueRemove","removeValue","_handleMultiValueDelete","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","clear","addToK","ids","g","kId","anonymousUser","foundInCache","gFromCache","Identity","cookieName","loginArr","pop","processProfile","CTWebPopupImageOnly","HTMLElement","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","renderImageOnlyPopup","msgId","wzrk_id","pivotId","wzrk_pivot","onClickUrl","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","renderNotificationViewed","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","Message","config","message","wrapper","snackBar","renderMessage","createEl","part","_el","msg","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","raiseClickedEvent","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","contains","setBadgeStyle","msgCount","incomingMessages","msgs","updateInboxMessages","incomingMessagesForPreview","previewMsgs","now","buildUIForMessages","updateUnviewedBadgeCounter","connectedCallback","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","addMsgsToInboxFromLS","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","deleteMsgsFromUI","getInboxMessages","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","top","right","getBoundingClientRect","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","inbox_notifs","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","renderBanner","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","renderCarousel","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","enable","swPath","enablePush","setUpWebPushNotifications","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","setApplicationServerKey","applicationServerKey","_enableWebPush","enabled","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","getTotalVisits","visitCount","getLastVisit","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","debugPE","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","getTimeElapsed","sessionStart","getPageCount","seqNo","requestTime","RequestManager","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","post","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","getValue","getdefaultValue","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","addValueChangedCallback","removeValueChangedCallback","clearStartFlag","VariableStore","syncVariables","onSyncSuccess","onSyncFailure","meta","tk","r","status","fetchVariables","onFetchCallback","addVariablesChangedCallback","callback","addOneTimeVariablesChangedCallback","removeVariablesChangedCallback","removeOneTimeVariablesChangedCallback","callBack","CleverTap","spa","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","handleDecrementValue","setMultiValuesForKey","addMultiValueForKey","addMultiValuesForKey","removeMultiValueForKey","removeMultiValuesForKey","removeValueForKey","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","setOffline","arg","getSDKVersion","defineVariable","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;EAAO,MAAMA,aAAa,GAAG,oBAAtB;EACA,MAAMC,eAAe,GAAG,QAAxB;EACA,MAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;ECAQ,MAAMC,OAAN,CAAc;EAO3BC,EAAAA,WAAW,GAAsE;EAAA,QAApE;EAAEC,MAAAA;EAAF,KAAoE,uEAA3D,EAA2D;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BP,aAA2B;EAAA,QAAZQ,KAAY,uEAAJ,EAAI;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjER;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKK,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;;EAED,MAAIH,EAAJ,GAAU;EACR,uCAAO,IAAP;EACD;;EAED,MAAIA,EAAJ,CAAQI,SAAR,EAAmB;EACjB,gEAAkBA,SAAlB;EACD;;EAED,MAAIH,MAAJ,GAAc;EACZ,uCAAO,IAAP;EACD;;EAED,MAAIA,MAAJ,CAAY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B,IAAvB,wBAAnC;;EACA,MAAIsP,WAAW,GAAG,0DAActX,WAAhC;;EACAsX,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,MAAd,EAAsBvV,QAAtB,CAAtB;EACAuV,EAAAA,WAAW,GAAGzD,QAAQ,CAACyD,WAAD,EAAc,GAAd,EAAmBkI,cAAnB,CAAtB;;EAEA,4DAAcC,kBAAd,CAAiCnI,WAAjC,EAA8CrN,GAAG,CAACgC,YAAlD;EACD;;QC9yBG0L,SAAS,GAAG,IAAIgnC,SAAJ,CAAc/0C,MAAM,CAAC+N,SAArB;EAElB/N,MAAM,CAAC+N,SAAP,GAAmB/N,MAAM,CAACgO,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, payload, isPreview = false) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.open(url, '_blank').focus()\n }\n : () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.location.href = url\n }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let notificationViewed = false\n const payload = {\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n }\n\n const raiseViewed = () => {\n if (!isPreview && !notificationViewed) {\n notificationViewed = true\n window.clevertap.renderNotificationViewed(payload)\n }\n }\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n payload.msgCTkv = { wzrk_selector: selector.selector }\n updateFormData(element, selector.values.form, payload, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n raiseViewed()\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n raiseViewed()\n processElement(element, s)\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzIDI0IDQ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DM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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nB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAI6mC,SAAJ,CAAcz0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 497cd012..83d8153d 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var r=t("accountId"),s=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),d=t("token");class c{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,d,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,r)[r]}set id(e){i(this,r)[r]=e}get region(){return i(this,s)[s]}set region(e){i(this,s)[s]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,d)[d]}set token(e){i(this,d)[d]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const u=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),p=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),h=new RegExp("'","g"),g="clear",f="Charged ID",b="WZRK_CHARGED_ID",v="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",I="WZRK_ARP",M="WZRK_L",P="global",S="optOut",O="useIP",E="WZRK_X",_="push",A=31536e3,D="wzrk_",L="wzrk_id",T="Notification Viewed",z="Notification Clicked",j="WZRK_FPU",N="WZRK_PSD",R="$incr",B="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",W="WZRK_INBOX",q=1e3,G="wzrk_fetch",H="WZRK_PUSH_CONFIG",K=["Stayed","UTM Visited","App Launched","Notification Sent",T,z],Z=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Q=e=>"object"==typeof e&&e instanceof Date,Y=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},$=e=>!isNaN(parseFloat(e))&&isFinite(e),X=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,ee=e=>null!=e&&"undefined"!==e,te=(e,t)=>{if("object"!=typeof e){let i;return Z(e)?(i=ie(e,p),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=te(e[i],t);let n;n=ie(i,u),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},ie=(e,t)=>e.replace(t,""),oe=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ne=()=>Math.floor((new Date).getTime()/1e3),re=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(ae(e))return"$D_"+e},ae=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],r=new Date(n,o,i);return r.getDate()==i&&r.getMonth()==o&&r.getFullYear()==n};class le{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",r="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(r="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+r+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e=0;o--){if(a=0===o?s[o]+a:"."+s[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){r=a,de.broadDomain=r;break}}}else this.createCookie(e,t,i,r)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(M);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(M,o),i.debug("stored in ".concat(M," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(M);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(M,i))}}const de={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{},pushConfig:null};var ce=t("keyOrder"),ue=t("deleteFromObject");class pe{constructor(e){Object.defineProperty(this,ue,{value:he}),Object.defineProperty(this,ce,{writable:!0,value:void 0}),this.max=e;let t=le.readFromLSorCookie(E);if(t){const e={};i(this,ce)[ce]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,ce)[ce].push(t[o][0]));this.cache=e}else this.cache={},i(this,ce)[ce]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ue)[ue](e,this.cache),this.cache[e]=t,i(this,ce)[ce].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,ce)[ce];null!=o?this.cache=i(this,ue)[ue](e,this.cache):n.length===this.max&&(this.cache=i(this,ue)[ue](n[0],this.cache)),this.cache[e]=t,i(this,ce)[ce][i(this,ce)[ce]-1]!==e&&i(this,ce)[ce].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,ce)[ce];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}le.saveToLSorCookie(E,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,ce)[ce];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,ce)[ce];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,ce)[ce].length;if(e)return i(this,ce)[ce][e-1]}}var he=function(e,t){const o=JSON.parse(JSON.stringify(i(this,ce)[ce])),n={};let r;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:r=i);return o.splice(r,1),i(this,ce)[ce]=JSON.parse(JSON.stringify(o)),n},ge=t("logger"),fe=t("request"),be=t("device"),ve=t("session");class me{constructor(e){let{logger:t,request:o,device:n,session:r}=e;Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,ge)[ge]=t,i(this,fe)[fe]=o,i(this,be)[be]=n,i(this,ve)[ve]=r}s(e,t,o,n,r){let s=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,s=!0),void 0===n&&(n=0),le.removeBackup(n,i(this,ge)[ge]),n>de.globalCache.REQ_N)return;if(ee(i(this,be)[be].gcookie)||e&&(a=!0),!ee(i(this,be)[be].gcookie)||o||"boolean"==typeof r){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Q(e[t])&&(e[t]=re(e[t]))}return!0}return!1},ze=(e,t)=>{if(J(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Q(e[i])&&(e[i]=re(e[i]))}if(Z(e[f])||X(e[f])){const i=e[f]+"";if(void 0===Le&&(Le=le.readFromLSorCookie(b)),void 0!==Le&&Le.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Le=i,le.saveToLSorCookie(b,i)}return!0}return!1};var je=t("logger"),Ne=t("oldValues"),Re=t("request"),Be=t("isPersonalisationActive"),Ue=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,Ue,{value:Ve}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,Ne)[Ne]=t,i(this,Re)[Re]=n,i(this,Be)[Be]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o0;){var t=e.shift();if(!Z(t)){i(this,je)[je].error(Ie);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),K.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=ie(t,u),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!ze(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Re)[Re].processEvent(o)}};const We=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const r=/\+/g,s=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=s.exec(o);n;)t[a(n[1])]=a(n[2]),n=s.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Ge=()=>window.location.hostname,He=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ze(e)),Ke=(()=>{let e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="})(),Ze=e=>{if(null==e)return"";var t,i,o,n,r,s,a,l="",d=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},r={},s="",a="",l="",d=2,c=3,u=2,p="",h=0,g=0,f=String.fromCharCode;for(o=0;o>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,u),u++),n[a]=c++,l=String(s)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(i=1,t=0;t>=1}d--,0==d&&(d=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t>=1;d--,0==d&&(d=Math.pow(2,u),u++)}for(i=2,t=0;t>=1;for(;;){if(h<<=1,15==g){p+=f(h);break}g++}return p})(e);d<2*e.length;)d%2==0?(t=e.charCodeAt(d/2)>>8,i=255&e.charCodeAt(d/2),o=d/2+1>8:NaN):(t=255&e.charCodeAt((d-1)/2),(d+1)/2>8,o=255&e.charCodeAt((d+1)/2)):i=o=NaN),d+=3,n=t>>2,r=(3&t)<<4|i>>4,s=(15&i)<<2|o>>6,a=63&o,isNaN(i)?s=a=64:isNaN(o)&&(a=64),l=l+Ke.charAt(n)+Ke.charAt(r)+Ke.charAt(s)+Ke.charAt(a);return l};var Je=t("fireRequest"),Qe=t("dropRequestDueToOptOut"),Ye=t("addUseIPToRequest"),$e=t("addARPToRequest");class Xe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=q,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),q;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=q,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Xe.logger=void 0,Xe.device=void 0,Xe.account=void 0,Object.defineProperty(Xe,Je,{value:function(e,t,o,n,r){var s,a;if(i(this,Qe)[Qe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(ee(this.device.gcookie)||(de.blockRequest=!0),r&&r===G)!ee(this.device.gcookie)&&de.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!ee(this.device.gcookie)&&de.globalCache.RESP_N{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(ee(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,$e)[$e](e,o)),e=qe(e,"tries",t),e=i(this,Ye)[Ye](e),e=qe(e,"r",(new Date).getTime()),(null===(s=window.clevertap)||void 0===s?void 0:s.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const d=document.createElement("script");d.setAttribute("type","text/javascript"),d.setAttribute("src",e),d.setAttribute("class","ct-jp-cb"),d.setAttribute("rel","nofollow"),d.async=!0,document.getElementsByTagName("head")[0].appendChild(d),this.logger.debug("req snt -> url: "+e)}}),Object.defineProperty(Xe,Qe,{value:function(){return!de.isOptInRequest&&ee(this.device.gcookie)&&Z(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(de.isOptInRequest=!1,!1)}}),Object.defineProperty(Xe,Ye,{value:function(e){var t=le.getMetaProp(O);return"boolean"!=typeof t&&(t=!1),qe(e,O,t?"true":"false")}}),Object.defineProperty(Xe,$e,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",He(JSON.stringify(t),this.logger))}return le._isLocalStorageSupported()&&void 0!==localStorage.getItem(I)&&null!==localStorage.getItem(I)?qe(e,"arp",He(JSON.stringify(le.readFromLSorCookie(I)),this.logger)):e}});const et=()=>{let e={};if(le._isLocalStorageSupported()){let t=le.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(h,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},tt=e=>{if(le._isLocalStorageSupported()){const t={...et(),...e},i=JSON.stringify(t);le.save(y,encodeURIComponent(i)),it()}},it=()=>{if(le._isLocalStorageSupported()){let i=le.read(v);if(ee(i))try{i=JSON.parse(decodeURIComponent(le.read(v)));const o=le.read(w)?JSON.parse(decodeURIComponent(le.read(w))):{};if(i&&le._isLocalStorageSupported()){var e={},t=et();Object.keys(t).forEach((n=>{const r=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},s=t[n].global,a=oe(),l=t[n][a];if(void 0!==s){const e=Object.keys(s);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==s&&void 0!==s[a]&&(n=s[a]),i=[a,o,n],r[a]=i}}}e={...e,[n]:r}})),o[i]=e,le.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},ot=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));let t={};if(le._isLocalStorageSupported()){let i={};t=et();const o=le.read(w),n=o?decodeURIComponent(o):null,r=n?JSON.parse(n):null,s=e&&null!=o&&r&&r[e]&&r[e].wp?Object.values(r[e].wp):[],a=e&&null!=o&&r&&r[e]&&r[e].wi?Object.values(r[e].wi):[],l=oe();let d=0,c=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(d=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(c=t.wi[l].tc),i={wmp:d,wimp:c,tlc:s,witlc:a},i}},nt=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/^M$|^F$/)||(o=!1,i.error(Me)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Pe)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&($(n)?e.Age=+n:(o=!1,i.error(Ee))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Q(n)||(o=!1,i.error(_e)),Q(n)&&(e[t]=re(n))):Q(n)&&(e[t]=re(n)),"Phone"!==t||Y(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),$(n)?e.Phone=+n:(o=!1,i.error(De+". Removed."))):(o=!1,i.error(De+". Removed."))),o||delete e[t]}return o},rt=e=>{const t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(let t=0;t{if(le._isLocalStorageSupported()){if(null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x),null==de.globalProfileMap&&(de.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(de.globalProfileMap.hasOwnProperty(i)&&!t)continue;de.globalProfileMap[i]=e[i]}null!=de.globalProfileMap._custom&&delete de.globalProfileMap._custom,le.saveToLSorCookie(x,de.globalProfileMap)}},lt=(e,t,i)=>{if(null!=e&&"-1"!==e&&le._isLocalStorageSupported()){const t=et();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",tt(t)}if(null!=de.campaignDivMap){const t=de.campaignDivMap[e];null!=t&&(document.getElementById(t).style.display="none","intentPreview"===t?null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"):"wizParDiv0"===t?null!=document.getElementById("intentOpacityDiv0")&&(document.getElementById("intentOpacityDiv0").style.display="none"):"wizParDiv2"===t&&null!=document.getElementById("intentOpacityDiv2")&&(document.getElementById("intentOpacityDiv2").style.display="none"))}};var dt=t("logger"),ct=t("request"),ut=t("account"),pt=t("oldValues"),ht=t("isPersonalisationActive"),gt=t("processProfileArray");class ft extends Array{constructor(e,t){let{logger:o,request:n,account:r,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,gt,{value:bt}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),i(this,dt)[dt]=o,i(this,ct)[ct]=n,i(this,ut)[ut]=r,i(this,pt)[pt]=t,i(this,ht)[ht]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o{const t="number"==typeof e?e:e.toLowerCase();r.includes(t)||r.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?s(e):i(this,dt)[dt].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,dt)[dt].error("Unsupported value type");s(t)}de.globalProfileMap[e]=r,le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x)||{}),!de.globalProfileMap.hasOwnProperty(e))return void i(this,dt)[dt].error("The property ".concat(e," does not exist."));const n=t=>{const i=de.globalProfileMap[e].indexOf(t);-1!==i&&de.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,dt)[dt].error("Unsupported propVal type");n(t)}0===de.globalProfileMap[e].length&&delete de.globalProfileMap[e],le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==de.globalProfileMap&&(de.globalProfileMap=le.readFromLSorCookie(x)),(null==de||null===(o=de.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete de.globalProfileMap[e]:i(this,dt)[dt].error("The property ".concat(e," does not exist.")),le.saveToLSorCookie(x,de.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const r={};n.type="profile",r[e]={[o]:o===F||t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=i(this,ct)[ct].addSystemDataToObject(n,!0),i(this,ct)[ct].addFlags(n);const s=He(JSON.stringify(n),i(this,dt)[dt]);let a=i(this,ut)[ut].dataPostURL;a=qe(a,"type",_),a=qe(a,"d",s),i(this,ct)[ct].saveAndFireRequest(a,de.blockRequest)}}var bt=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,r={};if(null!=o.Site){if(n=o.Site,Y(n)||!nt(n,{logger:i(this,dt)[dt]}))return}else if(null!=o.Facebook){const e=o.Facebook;Y(e)||e.error||(n=rt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];Y(e)||e.error||(n=st(e,{logger:i(this,dt)[dt]}))}if(null!=n&&!Y(n)){r.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),r.profile=n,at(n,!0),r=i(this,ct)[ct].addSystemDataToObject(r,void 0),i(this,ct)[ct].addFlags(r);const e=He(JSON.stringify(r),i(this,dt)[dt]);let t=i(this,ut)[ut].dataPostURL;t=qe(t,"type",_),t=qe(t,"d",e),i(this,ct)[ct].saveAndFireRequest(t,de.blockRequest)}}},vt=t("request"),mt=t("logger"),yt=t("account"),wt=t("session"),Ct=t("oldValues"),kt=t("device"),xt=t("processOUL"),It=t("handleCookieFromCache"),Mt=t("deleteUser"),Pt=t("processLoginArray");class St extends Array{constructor(e,t){let{request:o,account:n,session:r,logger:s,device:a}=e;super(),Object.defineProperty(this,Pt,{value:At}),Object.defineProperty(this,Mt,{value:_t}),Object.defineProperty(this,It,{value:Et}),Object.defineProperty(this,xt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,yt)[yt]=n,i(this,wt)[wt]=r,i(this,mt)[mt]=s,i(this,Ct)[Ct]=t,i(this,kt)[kt]=a}clear(){i(this,mt)[mt].debug("clear called. Reset flag has been set."),i(this,Mt)[Mt](),le.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o{let o=le.readFromLSorCookie(m);const n=le.readFromLSorCookie(v);let r;if(null==o)o={},r=e;else{r=o.id;let s=!1,a=!1;if(null==r&&(r=e[0],s=!0),null==de.LRU_CACHE&&le._isLocalStorageSupported()&&(de.LRU_CACHE=new pe(100)),s)null!=n&&(de.LRU_CACHE.set(r,n),de.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(de.LRU_CACHE.cache[i]){r=i,a=!0;break}}if(a){r!==de.LRU_CACHE.getLastKey()?i(this,It)[It]():(t=!1,le.saveToLSorCookie(j,t));const e=de.LRU_CACHE.get(r);de.LRU_CACHE.set(r,e),le.saveToLSorCookie(v,e),i(this,kt)[kt].gcookie=e;const o=de.LRU_CACHE.getSecondLastKey();if(le.readFromLSorCookie(j)&&-1!==o){const e=de.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else s?null!=n&&(i(this,kt)[kt].gcookie=n,le.saveToLSorCookie(v,n),t=!1):this.clear(),le.saveToLSorCookie(j,!1),r=e[0]}o.id=r,le.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const r=e[n];let s,a={};if(null!=r.Site){if(s=r.Site,Y(s)||!nt(s,{logger:i(this,mt)[mt]}))return}else if(null!=r.Facebook){const e=r.Facebook;Y(e)||e.error||(s=rt(e))}else if(null!=r["Google Plus"]){const e=r["Google Plus"];Y(e)&&!e.error&&(s=st(e,{logger:i(this,mt)[mt]}))}if(null!=s&&!Y(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;const e=[];le._isLocalStorageSupported()&&(s.Identity&&e.push(s.Identity),s.Email&&e.push(s.Email),s.GPID&&e.push("GP:"+s.GPID),s.FBID&&e.push("FB:"+s.FBID),e.length>0&&o(e)),at(s,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=He(JSON.stringify(a),i(this,mt)[mt]);let r=i(this,yt)[yt].dataPostURL;r=qe(r,"type",_),r=qe(r,"d",n),i(this,vt)[vt].saveAndFireRequest(r,de.blockRequest,t)}}},Et=function(){de.blockRequest=!1,console.debug("Block request is false"),le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),le.removeCookie(y,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,de.broadDomain),le.removeCookie(I,de.broadDomain),i(this,wt)[wt].setSessionCookieObject("")},_t=function(){de.blockRequest=!0,i(this,mt)[mt].debug("Block request is true"),de.globalCache={gcookie:null,REQ_N:0,RESP_N:0},le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),le.removeCookie(v,de.broadDomain),le.removeCookie(y,Ge()),le.removeCookie(m,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,de.broadDomain),le.removeCookie(I,de.broadDomain),i(this,kt)[kt].gcookie=null,i(this,wt)[wt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){le.setInstantDeleteFlagInK();try{i(this,xt)[xt]([t])}catch(e){i(this,mt)[mt].debug(e)}}else i(this,mt)[mt].error("Profile object is in incorrect format")}};class Dt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&le._isLocalStorageSupported()){const i=et();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",tt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Lt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="".concat(Wt(e.id.split("_")[1]),""),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class Tt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.inboxSelector.contains(e.target)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.inbox&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:le.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Rt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Bt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const r="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=r,e.date=i-n,e.viewed=0,t[r]=e,o[r]=e,this.unviewedMessages[r]=e,this.unviewedCounter++})),Bt(t),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},r=i.children[0],s=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(r);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(s),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Lt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let r=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;r>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),r--}const s=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=s?"none":"block"}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Rt();i[e]=t,Bt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(de.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),s=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||r||s)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Rt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:r,categoriesTabColor:s,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:d,selectedCategoryTitleColor:c,selectedCategoryBorderColor:u,headerCategoryHeight:p}=e;return'\n \n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:r,buttonTextColor:s,unreadMarkerColor:a}=e;return'\n \n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const zt=e=>{e.inbox_preview?de.inbox.incomingMessagesForPreview=e.inbox_notifs:de.inbox.incomingMessages=e},jt=e=>{Ft(),de.inbox=new Tt({logger:e}),document.body.appendChild(de.inbox)},Nt=e=>{const t=le.readFromLSorCookie(W)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,le.saveToLSorCookie(W,i),i}return t},Rt=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(e))return{};const t=Nt(e);return t.hasOwnProperty(e)?t[e]:{}},Bt=e=>{const t=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(t))return;const i={...Nt(t),[t]:e};le.saveToLSorCookie(W,i)},Ut=e=>new Promise(((t,i)=>{if("complete"===document.readyState)jt(e),t();else{const i=le.readFromLSorCookie(V)||{},o=()=>{null===de.inbox&&jt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const r=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ft=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",Tt),customElements.define("ct-inbox-message",Lt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,r=window.innerWidth+o,s=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,d=a.y+n,c=a.left+o,u=a.right+o,p=a.top+n,h=a.bottom,g=a.height,f=a.width;let b,v,m=!1;const y=16;if(h+t<=s){const e=s-(h+t);v=e>=y?h+y:h+e}else if(p-t>=n){const e=p-t;v=e>=y?p-t-y:p-t-e}else m=!0,v=d+g/2-t/2,vs&&(v=s-t);if(m){const e=u+i;if(e<=r){b=u+(e+y<=r?y:r-e)}else{const e=c-i;b=e-(e-y>=o?y:e-o)}}else b=l+f/2-i/2,br&&(b=u-i>=o?u-i:r-i);return{xPos:b,yPos:v}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},qt=()=>Object.keys(le.readFromLSorCookie(V)||{}).length>0,Gt='\n\n\n',Ht='\n\n\n',Kt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",Jt="wve-anti-flicker-hide",Qt="wve-flicker-style",Yt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)$t(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{});else"Overlay"===e.data.message&&oi(e.data,!0)}},$t=(e,t,i)=>{"complete"===document.readyState?ii(e,t,i):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&ii(e,t,i)}))};let Xt,ei=!1,ti=!1;function ii(e,t,i){if(!ei){window.Shopify&&(ti=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",Xt=document.createElement("div"),Xt.id="overlayDiv",Xt.style.position="relative",Xt.style.display="flex",document.body.appendChild(Xt);(function(e,t,i,o){return new Promise(((n,r)=>{var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:ti}),n()):r(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){r(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i).then((()=>{console.log("Overlay script loaded successfully."),ei=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=Kt,document.head.appendChild(o)}var o}const oi=(e,t)=>{const i=t?e.details:e.display.details;let o=!1;const n={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=()=>{t||o||(o=!0,window.clevertap.renderNotificationViewed(n))},s=(i,o)=>{var r;o.values&&(o.values.html?i.outerHTML=o.values.html:(null===(r=o.values)||void 0===r?void 0:r.json)?function(e,t){const i={};i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);null!=t.json&&(i.json=t.json);const o=new CustomEvent("CT_web_native_display_buider",{detail:i});document.dispatchEvent(o)}(e,o.values):(n.msgCTkv={wzrk_selector:o.selector},function(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=t.text),void 0!==t.clickDetails){const n=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>{o||window.clevertap.raiseNotificationClicked(i),window.open(n,"_blank").focus()}:()=>{o||window.clevertap.raiseNotificationClicked(i),window.location.href=n}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}}(i,o.values.form,n,t)))};i.forEach((e=>{e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((e=>{const t=document.querySelector(e.selector);t?(r(),s(t,e)):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e.selector);o?(r(),s(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)}))}))};function ni(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,r=0;function s(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.tope.classList.add(Jt))),setTimeout((()=>{e.forEach((e=>{e.classList.remove(Jt),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),r++,(0===Object.keys(o).length||r>20)&&(r=0,clearInterval(n))}),100))}!function(){const e=Qt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,s(t))})).observe(document.body,{childList:!0,subtree:!0})}(),s(t)}))}class ri extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n \n \n ")}}class si extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ri)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n \n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}const ai=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ri);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},li=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",si);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},di=e=>{const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});document.dispatchEvent(i)},ci=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},ui=(e,t)=>{const i="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm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My4wNTg5IDM4LjA5OTUgMjIuMzk4NCAzOC43NiAyMi4zOTg0IDM5LjU3NDZDMjIuMzk4NCA0MC4zODkzIDIzLjA1ODkgNDEuMDQ5NyAyMy44NzM1IDQxLjA0OTdIMjkuNzgxMlY0MS43ODQyQzI5Ljc4MTIgNDMuMDA3NyAzMC43NzMxIDQzLjk5OTYgMzEuOTk2NiA0My45OTk2QzMzLjIyMDIgNDMuOTk5NiAzNC4yMTIgNDMuMDA3NyAzNC4yMTIgNDEuNzg0MlY0MS4wNDk3SDQwLjEyMzNDNDAuOTM4IDQxLjA0OTcgNDEuNTk4NCA0MC4zODkzIDQxLjU5ODQgMzkuNTc0NkM0MS41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,aALvE;EAKuE;EAAA;EAAA;EAAA,aAJjEP;EAIiE;EAAA;EAAA;EAAA,aAHjE;EAGiE;EAAA;EAAA;EAAA,aAFxE;EAEwE;EAC/E,SAAKI,EAAL,GAAUA,EAAV;;EACA,QAAIC,MAAJ,EAAY;EACV,WAAKA,MAAL,GAAcA,MAAd;EACD;;EACD,QAAIC,YAAJ,EAAkB;EAChB,WAAKA,YAAL,GAAoBA,YAApB;EACD;;EACD,QAAIC,KAAJ,EAAW;EACT,WAAKA,KAAL,GAAaA,KAAb;EACD;EACF;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uB,IAAvB,wBAAnC;;EACA,MAAI8O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB7U,QAAtB,CAAtB;EACA6U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAI6mC,SAAJ,CAAcz0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, payload, isPreview = false) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.open(url, '_blank').focus()\n }\n : () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.location.href = url\n }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let notificationViewed = false\n const payload = {\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n }\n\n const raiseViewed = () => {\n if (!isPreview && !notificationViewed) {\n notificationViewed = true\n window.clevertap.renderNotificationViewed(payload)\n }\n }\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n payload.msgCTkv = { wzrk_selector: selector.selector }\n updateFormData(element, selector.values.form, payload, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n raiseViewed()\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n raiseViewed()\n processElement(element, s)\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzID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41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 83d8153d..2a4cbe40 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}var k=0;function C(e){return"__private_"+k+++"_"+e}function x(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var I,M="clevertap-prod.com",S="https:",P=C("accountId"),O=C("region"),E=C("targetDomain"),_=C("dcSdkversion"),A=C("token"),D=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:""}),Object.defineProperty(this,E,{writable:!0,value:M}),Object.defineProperty(this,_,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=i,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return i(e,[{key:"id",get:function(){return x(this,P)[P]},set:function(e){x(this,P)[P]=e}},{key:"region",get:function(){return x(this,O)[O]},set:function(e){x(this,O)[O]=e}},{key:"dcSDKVersion",get:function(){return x(this,_)[_]},set:function(e){x(this,_)[_]=e}},{key:"targetDomain",get:function(){return x(this,E)[E]},set:function(e){x(this,E)[E]=e}},{key:"token",get:function(){return x(this,A)[A]},set:function(e){x(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===M?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),L=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),j=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),T=new RegExp("'","g"),z="clear",N="Charged ID",R="WZRK_CHARGED_ID",B="WZRK_G",U="WZRK_K",F="WZRK_CAMP",V="WZRK_CAMP_G",W="WZRK_EV",q="WZRK_META",G="WZRK_PR",H="WZRK_ARP",K="WZRK_L",Z="global",J="optOut",Q="useIP",Y="WZRK_X",$="push",X=31536e3,ee="2",te="wzrk_",ne="wzrk_id",ie="Notification Viewed",oe="Notification Clicked",re="WZRK_FPU",ae="WZRK_PSD",se="$incr",le="$decr",ce="$set",de="$add",ue="$remove",pe="$delete",he="WZRK_INBOX_CONFIG",ge="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ye="WZRK_PUSH_CONFIG",be=["Stayed","UTM Visited","App Launched","Notification Sent",ie,oe],me=function(e){return"string"==typeof e||e instanceof String},we=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ke=function(t){return"object"===e(t)&&t instanceof Date},Ce=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},xe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ie=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},Me=function(e){return null!=e&&"undefined"!==e},Se=function t(n,i){var o;if("object"!==e(n))return me(n)?(o=Pe(n,j)).length>1024&&(o=o.substring(0,1024),i.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=n,o;for(var r in n)if(n.hasOwnProperty(r)){var a=t(n[r],i),s=void 0;(s=Pe(r,L)).length>1024&&(s=s.substring(0,1024),i.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete n[r],n[s]=a}return n},Pe=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ee=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ae=function(e){if(De(e))return"$D_"+e},De=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var n=t[3],i=t[2]-1,o=t[1],r=new Date(o,i,n);return r.getDate()==n&&r.getMonth()==i&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return i(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(n=n+" domain="+t+"; path=/"),document.cookie=n}},{key:"createCookie",value:function(e,t,n,i){var o="",r="";if(n){var a=new Date;a.setTime(a.getTime()+1e3*n),o="; expires="+a.toGMTString()}i&&(r="; domain="+i),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,n,a),this.readCookie(e)==t){o=a,je.broadDomain=o;break}}else this.createCookie(e,t,n,o)}else this.createCookie(e,t,n,i)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var n=this.readFromLSorCookie(q);null==n&&(n={}),void 0===t?delete n[e]:n[e]=t,this.saveToLSorCookie(q,n)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(U);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(U,e)}},{key:"backupEvent",value:function(e,t,n){var i=this.readFromLSorCookie(K);void 0===i&&(i={}),i[t]={q:e},this.saveToLSorCookie(K,i),n.debug("stored in ".concat(K," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var n=this.readFromLSorCookie(K);null!=n&&void 0!==n[e]&&(t.debug("del event: ".concat(e," data-> ").concat(n[e].q)),delete n[e],this.saveToLSorCookie(K,n))}}]),e}(),je={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{},pushConfig:null},Te=C("keyOrder"),ze=C("deleteFromObject"),Ne=function(){function e(n){t(this,e),Object.defineProperty(this,ze,{value:Re}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=n;var i=Le.readFromLSorCookie(Y);if(i){var o={};for(var r in x(this,Te)[Te]=[],i=i.cache)i.hasOwnProperty(r)&&(o[i[r][0]]=i[r][1],x(this,Te)[Te].push(i[r][0]));this.cache=o}else this.cache={},x(this,Te)[Te]=[]}return i(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=x(this,ze)[ze](e,this.cache),this.cache[e]=t,x(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var n=this.cache[e],i=x(this,Te)[Te];null!=n?this.cache=x(this,ze)[ze](e,this.cache):i.length===this.max&&(this.cache=x(this,ze)[ze](i[0],this.cache)),this.cache[e]=t,x(this,Te)[Te][x(this,Te)[Te]-1]!==e&&x(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],n=x(this,Te)[Te];for(var i in n)if(n.hasOwnProperty(i)){var o=[];o.push(n[i]),o.push(e[n[i]]),t.push(o)}Le.saveToLSorCookie(Y,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=x(this,Te)[Te];for(var n in t)if(t.hasOwnProperty(n)&&this.cache[t[n]]===e)return t[n];return null}},{key:"getSecondLastKey",value:function(){var e=x(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=x(this,Te)[Te].length;if(e)return x(this,Te)[Te][e-1]}}]),e}(),Re=function(e,t){var n,i=JSON.parse(JSON.stringify(x(this,Te)[Te])),o={};for(var r in i)i.hasOwnProperty(r)&&(i[r]!==e?o[i[r]]=t[i[r]]:n=r);return i.splice(n,1),x(this,Te)[Te]=JSON.parse(JSON.stringify(i)),o},Be=C("logger"),Ue=C("request"),Fe=C("device"),Ve=C("session"),We=function(){function e(n){var i=n.logger,o=n.request,r=n.device,a=n.session;t(this,e),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,Ve,{writable:!0,value:void 0}),x(this,Be)[Be]=i,x(this,Ue)[Ue]=o,x(this,Fe)[Fe]=r,x(this,Ve)[Ve]=a}return i(e,[{key:"s",value:function(e,t,n,i,o){var r=!1,a=!1;if(window.isOULInProgress&&(n||"undefined"!==i&&i===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===i&&(i=0),Le.removeBackup(i,x(this,Be)[Be]),!(i>je.globalCache.REQ_N)){if(Me(x(this,Fe)[Fe].gcookie)||e&&(a=!0),!Me(x(this,Fe)[Fe].gcookie)||n||"boolean"==typeof o){var s=x(this,Ve)[Ve].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[n].length),e[n])if(e[n].hasOwnProperty(i)&&(!we(e[n][i])||!ot(e[n][i])))return!1}else{if(we(e[n])||Array.isArray(e[n]))return!1;ke(e[n])&&(e[n]=_e(e[n]))}if(me(e[N])||Ie(e[N])){var o=e[N]+"";if(void 0===I&&(I=Le.readFromLSorCookie(R)),void 0!==I&&I.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;I=o,Le.saveToLSorCookie(R,o)}return!0}return!1},at=C("logger"),st=C("oldValues"),lt=C("request"),ct=C("isPersonalisationActive"),dt=C("processEventArray"),ut=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=n.call(this),Object.defineProperty(h(r),dt,{value:pt}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),Object.defineProperty(h(r),lt,{writable:!0,value:void 0}),Object.defineProperty(h(r),ct,{writable:!0,value:void 0}),x(h(r),at)[at]=a,x(h(r),st)[st]=i,x(h(r),lt)[lt]=s,x(h(r),ct)[ct]=l,r}return i(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0;){var t=e.shift();if(me(t))if(t.length>1024&&(t=t.substring(0,1024),x(this,at)[at].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),be.includes(t))x(this,at)[at].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var n={type:"event"};if(n.evtName=Pe(t,L),0!==e.length){var i=e.shift();if(we(i)){if("Charged"===t){if(!rt(i,x(this,at)[at])){x(this,at)[at].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!ot(i)){x(this,at)[at].reportError(512,t+" event structure invalid. Not sent.");continue}n.evtData=i}else e.unshift(i)}x(this,lt)[lt].processEvent(n)}else x(this,at)[at].error(Je)}},ht=function(e){var t={},n=e.indexOf("?");if(n>1){var i,o=e.substring(n+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(i=a.exec(o);i;)t[s(i[1])]=s(i[2]),i=a.exec(o)}return t},gt=function(e,t,n){return e+"&"+t+"="+encodeURIComponent(n)},ft=function(){return window.location.hostname},vt=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),bt(e)},yt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),bt=function(e){if(null==e)return"";var t,n,i,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,n,i,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,g=0,f=String.fromCharCode;for(i=0;i>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(n=2,t=0;t>=1;for(;;){if(h<<=1,15==g){p+=f(h);break}g++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,n=255&e.charCodeAt(c/2),i=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,i=255&e.charCodeAt((c+1)/2)):n=i=NaN),c+=3,o=t>>2,r=(3&t)<<4|n>>4,a=(15&n)<<2|i>>6,s=63&i,isNaN(n)?a=s=64:isNaN(i)&&(s=64),l=l+yt.charAt(o)+yt.charAt(r)+yt.charAt(a)+yt.charAt(s);return l},mt=C("fireRequest"),wt=C("dropRequestDueToOptOut"),kt=C("addUseIPToRequest"),Ct=C("addARPToRequest"),xt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return i(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,n,i){x(this,mt)[mt](e,1,t,n,i)}}]),e}();xt.logger=void 0,xt.device=void 0,xt.account=void 0,Object.defineProperty(xt,mt,{value:function(e,t,n,i,o){var r,a,s=this;if(x(this,wt)[wt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(Me(this.device.gcookie)||(je.blockRequest=!0),o&&o===ve)!Me(this.device.gcookie)&&je.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(xt,wt,{value:function(){return!je.isOptInRequest&&Me(this.device.gcookie)&&me(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(je.isOptInRequest=!1,!1)}}),Object.defineProperty(xt,kt,{value:function(e){var t=Le.getMetaProp(Q);return"boolean"!=typeof t&&(t=!1),gt(e,Q,t?"true":"false")}}),Object.defineProperty(xt,Ct,{value:function(e,t){if(!0===t){var n={skipResARP:!0};return gt(e,"arp",vt(JSON.stringify(n),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(H)&&null!==localStorage.getItem(H)?gt(e,"arp",vt(JSON.stringify(Le.readFromLSorCookie(H)),this.logger)):e}});var It,Mt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(F);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(T,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},St=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},Mt()),e),n=JSON.stringify(t);Le.save(F,encodeURIComponent(n)),Pt()}},Pt=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(Me(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(V)?JSON.parse(decodeURIComponent(Le.read(V))):{};if(e&&Le._isLocalStorageSupported()){var n={},i=Mt();Object.keys(i).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=i[r].global,c=Oe(),d=i[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var g=0,f=0,v=u[p];if("tc"===v)continue;void 0!==d&&void 0!==d[v]&&(g=d[v]),void 0!==l&&void 0!==l[v]&&(f=l[v]),h=[v,g,f],s[v]=h}}}n=a(a({},n),{},o({},r,s))})),t[e]=n,Le.save(V,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=Mt();var n=Le.read(V),i=n?decodeURIComponent(n):null,o=i?JSON.parse(i):null,r=e&&null!=n&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=n&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},Et=function(e,t){var n=t.logger,i=!1;if(we(e))for(var o in e)if(e.hasOwnProperty(o)){i=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(i=!1,n.error(Qe)),"Employed"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error(Ye)),"Married"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(i=!1,n.error(Xe)),"Age"===o&&null!=r&&(xe(r)?e.Age=+r:(i=!1,n.error(et))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||ke(r)||(i=!1,n.error(tt)),ke(r)&&(e[o]=_e(r))):ke(r)&&(e[o]=_e(r)),"Phone"!==o||Ce(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),xe(r)?e.Phone=+r:(i=!1,n.error(it+". Removed."))):(i=!1,n.error(it+". Removed."))),i||delete e[o]}return i},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var n=function(e){if(null!=e){for(var t="",n="",i=0;i0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ae(o[2]+o[0]+o[1])}return t},At=function(e,t){var n=t.logger,i={};if(null!=e.displayName&&(i.Name=e.displayName),null!=e.id&&(i.GPID=e.id+""),null!=e.gender&&("male"===e.gender?i.Gender="M":"female"===e.gender?i.Gender="F":"other"===e.gender&&(i.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(i.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var n=e[t],i={},o=void 0;if(null!=n.Site){if(o=n.Site,Ce(o)||!Et(o,{logger:x(this,zt)[zt]}))return}else if(null!=n.Facebook){var r=n.Facebook;Ce(r)||r.error||(o=_t(r))}else if(null!=n["Google Plus"]){var a=n["Google Plus"];Ce(a)||a.error||(o=At(a,{logger:x(this,zt)[zt]}))}if(null!=o&&!Ce(o)){i.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),i.profile=o,Dt(o,!0),i=x(this,Nt)[Nt].addSystemDataToObject(i,void 0),x(this,Nt)[Nt].addFlags(i);var s=vt(JSON.stringify(i),x(this,zt)[zt]),l=x(this,Rt)[Rt].dataPostURL;l=gt(l,"type",$),l=gt(l,"d",s),x(this,Nt)[Nt].saveAndFireRequest(l,je.blockRequest)}}},qt=C("request"),Gt=C("logger"),Ht=C("account"),Kt=C("session"),Zt=C("oldValues"),Jt=C("device"),Qt=C("processOUL"),Yt=C("handleCookieFromCache"),$t=C("deleteUser"),Xt=C("processLoginArray"),en=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=n.call(this),Object.defineProperty(h(r),Xt,{value:rn}),Object.defineProperty(h(r),$t,{value:on}),Object.defineProperty(h(r),Yt,{value:nn}),Object.defineProperty(h(r),Qt,{value:tn}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Zt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Jt,{writable:!0,value:void 0}),x(h(r),qt)[qt]=a,x(h(r),Ht)[Ht]=s,x(h(r),Kt)[Kt]=l,x(h(r),Gt)[Gt]=c,x(h(r),Zt)[Zt]=i,x(h(r),Jt)[Jt]=d,r}return i(o,[{key:"clear",value:function(){x(this,Gt)[Gt].debug("clear called. Reset flag has been set."),x(this,$t)[$t](),Le.setMetaProp(z,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,Ce(s)||!Et(s,{logger:x(this,Gt)[Gt]}))return}else if(null!=r.Facebook){var l=r.Facebook;Ce(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];Ce(c)&&!c.error&&(s=At(c,{logger:x(this,Gt)[Gt]}))}if(null!=s&&!Ce(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&i(d)),Dt(s,!0),a=x(this,qt)[qt].addSystemDataToObject(a,void 0),x(this,qt)[qt].addFlags(a),n&&(a.isOUL=!0);var u=vt(JSON.stringify(a),x(this,Gt)[Gt]),p=x(this,Ht)[Ht].dataPostURL;p=gt(p,"type",$),p=gt(p,"d",u),x(this,qt)[qt].saveAndFireRequest(p,je.blockRequest,n)}}},nn=function(){je.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(F,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Kt)[Kt].setSessionCookieObject("")},on=function(){je.blockRequest=!0,x(this,Gt)[Gt].debug("Block request is true"),je.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,je.broadDomain),Le.removeCookie(F,ft()),Le.removeCookie(U,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Jt)[Jt].gcookie=null,x(this,Kt)[Kt].setSessionCookieObject("")},rn=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&we(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{x(this,Qt)[Qt]([t])}catch(e){x(this,Gt)[Gt].debug(e)}}else x(this,Gt)[Gt].error("Profile object is in incorrect format")}},an=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],n=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var i=Mt(),o=i.wp[n];null==o&&(o={},i[n]=o),o[t]="dnd",St(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var n=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(n,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),sn=function(e){s(o,e);var n=f(o);function o(e,i){var r;return t(this,o),(r=n.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=i,r.renderMessage(i),r}return i(o,[{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var n=this.createEl("div","timeStamp");if(n.innerHTML="".concat(yn(e.id.split("_")[1]),""),!e.viewed){var i=this.createEl("span","unreadMarker");n.appendChild(i)}this.wrapper.appendChild(n),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var n=this.addImage(e.imageUrl,"mainImg");t.appendChild(n)}var i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");i.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&i.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.createEl("div","buttonsContainer"),i=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(i=!0),n.appendChild(r)})),i&&this.addSnackbar(n),n}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=wn;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var n=this.createEl("div","".concat(t,"Container")),i=this.createEl("img",t);return i.setAttribute("src",e),i.setAttribute("loading","lazy"),n.appendChild(i),n}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var n=this,i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=i.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){n.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),ln=function(e){s(o,e);var n=f(o);function o(e){var i;return t(this,o),(i=n.call(this)).isInboxOpen=!1,i.isInboxFromFlutter=!1,i.selectedCategory=null,i.unviewedMessages={},i.unviewedCounter=0,i.isPreview=!1,i.inboxConfigForPreview={},i.inboxSelector=null,i.inbox=null,i.emptyInboxMsg=null,i.inboxCard=null,i.unviewedBadge=null,i.observer=null,i.selectedCategoryRef=null,i.addClickListenerOnDocument=function(e){if(e.composedPath().includes(i.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var n=t[0].id;if("closeInbox"===n)i.toggleInbox();else if(n.startsWith("category-"))i.prevCategoryRef=i.selectedCategoryRef,i.selectedCategoryRef=t[0],i.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],i.isPreview)}}}else(i.inboxSelector.contains(e.target)||i.isInboxOpen)&&(i.isInboxFromFlutter?i.isInboxFromFlutter=!1:i.toggleInbox(e))},i.setBadgeStyle=function(e){null!==i.unviewedBadge&&(i.unviewedBadge.innerText=e>9?"9+":e,i.unviewedBadge.style.display=e>0?"flex":"none")},i.logger=e,i.shadow=i.attachShadow({mode:"open"}),i}return i(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(he)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),n=t?Object.keys(t):[];0!==n.length&&(n.forEach((function(n){t[n].viewed||(e.unviewedMessages[n]=t[n],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=pn(),n=Math.floor(Date.now()/1e3);for(var i in t)if(t[i].wzrk_ttl&&t[i].wzrk_ttl>0&&t[i].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),hn(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=i-r,t.viewed=0,n[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),hn(n),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,n=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(n-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),n=this.createEl("div","headerTitle");n.innerText=this.config.title;var i=this.createEl("div","closeInbox");if(i.innerHTML="×",t.appendChild(n),t.appendChild(i),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,n){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),n=this.createEl("div","leftArrow");n.innerHTML=mn,n.children[0].style="transform: rotate(180deg)",n.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(n);var i=this.createEl("div","categoriesWrapper");["All"].concat(y(this.config.categories)).forEach((function(t,n){var o=e.createEl("div","category-".concat(n),"category");o.innerText=t,0===n&&(e.selectedCategoryRef=o),i.appendChild(o)})),t.appendChild(i);var o=this.createEl("div","rightArrow");o.innerHTML=mn,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=i.children[0],s=i.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(n,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var n=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&n++)})),0===n?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var n,i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=w(r);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=new sn(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>i;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,n=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,n?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var n=pn();n[e]=t,hn(n)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,n=getComputedStyle(je.inbox),i=n.getPropertyValue("--inbox-top"),o=n.getPropertyValue("--inbox-bottom"),r=n.getPropertyValue("--inbox-left"),a=n.getPropertyValue("--inbox-right");if(t>481&&!(i||o||r||a)){var s=vn(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var n=pn();n[t.id]&&0===n[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=yn(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var n,i,o,r,a,s,l,c,d,u,p,h,g,f,v,y,b,m,w,k,C,x=(i=(n=t).panelBackgroundColor,o=n.panelBorderColor,r=n.headerBackgroundColor,a=n.headerTitleColor,s=n.closeIconColor,l=n.categoriesTabColor,c=n.categoriesTitleColor,d=n.categoriesBorderColor,u=n.selectedCategoryTabColor,p=n.selectedCategoryTitleColor,h=n.selectedCategoryBorderColor,g=n.headerCategoryHeight,'\n \n ")),I=this.config.styles.cards;return x+(f={backgroundColor:I.backgroundColor,borderColor:I.borderColor,titleColor:I.titleColor,descriptionColor:I.descriptionColor,buttonColor:I.buttonColor,buttonTextColor:I.buttonTextColor,unreadMarkerColor:I.unreadMarkerColor},v=f.backgroundColor,y=f.borderColor,b=f.titleColor,m=f.descriptionColor,w=f.buttonColor,k=f.buttonTextColor,C=f.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var i="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=i,n[i]=t,e.unviewedMessages[i]=t,e.unviewedCounter++})),this.buildUIForMessages(n),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),cn=function(e){e.inbox_preview?je.inbox.incomingMessagesForPreview=e.inbox_notifs:je.inbox.incomingMessages=e},dn=function(e){fn(),je.inbox=new ln({logger:e}),document.body.appendChild(je.inbox)},un=function(e){var t=Le.readFromLSorCookie(ge)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var n={};return n[e]=t,Le.saveToLSorCookie(ge,n),n}return t},pn=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!Me(e))return{};var t=un(e);return t.hasOwnProperty(e)?t[e]:{}},hn=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(Me(t)){var n=a(a({},un(t)),{},o({},t,e));Le.saveToLSorCookie(ge,n)}},gn=function(e){return new Promise((function(t,n){if("complete"===document.readyState)dn(e),t();else{var i=Le.readFromLSorCookie(he)||{},o=function(){null===je.inbox&&dn(e),t()};window.addEventListener("load",(function(){if(document.getElementById(i.inboxSelector))o();else{var n=0;if(n<20)var r=setInterval((function(){document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}))}}))},fn=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",ln),customElements.define("ct-inbox-message",sn))},vn=function(e,t,n){var i,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,g=c.top+a,f=c.bottom,v=c.height,y=c.width,b=!1,m=16;if(f+t<=l){var w=l-(f+t);o=w>=m?f+m:f+w}else if(g-t>=a){var k=g-t;o=k>=m?g-t-m:g-t-k}else b=!0,(o=u+v/2-t/2)l&&(o=l-t);if(b){var C=h+n;if(C<=s){i=h+(C+m<=s?m:s-C)}else{var x=p-n;i=x-(x-m>=r?m:x-r)}}else(i=d+y/2-n/2)s&&(i=h-n>=r?h-n:s-n);return{xPos:i,yPos:o}},yn=function(e){var t=Date.now(),n=Math.floor((t-e)/6e4);return n<5?"Just now":n<60?"".concat(n," minute").concat(n>1?"s":""," ago"):(n=Math.floor(n/60))<24?"".concat(n," hour").concat(n>1?"s":""," ago"):(n=Math.floor(n/24),"".concat(n," day").concat(n>1?"s":""," ago"))},bn=function(){return Object.keys(Le.readFromLSorCookie(he)||{}).length>0},mn='\n\n\n',wn='\n\n\n',kn="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Cn="wve-anti-flicker-show",xn="wve-anti-flicker-hide",In="wve-flicker-style",Mn=function(e,t){var n=window.location.search,i=window.opener;if("?ctBuilder"===n)return e.debug("open in visual builder mode"),window.addEventListener("message",Sn,!1),void(i&&i.postMessage({message:"builder",originUrl:window.location.href},"*"));if("?ctBuilderPreview"===n&&(window.addEventListener("message",Sn,!1),i&&i.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===n&&i){i.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.11.3"},"*")}},Sn=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,n,i=new URL(e.data.originUrl).origin;if(e.origin===i)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Pn(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(n=e.data.details)&&void 0!==n?n:{},e.data.personalisation);else"Overlay"===e.data.message&&An(e.data,!0)}},Pn=function(e,t,n,i){"complete"===document.readyState?_n(e,t,n,i):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&_n(e,t,n,i)}))},On=!1,En=!1;function _n(e,t,n,i){if(!On){window.Shopify&&(En=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(It=document.createElement("div")).id="overlayDiv",It.style.position="relative",It.style.display="flex",document.body.appendChild(It);(function(e,t,n,i,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:n,details:i,isShopify:En,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,n,i).then((function(){console.log("Overlay script loaded successfully."),On=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=kn,document.head.appendChild(o)}var o}var An=function(e,t){var n=t?e.details:e.display.details,i=!1,o={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=function(){t||i||(i=!0,window.clevertap.renderNotificationViewed(o))},a=function(n,i){var r;i.values&&(i.values.html?n.outerHTML=i.values.html:(null===(r=i.values)||void 0===r?void 0:r.json)?function(e,t){var n={};n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);null!=t.json&&(n.json=t.json);var i=new CustomEvent("CT_web_native_display_buider",{detail:n});document.dispatchEvent(i)}(e,i.values):(o.msgCTkv={wzrk_selector:i.selector},function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((function(n){e.style.setProperty(n,t.style[n])})),void 0!==t.underline){var o=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(o," underline").trim():e.style.textDecoration=o.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text),void 0!==t.clickDetails){var r=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){i||window.clevertap.raiseNotificationClicked(n),window.open(r,"_blank").focus()}:function(){i||window.clevertap.raiseNotificationClicked(n),window.location.href=r}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var a=document.createElement("style");a.innerHTML=t.elementCss,document.head.appendChild(a)}}(n,i.values.form,o,t)))};n.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,n,i,o=document.querySelector(e.selector);o?(r(),a(o,e)):(t=e,n=0,i=setInterval((function(){var e=document.querySelector(t.selector);e?(r(),a(e,t),clearInterval(i)):++n>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(i))}),500))}))}))};function Dn(e){var t,n=e.personalizedSelectors,i=void 0===n?[]:n,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function n(e){var t=[];e.forEach((function(e){var n=document.querySelectorAll(e);n.length?(n.forEach((function(e){var n,i,o,r;n=e.getBoundingClientRect(),i=window,o=i.innerHeight,r=i.innerWidth,n.bottom>0&&n.right>0&&n.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=In;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(i))})).observe(document.body,{childList:!0,subtree:!0}),l(i)}))}var Ln=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),jn=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln),e}return i(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var n=t.target.id;if(n.startsWith("carousel__button")){var i=+n.split("-")[1];i!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=i,e.updateSelectedItem(),e.startAutoSlide())}else if(n.startsWith("carousel__arrow"))n.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(n.indexOf("-")>-1){var o=+n.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,n){var i=document.createElement("ct-web-personalisation-banner");i.classList.add("carousel__item"),i.trackClick=!1,i.setAttribute("id","carousel__item-".concat(n+1)),i.details=t,e.appendChild(i)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var n=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),i=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));n.classList.add("carousel__item--selected"),i&&i.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),Tn=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-banner");i.msgId=e.wzrk_id,i.pivotId=e.wzrk_pivot,i.divHeight=e.display.divHeight,i.details=e.display.details[0];var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},zn=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",jn);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-carousel");i.target=e;var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},Nn=function(e){var t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);var n=new CustomEvent("CT_web_native_display",{detail:t});document.dispatchEvent(n)},Rn=function(e,t){var n=window.parent[e];"function"==typeof n&&(null!=t.display.kv?n(t.display.kv):n())},Bn=function(e,t){var n="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzIDI0I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g0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, payload, isPreview = false) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n console.log(formStyle.text)\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.open(url, '_blank').focus()\n }\n : () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.location.href = url\n }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let notificationViewed = false\n const payload = {\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n }\n\n const raiseViewed = () => {\n if (!isPreview && !notificationViewed) {\n notificationViewed = true\n window.clevertap.renderNotificationViewed(payload)\n }\n }\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n payload.msgCTkv = { wzrk_selector: selector.selector }\n updateFormData(element, selector.values.form, payload, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n raiseViewed()\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n raiseViewed()\n processElement(element, s)\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzIDI0IDQ0LjUwMDNDMjguMDA1NSA0NC41MDAzIDMxLjc0MjYgNDMuMzUxNSAzNC45IDQxLjM2NTVDMzUuMjYwOCA0MS4xMzg1IDM1Ljc0MTYgNDEuMjM4NiAzNS45NjY4IDQxLjYwMDZDMzYuMTc5MiA0MS45NDE5IDM2LjA4NSA0Mi4zOTExIDM1Ljc0NTIgNDIuNjA2QzMyLjM0NjggNDQuNzU1OSAyOC4zMTg3IDQ2LjAwMDMgMjQgNDYuMDAwM0MxMS44NDk3IDQ2LjAwMDMgMiAzNi4xNTA1IDIgMjQuMDAwM0MyIDE2LjA2NjkgNi4xOTkyMSA5LjExNDMyIDEyLjQ5NjIgNS4yNDM5N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YWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA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AAClhB,GAAD,CAAtB;EACD,KAFD;EAGD;;EACD,MAAIqE,GAAG,CAACF,QAAR,EAAkB;EAChB5B,IAAAA,IAAI,CAACurC,EAAL,qCAAevrC,IAAI,CAACurC,EAApB,GAA2BzpC,GAAG,CAACF,QAA/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc+W,qBAAd,CAAoC/W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcgX,QAAd,CAAuBhX,IAAvB;;EACA,MAAMiX,cAAc,GAAG5K,YAAY,CAACvM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI8O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB7U,QAAtB,CAAtB;EACA6U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAI6mC,SAAJ,CAAcz0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 2a4cbe40..83d8153d 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}var k=0;function C(e){return"__private_"+k+++"_"+e}function x(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var I,M="clevertap-prod.com",S="https:",P=C("accountId"),O=C("region"),E=C("targetDomain"),_=C("dcSdkversion"),A=C("token"),D=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:""}),Object.defineProperty(this,E,{writable:!0,value:M}),Object.defineProperty(this,_,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=i,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return i(e,[{key:"id",get:function(){return x(this,P)[P]},set:function(e){x(this,P)[P]=e}},{key:"region",get:function(){return x(this,O)[O]},set:function(e){x(this,O)[O]=e}},{key:"dcSDKVersion",get:function(){return x(this,_)[_]},set:function(e){x(this,_)[_]=e}},{key:"targetDomain",get:function(){return x(this,E)[E]},set:function(e){x(this,E)[E]=e}},{key:"token",get:function(){return x(this,A)[A]},set:function(e){x(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===M?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),L=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),j=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),T=new RegExp("'","g"),z="clear",N="Charged ID",R="WZRK_CHARGED_ID",B="WZRK_G",U="WZRK_K",F="WZRK_CAMP",V="WZRK_CAMP_G",W="WZRK_EV",q="WZRK_META",G="WZRK_PR",H="WZRK_ARP",K="WZRK_L",Z="global",J="optOut",Q="useIP",Y="WZRK_X",$="push",X=31536e3,ee="2",te="wzrk_",ne="wzrk_id",ie="Notification Viewed",oe="Notification Clicked",re="WZRK_FPU",ae="WZRK_PSD",se="$incr",le="$decr",ce="$set",de="$add",ue="$remove",pe="$delete",he="WZRK_INBOX_CONFIG",ge="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ye="WZRK_PUSH_CONFIG",be=["Stayed","UTM Visited","App Launched","Notification Sent",ie,oe],me=function(e){return"string"==typeof e||e instanceof String},we=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ke=function(t){return"object"===e(t)&&t instanceof Date},Ce=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},xe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ie=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},Me=function(e){return null!=e&&"undefined"!==e},Se=function t(n,i){var o;if("object"!==e(n))return me(n)?(o=Pe(n,j)).length>1024&&(o=o.substring(0,1024),i.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=n,o;for(var r in n)if(n.hasOwnProperty(r)){var a=t(n[r],i),s=void 0;(s=Pe(r,L)).length>1024&&(s=s.substring(0,1024),i.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete n[r],n[s]=a}return n},Pe=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ee=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ae=function(e){if(De(e))return"$D_"+e},De=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var n=t[3],i=t[2]-1,o=t[1],r=new Date(o,i,n);return r.getDate()==n&&r.getMonth()==i&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return i(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(n=n+" domain="+t+"; path=/"),document.cookie=n}},{key:"createCookie",value:function(e,t,n,i){var o="",r="";if(n){var a=new Date;a.setTime(a.getTime()+1e3*n),o="; expires="+a.toGMTString()}i&&(r="; domain="+i),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,n,a),this.readCookie(e)==t){o=a,je.broadDomain=o;break}}else this.createCookie(e,t,n,o)}else this.createCookie(e,t,n,i)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var n=this.readFromLSorCookie(q);null==n&&(n={}),void 0===t?delete n[e]:n[e]=t,this.saveToLSorCookie(q,n)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(U);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(U,e)}},{key:"backupEvent",value:function(e,t,n){var i=this.readFromLSorCookie(K);void 0===i&&(i={}),i[t]={q:e},this.saveToLSorCookie(K,i),n.debug("stored in ".concat(K," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var n=this.readFromLSorCookie(K);null!=n&&void 0!==n[e]&&(t.debug("del event: ".concat(e," data-> ").concat(n[e].q)),delete n[e],this.saveToLSorCookie(K,n))}}]),e}(),je={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{},pushConfig:null},Te=C("keyOrder"),ze=C("deleteFromObject"),Ne=function(){function e(n){t(this,e),Object.defineProperty(this,ze,{value:Re}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=n;var i=Le.readFromLSorCookie(Y);if(i){var o={};for(var r in x(this,Te)[Te]=[],i=i.cache)i.hasOwnProperty(r)&&(o[i[r][0]]=i[r][1],x(this,Te)[Te].push(i[r][0]));this.cache=o}else this.cache={},x(this,Te)[Te]=[]}return i(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=x(this,ze)[ze](e,this.cache),this.cache[e]=t,x(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var n=this.cache[e],i=x(this,Te)[Te];null!=n?this.cache=x(this,ze)[ze](e,this.cache):i.length===this.max&&(this.cache=x(this,ze)[ze](i[0],this.cache)),this.cache[e]=t,x(this,Te)[Te][x(this,Te)[Te]-1]!==e&&x(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],n=x(this,Te)[Te];for(var i in n)if(n.hasOwnProperty(i)){var o=[];o.push(n[i]),o.push(e[n[i]]),t.push(o)}Le.saveToLSorCookie(Y,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=x(this,Te)[Te];for(var n in t)if(t.hasOwnProperty(n)&&this.cache[t[n]]===e)return t[n];return null}},{key:"getSecondLastKey",value:function(){var e=x(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=x(this,Te)[Te].length;if(e)return x(this,Te)[Te][e-1]}}]),e}(),Re=function(e,t){var n,i=JSON.parse(JSON.stringify(x(this,Te)[Te])),o={};for(var r in i)i.hasOwnProperty(r)&&(i[r]!==e?o[i[r]]=t[i[r]]:n=r);return i.splice(n,1),x(this,Te)[Te]=JSON.parse(JSON.stringify(i)),o},Be=C("logger"),Ue=C("request"),Fe=C("device"),Ve=C("session"),We=function(){function e(n){var i=n.logger,o=n.request,r=n.device,a=n.session;t(this,e),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,Ve,{writable:!0,value:void 0}),x(this,Be)[Be]=i,x(this,Ue)[Ue]=o,x(this,Fe)[Fe]=r,x(this,Ve)[Ve]=a}return i(e,[{key:"s",value:function(e,t,n,i,o){var r=!1,a=!1;if(window.isOULInProgress&&(n||"undefined"!==i&&i===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===i&&(i=0),Le.removeBackup(i,x(this,Be)[Be]),!(i>je.globalCache.REQ_N)){if(Me(x(this,Fe)[Fe].gcookie)||e&&(a=!0),!Me(x(this,Fe)[Fe].gcookie)||n||"boolean"==typeof o){var s=x(this,Ve)[Ve].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[n].length),e[n])if(e[n].hasOwnProperty(i)&&(!we(e[n][i])||!ot(e[n][i])))return!1}else{if(we(e[n])||Array.isArray(e[n]))return!1;ke(e[n])&&(e[n]=_e(e[n]))}if(me(e[N])||Ie(e[N])){var o=e[N]+"";if(void 0===I&&(I=Le.readFromLSorCookie(R)),void 0!==I&&I.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;I=o,Le.saveToLSorCookie(R,o)}return!0}return!1},at=C("logger"),st=C("oldValues"),lt=C("request"),ct=C("isPersonalisationActive"),dt=C("processEventArray"),ut=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=n.call(this),Object.defineProperty(h(r),dt,{value:pt}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),Object.defineProperty(h(r),lt,{writable:!0,value:void 0}),Object.defineProperty(h(r),ct,{writable:!0,value:void 0}),x(h(r),at)[at]=a,x(h(r),st)[st]=i,x(h(r),lt)[lt]=s,x(h(r),ct)[ct]=l,r}return i(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0;){var t=e.shift();if(me(t))if(t.length>1024&&(t=t.substring(0,1024),x(this,at)[at].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),be.includes(t))x(this,at)[at].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var n={type:"event"};if(n.evtName=Pe(t,L),0!==e.length){var i=e.shift();if(we(i)){if("Charged"===t){if(!rt(i,x(this,at)[at])){x(this,at)[at].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!ot(i)){x(this,at)[at].reportError(512,t+" event structure invalid. Not sent.");continue}n.evtData=i}else e.unshift(i)}x(this,lt)[lt].processEvent(n)}else x(this,at)[at].error(Je)}},ht=function(e){var t={},n=e.indexOf("?");if(n>1){var i,o=e.substring(n+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(i=a.exec(o);i;)t[s(i[1])]=s(i[2]),i=a.exec(o)}return t},gt=function(e,t,n){return e+"&"+t+"="+encodeURIComponent(n)},ft=function(){return window.location.hostname},vt=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),bt(e)},yt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),bt=function(e){if(null==e)return"";var t,n,i,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,n,i,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,g=0,f=String.fromCharCode;for(i=0;i>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(n=2,t=0;t>=1;for(;;){if(h<<=1,15==g){p+=f(h);break}g++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,n=255&e.charCodeAt(c/2),i=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,i=255&e.charCodeAt((c+1)/2)):n=i=NaN),c+=3,o=t>>2,r=(3&t)<<4|n>>4,a=(15&n)<<2|i>>6,s=63&i,isNaN(n)?a=s=64:isNaN(i)&&(s=64),l=l+yt.charAt(o)+yt.charAt(r)+yt.charAt(a)+yt.charAt(s);return l},mt=C("fireRequest"),wt=C("dropRequestDueToOptOut"),kt=C("addUseIPToRequest"),Ct=C("addARPToRequest"),xt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return i(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,n,i){x(this,mt)[mt](e,1,t,n,i)}}]),e}();xt.logger=void 0,xt.device=void 0,xt.account=void 0,Object.defineProperty(xt,mt,{value:function(e,t,n,i,o){var r,a,s=this;if(x(this,wt)[wt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(Me(this.device.gcookie)||(je.blockRequest=!0),o&&o===ve)!Me(this.device.gcookie)&&je.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(xt,wt,{value:function(){return!je.isOptInRequest&&Me(this.device.gcookie)&&me(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(je.isOptInRequest=!1,!1)}}),Object.defineProperty(xt,kt,{value:function(e){var t=Le.getMetaProp(Q);return"boolean"!=typeof t&&(t=!1),gt(e,Q,t?"true":"false")}}),Object.defineProperty(xt,Ct,{value:function(e,t){if(!0===t){var n={skipResARP:!0};return gt(e,"arp",vt(JSON.stringify(n),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(H)&&null!==localStorage.getItem(H)?gt(e,"arp",vt(JSON.stringify(Le.readFromLSorCookie(H)),this.logger)):e}});var It,Mt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(F);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(T,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},St=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},Mt()),e),n=JSON.stringify(t);Le.save(F,encodeURIComponent(n)),Pt()}},Pt=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(Me(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(V)?JSON.parse(decodeURIComponent(Le.read(V))):{};if(e&&Le._isLocalStorageSupported()){var n={},i=Mt();Object.keys(i).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=i[r].global,c=Oe(),d=i[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var g=0,f=0,v=u[p];if("tc"===v)continue;void 0!==d&&void 0!==d[v]&&(g=d[v]),void 0!==l&&void 0!==l[v]&&(f=l[v]),h=[v,g,f],s[v]=h}}}n=a(a({},n),{},o({},r,s))})),t[e]=n,Le.save(V,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=Mt();var n=Le.read(V),i=n?decodeURIComponent(n):null,o=i?JSON.parse(i):null,r=e&&null!=n&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=n&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},Et=function(e,t){var n=t.logger,i=!1;if(we(e))for(var o in e)if(e.hasOwnProperty(o)){i=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(i=!1,n.error(Qe)),"Employed"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error(Ye)),"Married"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(i=!1,n.error(Xe)),"Age"===o&&null!=r&&(xe(r)?e.Age=+r:(i=!1,n.error(et))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||ke(r)||(i=!1,n.error(tt)),ke(r)&&(e[o]=_e(r))):ke(r)&&(e[o]=_e(r)),"Phone"!==o||Ce(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),xe(r)?e.Phone=+r:(i=!1,n.error(it+". Removed."))):(i=!1,n.error(it+". Removed."))),i||delete e[o]}return i},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var n=function(e){if(null!=e){for(var t="",n="",i=0;i0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ae(o[2]+o[0]+o[1])}return t},At=function(e,t){var n=t.logger,i={};if(null!=e.displayName&&(i.Name=e.displayName),null!=e.id&&(i.GPID=e.id+""),null!=e.gender&&("male"===e.gender?i.Gender="M":"female"===e.gender?i.Gender="F":"other"===e.gender&&(i.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(i.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var n=e[t],i={},o=void 0;if(null!=n.Site){if(o=n.Site,Ce(o)||!Et(o,{logger:x(this,zt)[zt]}))return}else if(null!=n.Facebook){var r=n.Facebook;Ce(r)||r.error||(o=_t(r))}else if(null!=n["Google Plus"]){var a=n["Google Plus"];Ce(a)||a.error||(o=At(a,{logger:x(this,zt)[zt]}))}if(null!=o&&!Ce(o)){i.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),i.profile=o,Dt(o,!0),i=x(this,Nt)[Nt].addSystemDataToObject(i,void 0),x(this,Nt)[Nt].addFlags(i);var s=vt(JSON.stringify(i),x(this,zt)[zt]),l=x(this,Rt)[Rt].dataPostURL;l=gt(l,"type",$),l=gt(l,"d",s),x(this,Nt)[Nt].saveAndFireRequest(l,je.blockRequest)}}},qt=C("request"),Gt=C("logger"),Ht=C("account"),Kt=C("session"),Zt=C("oldValues"),Jt=C("device"),Qt=C("processOUL"),Yt=C("handleCookieFromCache"),$t=C("deleteUser"),Xt=C("processLoginArray"),en=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=n.call(this),Object.defineProperty(h(r),Xt,{value:rn}),Object.defineProperty(h(r),$t,{value:on}),Object.defineProperty(h(r),Yt,{value:nn}),Object.defineProperty(h(r),Qt,{value:tn}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Zt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Jt,{writable:!0,value:void 0}),x(h(r),qt)[qt]=a,x(h(r),Ht)[Ht]=s,x(h(r),Kt)[Kt]=l,x(h(r),Gt)[Gt]=c,x(h(r),Zt)[Zt]=i,x(h(r),Jt)[Jt]=d,r}return i(o,[{key:"clear",value:function(){x(this,Gt)[Gt].debug("clear called. Reset flag has been set."),x(this,$t)[$t](),Le.setMetaProp(z,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,Ce(s)||!Et(s,{logger:x(this,Gt)[Gt]}))return}else if(null!=r.Facebook){var l=r.Facebook;Ce(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];Ce(c)&&!c.error&&(s=At(c,{logger:x(this,Gt)[Gt]}))}if(null!=s&&!Ce(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&i(d)),Dt(s,!0),a=x(this,qt)[qt].addSystemDataToObject(a,void 0),x(this,qt)[qt].addFlags(a),n&&(a.isOUL=!0);var u=vt(JSON.stringify(a),x(this,Gt)[Gt]),p=x(this,Ht)[Ht].dataPostURL;p=gt(p,"type",$),p=gt(p,"d",u),x(this,qt)[qt].saveAndFireRequest(p,je.blockRequest,n)}}},nn=function(){je.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(F,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Kt)[Kt].setSessionCookieObject("")},on=function(){je.blockRequest=!0,x(this,Gt)[Gt].debug("Block request is true"),je.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,je.broadDomain),Le.removeCookie(F,ft()),Le.removeCookie(U,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Jt)[Jt].gcookie=null,x(this,Kt)[Kt].setSessionCookieObject("")},rn=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&we(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{x(this,Qt)[Qt]([t])}catch(e){x(this,Gt)[Gt].debug(e)}}else x(this,Gt)[Gt].error("Profile object is in incorrect format")}},an=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],n=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var i=Mt(),o=i.wp[n];null==o&&(o={},i[n]=o),o[t]="dnd",St(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var n=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(n,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),sn=function(e){s(o,e);var n=f(o);function o(e,i){var r;return t(this,o),(r=n.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=i,r.renderMessage(i),r}return i(o,[{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var n=this.createEl("div","timeStamp");if(n.innerHTML="".concat(yn(e.id.split("_")[1]),""),!e.viewed){var i=this.createEl("span","unreadMarker");n.appendChild(i)}this.wrapper.appendChild(n),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var n=this.addImage(e.imageUrl,"mainImg");t.appendChild(n)}var i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");i.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&i.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.createEl("div","buttonsContainer"),i=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(i=!0),n.appendChild(r)})),i&&this.addSnackbar(n),n}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=wn;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var n=this.createEl("div","".concat(t,"Container")),i=this.createEl("img",t);return i.setAttribute("src",e),i.setAttribute("loading","lazy"),n.appendChild(i),n}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var n=this,i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=i.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){n.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),ln=function(e){s(o,e);var n=f(o);function o(e){var i;return t(this,o),(i=n.call(this)).isInboxOpen=!1,i.isInboxFromFlutter=!1,i.selectedCategory=null,i.unviewedMessages={},i.unviewedCounter=0,i.isPreview=!1,i.inboxConfigForPreview={},i.inboxSelector=null,i.inbox=null,i.emptyInboxMsg=null,i.inboxCard=null,i.unviewedBadge=null,i.observer=null,i.selectedCategoryRef=null,i.addClickListenerOnDocument=function(e){if(e.composedPath().includes(i.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var n=t[0].id;if("closeInbox"===n)i.toggleInbox();else if(n.startsWith("category-"))i.prevCategoryRef=i.selectedCategoryRef,i.selectedCategoryRef=t[0],i.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],i.isPreview)}}}else(i.inboxSelector.contains(e.target)||i.isInboxOpen)&&(i.isInboxFromFlutter?i.isInboxFromFlutter=!1:i.toggleInbox(e))},i.setBadgeStyle=function(e){null!==i.unviewedBadge&&(i.unviewedBadge.innerText=e>9?"9+":e,i.unviewedBadge.style.display=e>0?"flex":"none")},i.logger=e,i.shadow=i.attachShadow({mode:"open"}),i}return i(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(he)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),n=t?Object.keys(t):[];0!==n.length&&(n.forEach((function(n){t[n].viewed||(e.unviewedMessages[n]=t[n],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=pn(),n=Math.floor(Date.now()/1e3);for(var i in t)if(t[i].wzrk_ttl&&t[i].wzrk_ttl>0&&t[i].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),hn(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=i-r,t.viewed=0,n[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),hn(n),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,n=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(n-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),n=this.createEl("div","headerTitle");n.innerText=this.config.title;var i=this.createEl("div","closeInbox");if(i.innerHTML="×",t.appendChild(n),t.appendChild(i),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,n){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),n=this.createEl("div","leftArrow");n.innerHTML=mn,n.children[0].style="transform: rotate(180deg)",n.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(n);var i=this.createEl("div","categoriesWrapper");["All"].concat(y(this.config.categories)).forEach((function(t,n){var o=e.createEl("div","category-".concat(n),"category");o.innerText=t,0===n&&(e.selectedCategoryRef=o),i.appendChild(o)})),t.appendChild(i);var o=this.createEl("div","rightArrow");o.innerHTML=mn,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=i.children[0],s=i.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(n,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var n=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&n++)})),0===n?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var n,i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=w(r);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=new sn(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>i;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,n=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,n?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var n=pn();n[e]=t,hn(n)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,n=getComputedStyle(je.inbox),i=n.getPropertyValue("--inbox-top"),o=n.getPropertyValue("--inbox-bottom"),r=n.getPropertyValue("--inbox-left"),a=n.getPropertyValue("--inbox-right");if(t>481&&!(i||o||r||a)){var s=vn(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var n=pn();n[t.id]&&0===n[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=yn(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var n,i,o,r,a,s,l,c,d,u,p,h,g,f,v,y,b,m,w,k,C,x=(i=(n=t).panelBackgroundColor,o=n.panelBorderColor,r=n.headerBackgroundColor,a=n.headerTitleColor,s=n.closeIconColor,l=n.categoriesTabColor,c=n.categoriesTitleColor,d=n.categoriesBorderColor,u=n.selectedCategoryTabColor,p=n.selectedCategoryTitleColor,h=n.selectedCategoryBorderColor,g=n.headerCategoryHeight,'\n \n ")),I=this.config.styles.cards;return x+(f={backgroundColor:I.backgroundColor,borderColor:I.borderColor,titleColor:I.titleColor,descriptionColor:I.descriptionColor,buttonColor:I.buttonColor,buttonTextColor:I.buttonTextColor,unreadMarkerColor:I.unreadMarkerColor},v=f.backgroundColor,y=f.borderColor,b=f.titleColor,m=f.descriptionColor,w=f.buttonColor,k=f.buttonTextColor,C=f.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var i="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=i,n[i]=t,e.unviewedMessages[i]=t,e.unviewedCounter++})),this.buildUIForMessages(n),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),cn=function(e){e.inbox_preview?je.inbox.incomingMessagesForPreview=e.inbox_notifs:je.inbox.incomingMessages=e},dn=function(e){fn(),je.inbox=new ln({logger:e}),document.body.appendChild(je.inbox)},un=function(e){var t=Le.readFromLSorCookie(ge)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var n={};return n[e]=t,Le.saveToLSorCookie(ge,n),n}return t},pn=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!Me(e))return{};var t=un(e);return t.hasOwnProperty(e)?t[e]:{}},hn=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(Me(t)){var n=a(a({},un(t)),{},o({},t,e));Le.saveToLSorCookie(ge,n)}},gn=function(e){return new Promise((function(t,n){if("complete"===document.readyState)dn(e),t();else{var i=Le.readFromLSorCookie(he)||{},o=function(){null===je.inbox&&dn(e),t()};window.addEventListener("load",(function(){if(document.getElementById(i.inboxSelector))o();else{var n=0;if(n<20)var r=setInterval((function(){document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}))}}))},fn=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",ln),customElements.define("ct-inbox-message",sn))},vn=function(e,t,n){var i,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,g=c.top+a,f=c.bottom,v=c.height,y=c.width,b=!1,m=16;if(f+t<=l){var w=l-(f+t);o=w>=m?f+m:f+w}else if(g-t>=a){var k=g-t;o=k>=m?g-t-m:g-t-k}else b=!0,(o=u+v/2-t/2)l&&(o=l-t);if(b){var C=h+n;if(C<=s){i=h+(C+m<=s?m:s-C)}else{var x=p-n;i=x-(x-m>=r?m:x-r)}}else(i=d+y/2-n/2)s&&(i=h-n>=r?h-n:s-n);return{xPos:i,yPos:o}},yn=function(e){var t=Date.now(),n=Math.floor((t-e)/6e4);return n<5?"Just now":n<60?"".concat(n," minute").concat(n>1?"s":""," ago"):(n=Math.floor(n/60))<24?"".concat(n," hour").concat(n>1?"s":""," ago"):(n=Math.floor(n/24),"".concat(n," day").concat(n>1?"s":""," ago"))},bn=function(){return Object.keys(Le.readFromLSorCookie(he)||{}).length>0},mn='\n\n\n',wn='\n\n\n',kn="https://web-native-display-campaign.clevertap.com/staging/lib-overlay/style.css",Cn="wve-anti-flicker-show",xn="wve-anti-flicker-hide",In="wve-flicker-style",Mn=function(e,t){var n=window.location.search,i=window.opener;if("?ctBuilder"===n)return e.debug("open in visual builder mode"),window.addEventListener("message",Sn,!1),void(i&&i.postMessage({message:"builder",originUrl:window.location.href},"*"));if("?ctBuilderPreview"===n&&(window.addEventListener("message",Sn,!1),i&&i.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===n&&i){i.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.11.3"},"*")}},Sn=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,n,i=new URL(e.data.originUrl).origin;if(e.origin===i)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Pn(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(n=e.data.details)&&void 0!==n?n:{},e.data.personalisation);else"Overlay"===e.data.message&&An(e.data,!0)}},Pn=function(e,t,n,i){"complete"===document.readyState?_n(e,t,n,i):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&_n(e,t,n,i)}))},On=!1,En=!1;function _n(e,t,n,i){if(!On){window.Shopify&&(En=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(It=document.createElement("div")).id="overlayDiv",It.style.position="relative",It.style.display="flex",document.body.appendChild(It);(function(e,t,n,i,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:n,details:i,isShopify:En,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/staging/lib-overlay/overlay.js",e,t,n,i).then((function(){console.log("Overlay script loaded successfully."),On=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=kn,document.head.appendChild(o)}var o}var An=function(e,t){var n=t?e.details:e.display.details,i=!1,o={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=function(){t||i||(i=!0,window.clevertap.renderNotificationViewed(o))},a=function(n,i){var r;i.values&&(i.values.html?n.outerHTML=i.values.html:(null===(r=i.values)||void 0===r?void 0:r.json)?function(e,t){var n={};n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);null!=t.json&&(n.json=t.json);var i=new CustomEvent("CT_web_native_display_buider",{detail:n});document.dispatchEvent(i)}(e,i.values):(o.msgCTkv={wzrk_selector:i.selector},function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((function(n){e.style.setProperty(n,t.style[n])})),void 0!==t.underline){var o=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(o," underline").trim():e.style.textDecoration=o.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text),void 0!==t.clickDetails){var r=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){i||window.clevertap.raiseNotificationClicked(n),window.open(r,"_blank").focus()}:function(){i||window.clevertap.raiseNotificationClicked(n),window.location.href=r}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var a=document.createElement("style");a.innerHTML=t.elementCss,document.head.appendChild(a)}}(n,i.values.form,o,t)))};n.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,n,i,o=document.querySelector(e.selector);o?(r(),a(o,e)):(t=e,n=0,i=setInterval((function(){var e=document.querySelector(t.selector);e?(r(),a(e,t),clearInterval(i)):++n>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(i))}),500))}))}))};function Dn(e){var t,n=e.personalizedSelectors,i=void 0===n?[]:n,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function n(e){var t=[];e.forEach((function(e){var n=document.querySelectorAll(e);n.length?(n.forEach((function(e){var n,i,o,r;n=e.getBoundingClientRect(),i=window,o=i.innerHeight,r=i.innerWidth,n.bottom>0&&n.right>0&&n.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=In;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(i))})).observe(document.body,{childList:!0,subtree:!0}),l(i)}))}var Ln=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),jn=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln),e}return i(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var n=t.target.id;if(n.startsWith("carousel__button")){var i=+n.split("-")[1];i!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=i,e.updateSelectedItem(),e.startAutoSlide())}else if(n.startsWith("carousel__arrow"))n.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(n.indexOf("-")>-1){var o=+n.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,n){var i=document.createElement("ct-web-personalisation-banner");i.classList.add("carousel__item"),i.trackClick=!1,i.setAttribute("id","carousel__item-".concat(n+1)),i.details=t,e.appendChild(i)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var n=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),i=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));n.classList.add("carousel__item--selected"),i&&i.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),Tn=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-banner");i.msgId=e.wzrk_id,i.pivotId=e.wzrk_pivot,i.divHeight=e.display.divHeight,i.details=e.display.details[0];var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},zn=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",jn);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-carousel");i.target=e;var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},Nn=function(e){var t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);var n=new CustomEvent("CT_web_native_display",{detail:t});document.dispatchEvent(n)},Rn=function(e,t){var n=window.parent[e];"function"==typeof n&&(null!=t.display.kv?n(t.display.kv):n())},Bn=function(e,t){var n="\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzIDI0IDQ0LjUwMDNDMjguMDA1NSA0NC41MDAzIDMxLjc0MjYgNDMuMzUxNSAzNC45IDQxLjM2NTVDMzUuMjYwOCA0MS4xMzg1IDM1Ljc0MTYgNDEuMjM4NiAzNS45NjY4IDQxLjYwMDZDMzYuMTc5MiA0MS45NDE5IDM2LjA4NSA0Mi4zOTExIDM1Ljc0NTIgNDIuNjA2QzMyLjM0NjggNDQuNzU1OSAyOC4zMTg3IDQ2LjAwMDMgMjQgNDYuMDAwM0MxMS44NDk3IDQ2LjAwMDMgMiAzNi4xNTA1IDIgMjQuMDAwM0MyIDE2LjA2NjkgNi4xOTkyMSA5LjExNDMyIDEyLjQ5NjIgNS4yNDM5NV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WNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChanged","wzrk_d","ping","Clevertap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAO,IAAMA,aAAa,GAAG,oBAAtB;EACA,IAAMC,eAAe,GAAG,QAAxB;EACA,IAAMC,cAAc,GAAG,KAAvB;;;;;;;;;;;;MCAcC;EAOnB,qBAAiF;EAAA,mFAA3D,EAA2D;EAAA,QAAlEC,EAAkE,QAAlEA,EAAkE;;EAAA,QAAvDC,MAAuD,uEAA9C,EAA8C;EAAA,QAA1CC,YAA0C,uEAA3BN,aAA2B;EAAA,QAAZO,KAAY,uEAAJ,EAAI;;EAAA;;EAAA;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AClhB,GAAD,CAAtB;EACD,KAFD;EAGD;;EACD,MAAIqE,GAAG,CAACF,QAAR,EAAkB;EAChB5B,IAAAA,IAAI,CAACurC,EAAL,qCAAevrC,IAAI,CAACurC,EAApB,GAA2BzpC,GAAG,CAACF,QAA/B;EACD;;EACD5B,EAAAA,IAAI,GAAG,0DAAc+W,qBAAd,CAAoC/W,IAApC,EAA0C,IAA1C,CAAP;;EACA,4DAAcgX,QAAd,CAAuBhX,IAAvB;;EACA,MAAMiX,cAAc,GAAG5K,YAAY,CAACvM,IAAI,CAACC,SAAL,CAAeC,IAAf,CAAD,8BAAuB,IAAvB,wBAAnC;;EACA,MAAI8O,WAAW,GAAG,0DAAcoI,WAAhC;;EACApI,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,MAAd,EAAsB7U,QAAtB,CAAtB;EACA6U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAI6mC,SAAJ,CAAcz0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"clevertap.js","sources":["src/options.js","src/modules/account.js","src/util/constants.js","src/util/datatypes.js","src/util/datetime.js","src/util/storage.js","src/util/lruCache.js","src/modules/api.js","src/modules/device.js","src/util/messages.js","src/util/validator.js","src/modules/event.js","src/util/url.js","src/util/encoder.js","src/util/requestDispatcher.js","src/util/clevertap.js","src/modules/profile.js","src/modules/userLogin.js","src/util/web-popupImageonly/popupImageonly.js","src/modules/web-inbox/Message.js","src/modules/web-inbox/inboxStyles.js","src/modules/web-inbox/WebInbox.js","src/modules/web-inbox/helper.js","src/modules/visualBuilder/builder_constants.js","src/modules/visualBuilder/dataUpdate.js","src/modules/visualBuilder/pageBuilder.js","src/util/web-personalisation/banner.js","src/util/web-personalisation/carousel.js","src/util/campaignRender/nativeDisplay.js","src/util/campaignRender/utilities.js","src/util/campaignRender/webPopup.js","src/modules/webPushPrompt/promptStyles.js","src/modules/notification.js","src/modules/webPushPrompt/promptConstants.js","src/modules/webPushPrompt/prompt.js","src/util/tr.js","src/modules/user.js","src/modules/logger.js","src/modules/session.js","src/modules/request.js","src/modules/privacy.js","src/modules/variables/variable.js","src/modules/variables/variableStore.js","src/clevertap.js","src/main.js"],"sourcesContent":["export const TARGET_DOMAIN = 'clevertap-prod.com'\nexport const TARGET_PROTOCOL = 'https:'\nexport const DEFAULT_REGION = 'eu1'\n","import { DEFAULT_REGION, TARGET_DOMAIN, TARGET_PROTOCOL } from '../options'\n\nexport default class Account {\n #accountId\n #region = ''\n #targetDomain = TARGET_DOMAIN\n #dcSdkversion = ''\n #token = ''\n\n constructor ({ id } = {}, region = '', targetDomain = TARGET_DOMAIN, token = '') {\n this.id = id\n if (region) {\n this.region = region\n }\n if (targetDomain) {\n this.targetDomain = targetDomain\n }\n if (token) {\n this.token = token\n }\n }\n\n get id () {\n return this.#accountId\n }\n\n set id (accountId) {\n this.#accountId = accountId\n }\n\n get region () {\n return this.#region\n }\n\n set region (region) {\n this.#region = region\n }\n\n get dcSDKVersion () {\n return this.#dcSdkversion\n }\n\n set dcSDKVersion (dcSDKVersion) {\n this.#dcSdkversion = dcSDKVersion\n }\n\n get targetDomain () {\n return this.#targetDomain\n }\n\n set targetDomain (targetDomain) {\n this.#targetDomain = targetDomain\n }\n\n get token () {\n return this.#token\n }\n\n set token (token) {\n this.#token = token\n }\n\n get finalTargetDomain () {\n if (this.region) {\n return `${this.region}.${this.targetDomain}`\n } else {\n if (this.targetDomain === TARGET_DOMAIN) {\n return `${DEFAULT_REGION}.${this.targetDomain}`\n }\n return this.targetDomain\n }\n }\n\n get dataPostPEURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/defineVars`\n }\n\n get dataPostURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/a?t=96`\n }\n\n get recorderURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/r?r=1`\n }\n\n get emailURL () {\n return `${TARGET_PROTOCOL}//${this.finalTargetDomain}/e?r=1`\n }\n}\n","export const unsupportedKeyCharRegex = new RegExp('^\\\\s+|\\\\\\.|\\:|\\\\\\$|\\'|\\\"|\\\\\\\\|\\\\s+$', 'g')\nexport const unsupportedValueCharRegex = new RegExp(\"^\\\\s+|\\'|\\\"|\\\\\\\\|\\\\s+$\", 'g')\nexport const doubleQuoteRegex = new RegExp('\\\"', 'g')\nexport const singleQuoteRegex = new RegExp('\\'', 'g')\nexport const CLEAR = 'clear'\nexport const CHARGED_ID = 'Charged ID'\nexport const CHARGEDID_COOKIE_NAME = 'WZRK_CHARGED_ID'\nexport const GCOOKIE_NAME = 'WZRK_G'\nexport const KCOOKIE_NAME = 'WZRK_K'\nexport const CAMP_COOKIE_NAME = 'WZRK_CAMP'\nexport const CAMP_COOKIE_G = 'WZRK_CAMP_G'// cookie for storing campaign details against guid\nexport const SCOOKIE_PREFIX = 'WZRK_S'\nexport const SCOOKIE_EXP_TIME_IN_SECS = 60 * 20 // 20 mins\nexport const EV_COOKIE = 'WZRK_EV'\nexport const META_COOKIE = 'WZRK_META'\nexport const PR_COOKIE = 'WZRK_PR'\nexport const ARP_COOKIE = 'WZRK_ARP'\nexport const LCOOKIE_NAME = 'WZRK_L'\nexport const NOTIF_COOKIE_NAME = 'WZRK_N'\nexport const GLOBAL = 'global' // used for email unsubscribe also\nexport const TOTAL_COUNT = 'tc'\nexport const DISPLAY = 'display'\nexport const UNDEFINED = 'undefined'\nexport const WEBPUSH_LS_KEY = 'WZRK_WPR'\nexport const OPTOUT_KEY = 'optOut'\nexport const CT_OPTOUT_KEY = 'ct_optout'\nexport const OPTOUT_COOKIE_ENDSWITH = ':OO'\nexport const USEIP_KEY = 'useIP'\nexport const LRU_CACHE = 'WZRK_X'\nexport const LRU_CACHE_SIZE = 100\nexport const IS_OUL = 'isOUL'\nexport const EVT_PUSH = 'push'\nexport const EVT_PING = 'ping'\nexport const COOKIE_EXPIRY = 86400 * 365 // 1 Year in seconds\nexport const MAX_TRIES = 200 // API tries\nexport const FIRST_PING_FREQ_IN_MILLIS = 2 * 60 * 1000 // 2 mins\nexport const CONTINUOUS_PING_FREQ_IN_MILLIS = 5 * 60 * 1000 // 5 mins\nexport const GROUP_SUBSCRIPTION_REQUEST_ID = '2'\nexport const categoryLongKey = 'cUsY'\nexport const WZRK_PREFIX = 'wzrk_'\nexport const WZRK_ID = 'wzrk_id'\nexport const NOTIFICATION_VIEWED = 'Notification Viewed'\nexport const NOTIFICATION_CLICKED = 'Notification Clicked'\nexport const FIRE_PUSH_UNREGISTERED = 'WZRK_FPU'\nexport const PUSH_SUBSCRIPTION_DATA = 'WZRK_PSD' // PUSH SUBSCRIPTION DATA FOR REGISTER/UNREGISTER TOKEN\nexport const COMMAND_INCREMENT = '$incr'\nexport const COMMAND_DECREMENT = '$decr'\nexport const COMMAND_SET = '$set'\nexport const COMMAND_ADD = '$add'\nexport const COMMAND_REMOVE = '$remove'\nexport const COMMAND_DELETE = '$delete'\nexport const WEBINBOX_CONFIG = 'WZRK_INBOX_CONFIG'\nexport const WEBINBOX = 'WZRK_INBOX'\nexport const MAX_INBOX_MSG = 15\nexport const VARIABLES = 'WZRK_PE'\nexport const PUSH_DELAY_MS = 1000\nexport const MAX_DELAY_FREQUENCY = 1000 * 60 * 10\nexport const WZRK_FETCH = 'wzrk_fetch'\nexport const WEBPUSH_CONFIG = 'WZRK_PUSH_CONFIG'\n\nexport const SYSTEM_EVENTS = [\n 'Stayed',\n 'UTM Visited',\n 'App Launched',\n 'Notification Sent',\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED\n]\n","import {\n unsupportedKeyCharRegex,\n unsupportedValueCharRegex\n} from './constants'\n\nexport const isString = (input) => {\n return (typeof input === 'string' || input instanceof String)\n}\n\nexport const isObject = (input) => {\n // TODO: refine\n return Object.prototype.toString.call(input) === '[object Object]'\n}\n\nexport const isDateObject = (input) => {\n return typeof (input) === 'object' && (input instanceof Date)\n}\n\nexport const isObjectEmpty = (obj) => {\n for (const prop in obj) {\n if (obj.hasOwnProperty(prop)) { return false }\n }\n return true\n}\n\nexport const isConvertibleToNumber = (n) => {\n return !isNaN(parseFloat(n)) && isFinite(n)\n}\n\nexport const isNumber = (n) => {\n return /^-?[\\d.]+(?:e-?\\d+)?$/.test(n) && typeof n === 'number'\n}\n\nexport const isValueValid = (value) => {\n if (value === null || value === undefined || value === 'undefined') {\n return false\n }\n return true\n}\n\nexport const arrayContains = (arr, obj) => {\n var i = arr.length\n while (i--) {\n if (arr[i] === obj) {\n return true\n }\n }\n return false\n}\n\nexport const removeUnsupportedChars = (o, logger) => {\n // keys can't be greater than 1024 chars, values can't be greater than 1024 chars\n if (typeof o === 'object') {\n for (const key in o) {\n if (o.hasOwnProperty(key)) {\n const sanitizedVal = removeUnsupportedChars(o[key], logger)\n let sanitizedKey\n sanitizedKey = sanitize(key, unsupportedKeyCharRegex)\n if (sanitizedKey.length > 1024) {\n sanitizedKey = sanitizedKey.substring(0, 1024)\n logger.reportError(520, sanitizedKey + '... length exceeded 1024 chars. Trimmed.')\n }\n delete o[key]\n o[sanitizedKey] = sanitizedVal\n }\n }\n } else {\n let val\n\n if (isString(o)) {\n val = sanitize(o, unsupportedValueCharRegex)\n if (val.length > 1024) {\n val = val.substring(0, 1024)\n logger.reportError(521, val + '... length exceeded 1024 chars. Trimmed.')\n }\n } else {\n val = o\n }\n return val\n }\n return o\n}\n\nexport const sanitize = (input, regex) => {\n return input.replace(regex, '')\n}\n","export const getToday = () => {\n const today = new Date()\n return today.getFullYear() + '' + today.getMonth() + '' + today.getDay()\n}\n\nexport const getNow = () => {\n return Math.floor((new Date()).getTime() / 1000)\n}\n\nexport const convertToWZRKDate = (dateObj) => {\n return ('$D_' + Math.round(dateObj.getTime() / 1000))\n}\n\nexport const setDate = (dt) => {\n // expecting yyyymmdd format either as a number or a string\n if (isDateValid(dt)) {\n return '$D_' + dt\n }\n}\n\nexport const isDateValid = (date) => {\n const matches = /^(\\d{4})(\\d{2})(\\d{2})$/.exec(date)\n if (matches == null) return false\n const d = matches[3]\n const m = matches[2] - 1\n const y = matches[1]\n const composedDate = new Date(y, m, d)\n // eslint-disable-next-line eqeqeq\n return composedDate.getDate() == d && composedDate.getMonth() == m && composedDate.getFullYear() == y\n}\n","import {\n GCOOKIE_NAME,\n META_COOKIE,\n KCOOKIE_NAME,\n LCOOKIE_NAME\n} from './constants'\nexport class StorageManager {\n static save (key, value) {\n if (!key || !value) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.setItem(key, typeof value === 'string' ? value : JSON.stringify(value))\n return true\n }\n }\n\n static read (key) {\n if (!key) {\n return false\n }\n let data = null\n if (this._isLocalStorageSupported()) {\n data = localStorage.getItem(key)\n }\n if (data != null) {\n try {\n data = JSON.parse(data)\n } catch (e) {}\n }\n return data\n }\n\n static remove (key) {\n if (!key) {\n return false\n }\n if (this._isLocalStorageSupported()) {\n localStorage.removeItem(key)\n return true\n }\n }\n\n static removeCookie (name, domain) {\n let cookieStr = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'\n\n if (domain) {\n cookieStr = cookieStr + ' domain=' + domain + '; path=/'\n }\n\n document.cookie = cookieStr\n }\n\n static createCookie (name, value, seconds, domain) {\n let expires = ''\n let domainStr = ''\n if (seconds) {\n const date = new Date()\n date.setTime(date.getTime() + (seconds * 1000))\n\n expires = '; expires=' + date.toGMTString()\n }\n\n if (domain) {\n domainStr = '; domain=' + domain\n }\n\n value = encodeURIComponent(value)\n\n document.cookie = name + '=' + value + expires + domainStr + '; path=/'\n }\n\n static readCookie (name) {\n const nameEQ = name + '='\n const ca = document.cookie.split(';')\n for (let idx = 0; idx < ca.length; idx++) {\n let c = ca[idx]\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length)\n }\n // eslint-disable-next-line eqeqeq\n if (c.indexOf(nameEQ) == 0) {\n return decodeURIComponent(c.substring(nameEQ.length, c.length))\n }\n }\n return null\n }\n\n static _isLocalStorageSupported () {\n return 'localStorage' in window && window.localStorage !== null && typeof window.localStorage.setItem === 'function'\n }\n\n static saveToLSorCookie (property, value) {\n if (value == null) {\n return\n }\n try {\n if (this._isLocalStorageSupported()) {\n this.save(property, encodeURIComponent(JSON.stringify(value)))\n } else {\n if (property === GCOOKIE_NAME) {\n this.createCookie(property, encodeURIComponent(value), 0, window.location.hostname)\n } else {\n this.createCookie(property, encodeURIComponent(JSON.stringify(value)), 0, window.location.hostname)\n }\n }\n $ct.globalCache[property] = value\n } catch (e) {}\n }\n\n static readFromLSorCookie (property) {\n let data\n if ($ct.globalCache.hasOwnProperty(property)) {\n return $ct.globalCache[property]\n }\n if (this._isLocalStorageSupported()) {\n data = this.read(property)\n } else {\n data = this.readCookie(property)\n }\n\n if (data !== null && data !== undefined && !(typeof data.trim === 'function' && data.trim() === '')) {\n let value\n try {\n value = JSON.parse(decodeURIComponent(data))\n } catch (err) {\n value = decodeURIComponent(data)\n }\n $ct.globalCache[property] = value\n return value\n }\n }\n\n static createBroadCookie (name, value, seconds, domain) {\n // sets cookie on the base domain. e.g. if domain is baz.foo.bar.com, set cookie on \".bar.com\"\n // To update an existing \"broad domain\" cookie, we need to know what domain it was actually set on.\n // since a retrieved cookie never tells which domain it was set on, we need to set another test cookie\n // to find out which \"broadest\" domain the cookie was set on. Then delete the test cookie, and use that domain\n // for updating the actual cookie.\n\n if (domain) {\n let broadDomain = $ct.broadDomain\n if (broadDomain == null) { // if we don't know the broadDomain yet, then find out\n const domainParts = domain.split('.')\n let testBroadDomain = ''\n for (let idx = domainParts.length - 1; idx >= 0; idx--) {\n if (idx === 0) {\n testBroadDomain = domainParts[idx] + testBroadDomain\n } else {\n testBroadDomain = '.' + domainParts[idx] + testBroadDomain\n }\n\n // only needed if the cookie already exists and needs to be updated. See note above.\n if (this.readCookie(name)) {\n // no guarantee that browser will delete cookie, hence create short lived cookies\n var testCookieName = 'test_' + name + idx\n this.createCookie(testCookieName, value, 10, testBroadDomain) // self-destruct after 10 seconds\n if (!this.readCookie(testCookieName)) { // if test cookie not set, then the actual cookie wouldn't have been set on this domain either.\n continue\n } else { // else if cookie set, then delete the test and the original cookie\n this.removeCookie(testCookieName, testBroadDomain)\n }\n }\n\n this.createCookie(name, value, seconds, testBroadDomain)\n const tempCookie = this.readCookie(name)\n // eslint-disable-next-line eqeqeq\n if (tempCookie == value) {\n broadDomain = testBroadDomain\n $ct.broadDomain = broadDomain\n break\n }\n }\n } else {\n this.createCookie(name, value, seconds, broadDomain)\n }\n } else {\n this.createCookie(name, value, seconds, domain)\n }\n }\n\n static getMetaProp (property) {\n const metaObj = this.readFromLSorCookie(META_COOKIE)\n if (metaObj != null) {\n return metaObj[property]\n }\n }\n\n static setMetaProp (property, value) {\n if (this._isLocalStorageSupported()) {\n let wzrkMetaObj = this.readFromLSorCookie(META_COOKIE)\n if (wzrkMetaObj == null) {\n wzrkMetaObj = {}\n }\n if (value === undefined) {\n delete wzrkMetaObj[property]\n } else {\n wzrkMetaObj[property] = value\n }\n this.saveToLSorCookie(META_COOKIE, wzrkMetaObj)\n }\n }\n\n static getAndClearMetaProp (property) {\n const value = this.getMetaProp(property)\n this.setMetaProp(property, undefined)\n return value\n }\n\n static setInstantDeleteFlagInK () {\n let k = this.readFromLSorCookie(KCOOKIE_NAME)\n if (k == null) {\n k = {}\n }\n k.flag = true\n this.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n static backupEvent (data, reqNo, logger) {\n let backupArr = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupArr === 'undefined') {\n backupArr = {}\n }\n backupArr[reqNo] = { q: data }\n this.saveToLSorCookie(LCOOKIE_NAME, backupArr)\n logger.debug(`stored in ${LCOOKIE_NAME} reqNo : ${reqNo} -> ${data}`)\n }\n\n static removeBackup (respNo, logger) {\n const backupMap = this.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap !== 'undefined' && backupMap !== null && typeof backupMap[respNo] !== 'undefined') {\n logger.debug(`del event: ${respNo} data-> ${backupMap[respNo].q}`)\n delete backupMap[respNo]\n this.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n }\n }\n}\n\nexport const $ct = {\n globalCache: {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n },\n LRU_CACHE: null,\n globalProfileMap: undefined,\n globalEventsMap: undefined,\n blockRequest: false,\n isOptInRequest: false,\n broadDomain: null,\n webPushEnabled: null,\n campaignDivMap: {},\n currentSessionId: null,\n wiz_counter: 0, // to keep track of number of times we load the body\n notifApi: {\n notifEnabledFromApi: false\n }, // helper variable to handle race condition and check when notifications were called\n unsubGroups: [],\n updatedCategoryLong: null,\n inbox: null,\n isPrivacyArrPushed: false,\n privacyArray: [],\n offline: false,\n location: null,\n dismissSpamControl: false,\n globalUnsubscribe: true,\n flutterVersion: null,\n variableStore: {},\n pushConfig: null\n // domain: window.location.hostname, url -> getHostName()\n // gcookie: -> device\n}\n","import { StorageManager } from './storage'\nimport { LRU_CACHE } from './constants'\n\nexport default class LRUCache {\n #keyOrder\n\n constructor (max) {\n this.max = max\n let lruCache = StorageManager.readFromLSorCookie(LRU_CACHE)\n if (lruCache) {\n const tempLruCache = {}\n this.#keyOrder = []\n lruCache = lruCache.cache\n for (const entry in lruCache) {\n if (lruCache.hasOwnProperty(entry)) {\n tempLruCache[lruCache[entry][0]] = lruCache[entry][1]\n this.#keyOrder.push(lruCache[entry][0])\n }\n }\n this.cache = tempLruCache\n } else {\n this.cache = {}\n this.#keyOrder = []\n }\n }\n\n get (key) {\n const item = this.cache[key]\n if (item) {\n this.cache = this.#deleteFromObject(key, this.cache)\n this.cache[key] = item\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n return item\n }\n\n set (key, value) {\n const item = this.cache[key]\n const allKeys = this.#keyOrder\n if (item != null) {\n this.cache = this.#deleteFromObject(key, this.cache)\n } else if (allKeys.length === this.max) {\n this.cache = this.#deleteFromObject(allKeys[0], this.cache)\n }\n this.cache[key] = value\n if (this.#keyOrder[this.#keyOrder - 1] !== key) {\n this.#keyOrder.push(key)\n }\n this.saveCacheToLS(this.cache)\n }\n\n saveCacheToLS (cache) {\n const objToArray = []\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n const temp = []\n temp.push(allKeys[index])\n temp.push(cache[allKeys[index]])\n objToArray.push(temp)\n }\n }\n StorageManager.saveToLSorCookie(LRU_CACHE, { cache: objToArray })\n }\n\n getKey (value) {\n if (value === null) {\n return null\n }\n const allKeys = this.#keyOrder\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (this.cache[allKeys[index]] === value) {\n return allKeys[index]\n }\n }\n }\n return null\n }\n\n getSecondLastKey () {\n const keysArr = this.#keyOrder\n if (keysArr != null && keysArr.length > 1) {\n return keysArr[keysArr.length - 2]\n }\n return -1\n }\n\n getLastKey () {\n const keysLength = this.#keyOrder.length\n if (keysLength) {\n return this.#keyOrder[keysLength - 1]\n }\n }\n\n #deleteFromObject (key, obj) {\n const allKeys = JSON.parse(JSON.stringify(this.#keyOrder))\n const newCache = {}\n let indexToDelete\n for (const index in allKeys) {\n if (allKeys.hasOwnProperty(index)) {\n if (allKeys[index] !== key) {\n newCache[allKeys[index]] = obj[allKeys[index]]\n } else {\n indexToDelete = index\n }\n }\n }\n allKeys.splice(indexToDelete, 1)\n this.#keyOrder = JSON.parse(JSON.stringify(allKeys))\n return newCache\n }\n}\n","import { COOKIE_EXPIRY, FIRE_PUSH_UNREGISTERED, GCOOKIE_NAME, KCOOKIE_NAME, LRU_CACHE_SIZE, USEIP_KEY } from '../util/constants'\nimport { isValueValid } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport LRUCache from '../util/lruCache'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class CleverTapAPI {\n #logger\n #request\n #device\n #session\n\n constructor ({ logger, request, device, session }) {\n this.#logger = logger\n this.#request = request\n this.#device = device\n this.#session = session\n }\n\n /**\n *\n * @param {string} global gcookie\n * @param {string} session\n * @param {boolean} resume sent true in case of an OUL request from client side, which is returned as it is by server\n * @param {number} respNumber the index of the request in backupmanager\n * @param {boolean} optOutResponse\n * @returns\n */\n\n s (global, session, resume, respNumber, optOutResponse) {\n let oulReq = false\n let newGuid = false\n\n // for a scenario when OUL request is true from client side\n // but resume is returned as false from server end\n // we maintan a OulReqN var in the window object\n // and compare with respNumber to determine the response of an OUL request\n if (window.isOULInProgress) {\n if (resume || (respNumber !== 'undefined' && respNumber === window.oulReqN)) {\n window.isOULInProgress = false\n oulReq = true\n }\n }\n\n // call back function used to store global and session ids for the user\n if (typeof respNumber === 'undefined') {\n respNumber = 0\n }\n\n StorageManager.removeBackup(respNumber, this.#logger)\n\n if (respNumber > $ct.globalCache.REQ_N) {\n // request for some other user so ignore\n return\n }\n\n if (!isValueValid(this.#device.gcookie)) {\n if (global) {\n newGuid = true\n }\n }\n\n if (!isValueValid(this.#device.gcookie) || resume || typeof optOutResponse === 'boolean') {\n const sessionObj = this.#session.getSessionCookieObject()\n\n /* If the received session is less than the session in the cookie,\n then don't update guid as it will be response for old request\n */\n if (window.isOULInProgress || (sessionObj.s && (session < sessionObj.s))) {\n return\n }\n this.#logger.debug(`Cookie was ${this.#device.gcookie} set to ${global}`)\n this.#device.gcookie = global\n if (!isValueValid(this.#device.gcookie)) {\n // clear useIP meta prop\n StorageManager.getAndClearMetaProp(USEIP_KEY)\n }\n if (global && StorageManager._isLocalStorageSupported()) {\n if ($ct.LRU_CACHE == null) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n const kIdFromLS = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n let guidFromLRUCache\n if (kIdFromLS != null && kIdFromLS.id) {\n guidFromLRUCache = $ct.LRU_CACHE.cache[kIdFromLS.id]\n if (resume) {\n if (!guidFromLRUCache) {\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, true)\n // replace login identity in OUL request\n // with the gcookie returned in exchange\n $ct.LRU_CACHE.set(kIdFromLS.id, global)\n }\n }\n }\n\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n // lastk provides the guid\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n // fire the request directly via fireRequest to unregister the token\n // then other requests with the updated guid should follow\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n }\n StorageManager.createBroadCookie(GCOOKIE_NAME, global, COOKIE_EXPIRY, window.location.hostname)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, global)\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n this.#session.manageSession(session)\n }\n\n // session cookie\n const obj = this.#session.getSessionCookieObject()\n\n // for the race-condition where two responses come back with different session ids. don't write the older session id.\n if (typeof obj.s === 'undefined' || obj.s <= session) {\n obj.s = session\n obj.t = getNow() // time of last response from server\n this.#session.setSessionCookieObject(obj)\n }\n\n // set blockRequest to false only if the device has a valid gcookie\n if (isValueValid(this.#device.gcookie)) {\n $ct.blockRequest = false\n }\n\n // only process the backup events after an OUL request or a new guid is recieved\n if ((oulReq || newGuid) && !this.#request.processingBackup) {\n this.#request.processBackupEvents()\n }\n\n $ct.globalCache.RESP_N = respNumber\n }\n}\n","import { isValueValid } from '../util/datatypes'\nimport { StorageManager } from '../util/storage'\nimport { GCOOKIE_NAME, COOKIE_EXPIRY } from '../util/constants'\n\nexport default class DeviceManager {\n #logger\n gcookie\n\n constructor ({ logger }) {\n this.#logger = logger\n this.gcookie = this.getGuid()\n }\n\n getGuid () {\n let guid = null\n if (isValueValid(this.gcookie)) {\n return this.gcookie\n }\n if (StorageManager._isLocalStorageSupported()) {\n const value = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(value)) {\n try {\n guid = JSON.parse(decodeURIComponent(value))\n } catch (e) {\n this.#logger.debug('Cannot parse Gcookie from localstorage - must be encoded ' + value)\n // assumming guids are of size 32. supporting both formats.\n // guid can have encodedURIComponent or be without it.\n // 1.56e4078ed15749928c042479ec2b4d47 - breaks on JSON.parse(decodeURIComponent())\n // 2.%2256e4078ed15749928c042479ec2b4d47%22\n if (value.length === 32) {\n guid = value\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, value)\n } else {\n this.#logger.error('Illegal guid ' + value)\n }\n }\n\n // Persist to cookie storage if not present there.\n if (isValueValid(guid)) {\n StorageManager.createBroadCookie(GCOOKIE_NAME, guid, COOKIE_EXPIRY, window.location.hostname)\n }\n }\n }\n\n if (!isValueValid(guid)) {\n guid = StorageManager.readCookie(GCOOKIE_NAME)\n if (isValueValid(guid) && (guid.indexOf('%') === 0 || guid.indexOf('\\'') === 0 || guid.indexOf('\"') === 0)) {\n guid = null\n }\n if (isValueValid(guid)) {\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, guid)\n }\n }\n\n return guid\n }\n}\n","export const DATA_NOT_SENT_TEXT = 'This property has been ignored.'\nexport const INVALID_ACCOUNT = 'Invalid account ID'\nexport const INVALID_EVENT = 'Event structure not valid. Unable to process event'\nexport const CLEVERTAP_ERROR_PREFIX = 'CleverTap error:' // Formerly wzrk_error_txt\nexport const EMBED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Incorrect embed script.`\nexport const EVENT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Event structure not valid. ${DATA_NOT_SENT_TEXT}`\nexport const GENDER_ERROR = `${CLEVERTAP_ERROR_PREFIX} Gender value should be either M or F. ${DATA_NOT_SENT_TEXT}`\nexport const EMPLOYED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Employed value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const MARRIED_ERROR = `${CLEVERTAP_ERROR_PREFIX} Married value should be either Y or N. ${DATA_NOT_SENT_TEXT}`\nexport const EDUCATION_ERROR = `${CLEVERTAP_ERROR_PREFIX} Education value should be either School, College or Graduate. ${DATA_NOT_SENT_TEXT}`\nexport const AGE_ERROR = `${CLEVERTAP_ERROR_PREFIX} Age value should be a number. ${DATA_NOT_SENT_TEXT}`\nexport const DOB_ERROR = `${CLEVERTAP_ERROR_PREFIX} DOB value should be a Date Object`\nexport const OBJECT_ARRAY_ERROR = `${CLEVERTAP_ERROR_PREFIX} Expecting Object array in profile`\nexport const DATE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setDate(number). number should be formatted as yyyymmdd`\nexport const ENUM_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} setEnum(value). value should be a string or a number`\nexport const PHONE_FORMAT_ERROR = `${CLEVERTAP_ERROR_PREFIX} Phone number should be formatted as +[country code][number]`\n","import { isObject, isDateObject, isString, isNumber } from './datatypes'\nimport { convertToWZRKDate } from './datetime'\nimport { CHARGED_ID, CHARGEDID_COOKIE_NAME } from './constants'\nimport { StorageManager } from './storage'\n\nlet _globalChargedId\n\nexport const isEventStructureFlat = (eventObj) => {\n // Events cannot have nested structure or Arrays\n if (isObject(eventObj)) {\n for (var key in eventObj) {\n if (eventObj.hasOwnProperty(key)) {\n if (isObject(eventObj[key]) || Array.isArray(eventObj[key])) {\n return false\n } else if (isDateObject(eventObj[key])) {\n eventObj[key] = convertToWZRKDate(eventObj[key])\n }\n }\n }\n return true\n }\n return false\n}\n\nexport const isChargedEventStructureValid = (chargedObj, logger) => {\n if (isObject(chargedObj)) {\n for (var key in chargedObj) {\n if (chargedObj.hasOwnProperty(key)) {\n if (key === 'Items') {\n if (!Array.isArray(chargedObj[key])) {\n return false\n }\n\n if (chargedObj[key].length > 50) {\n logger.reportError(522, 'Charged Items exceed 50 limit. Actual count: ' + chargedObj[key].length)\n }\n\n for (var itemKey in chargedObj[key]) {\n if (chargedObj[key].hasOwnProperty(itemKey)) { // since default array implementation could be overridden - e.g. Teabox site\n if (!isObject(chargedObj[key][itemKey]) || !isEventStructureFlat(chargedObj[key][itemKey])) {\n return false\n }\n }\n }\n } else {\n if (isObject(chargedObj[key]) || Array.isArray(chargedObj[key])) {\n return false\n } else if (isDateObject(chargedObj[key])) {\n chargedObj[key] = convertToWZRKDate(chargedObj[key])\n }\n }\n }\n }\n\n if (isString(chargedObj[CHARGED_ID]) || isNumber(chargedObj[CHARGED_ID])) {\n // save charged Id\n const chargedId = chargedObj[CHARGED_ID] + '' // casting chargedId to string\n\n if (typeof _globalChargedId === 'undefined') {\n _globalChargedId = StorageManager.readFromLSorCookie(CHARGEDID_COOKIE_NAME)\n }\n if (typeof _globalChargedId !== 'undefined' && _globalChargedId.trim() === chargedId.trim()) {\n // drop event- duplicate charged id\n logger.error('Duplicate charged Id - Dropped' + chargedObj)\n return false\n }\n _globalChargedId = chargedId\n StorageManager.saveToLSorCookie(CHARGEDID_COOKIE_NAME, chargedId)\n }\n return true\n } // if object (chargedObject)\n return false\n}\n","import { isString, isObject, sanitize } from '../util/datatypes'\nimport { EVENT_ERROR } from '../util/messages'\nimport { EV_COOKIE, SYSTEM_EVENTS, unsupportedKeyCharRegex } from '../util/constants'\nimport { isChargedEventStructureValid, isEventStructureFlat } from '../util/validator'\nimport { StorageManager, $ct } from '../util/storage'\n\nexport default class EventHandler extends Array {\n #logger\n #oldValues\n #request\n #isPersonalisationActive\n\n constructor ({ logger, request, isPersonalisationActive }, values) {\n super()\n this.#logger = logger\n this.#oldValues = values\n this.#request = request\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...eventsArr) {\n this.#processEventArray(eventsArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processEventArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processEventArray (eventsArr) {\n if (Array.isArray(eventsArr)) {\n while (eventsArr.length > 0) {\n var eventName = eventsArr.shift()\n if (!isString(eventName)) {\n this.#logger.error(EVENT_ERROR)\n continue\n }\n\n if (eventName.length > 1024) {\n eventName = eventName.substring(0, 1024)\n this.#logger.reportError(510, eventName + '... length exceeded 1024 chars. Trimmed.')\n }\n\n if (SYSTEM_EVENTS.includes(eventName)) {\n this.#logger.reportError(513, eventName + ' is a restricted system event. It cannot be used as an event name.')\n continue\n }\n\n const data = {}\n data.type = 'event'\n data.evtName = sanitize(eventName, unsupportedKeyCharRegex)\n\n if (eventsArr.length !== 0) {\n const eventObj = eventsArr.shift()\n if (!isObject(eventObj)) {\n // put it back if it is not an object\n eventsArr.unshift(eventObj)\n } else {\n // check Charged Event vs. other events.\n if (eventName === 'Charged') {\n if (!isChargedEventStructureValid(eventObj, this.#logger)) {\n this.#logger.reportError(511, 'Charged event structure invalid. Not sent.')\n continue\n }\n } else {\n if (!isEventStructureFlat(eventObj)) {\n this.#logger.reportError(512, eventName + ' event structure invalid. Not sent.')\n continue\n }\n }\n data.evtData = eventObj\n }\n }\n\n this.#request.processEvent(data)\n }\n }\n }\n\n getDetails (evtName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n }\n if (typeof $ct.globalEventsMap === 'undefined') {\n return\n }\n const evtObj = $ct.globalEventsMap[evtName]\n const respObj = {}\n if (typeof evtObj !== 'undefined') {\n respObj.firstTime = new Date(evtObj[1] * 1000)\n respObj.lastTime = new Date(evtObj[2] * 1000)\n respObj.count = evtObj[0]\n return respObj\n }\n }\n}\n","export const getURLParams = (url) => {\n const urlParams = {}\n const idx = url.indexOf('?')\n\n if (idx > 1) {\n const uri = url.substring(idx + 1)\n let match\n const pl = /\\+/g // Regex for replacing addition symbol with a space\n const search = /([^&=]+)=?([^&]*)/g\n const decode = function (s) {\n let replacement = s.replace(pl, ' ')\n try {\n replacement = decodeURIComponent(replacement)\n } catch (e) {\n // eat\n }\n return replacement\n }\n match = search.exec(uri)\n while (match) {\n urlParams[decode(match[1])] = decode(match[2])\n match = search.exec(uri)\n }\n }\n return urlParams\n}\n\nexport const getDomain = (url) => {\n if (url === '') return ''\n var a = document.createElement('a')\n a.href = url\n return a.hostname\n}\n\nexport const addToURL = (url, k, v) => {\n return url + '&' + k + '=' + encodeURIComponent(v)\n}\n\nexport const getHostName = () => {\n return window.location.hostname\n}\n","/* eslint-disable */\nexport const urlBase64ToUint8Array = (base64String) => {\n let padding = '='.repeat((4 - base64String.length % 4) % 4)\n let base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/')\n\n let rawData = window.atob(base64)\n let processedData = []\n for (let i=0; i {\n logger && typeof logger.debug === 'function' && logger.debug('dobj:' + dataObject)\n return compressToBase64(dataObject)\n}\n\nexport const compress = (uncompressed) => {\n if (uncompressed == null) return ''\n let i, value,\n context_dictionary = {},\n context_dictionaryToCreate = {},\n context_c = '',\n context_wc = '',\n context_w = '',\n context_enlargeIn = 2, // Compensate for the first entry which should not count\n context_dictSize = 3,\n context_numBits = 2,\n context_data_string = '',\n context_data_val = 0,\n context_data_position = 0,\n ii,\n f = String.fromCharCode\n\n for (ii = 0; ii < uncompressed.length; ii += 1) {\n context_c = uncompressed.charAt(ii)\n if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {\n context_dictionary[context_c] = context_dictSize++\n context_dictionaryToCreate[context_c] = true\n }\n\n context_wc = context_w + context_c\n if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {\n context_w = context_wc\n } else {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w];\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0;\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n // Add wc to the dictionary.\n context_dictionary[context_wc] = context_dictSize++\n context_w = String(context_c)\n }\n }\n\n // Output the code for w.\n if (context_w !== '') {\n if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {\n if (context_w.charCodeAt(0) < 256) {\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n }\n value = context_w.charCodeAt(0)\n for (i = 0; i < 8; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n } else {\n value = 1\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | value\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = 0\n }\n value = context_w.charCodeAt(0);\n for (i = 0; i < 16; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n delete context_dictionaryToCreate[context_w]\n } else {\n value = context_dictionary[context_w]\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n\n }\n context_enlargeIn--\n if (context_enlargeIn == 0) {\n context_enlargeIn = Math.pow(2, context_numBits)\n context_numBits++\n }\n }\n\n // Mark the end of the stream\n value = 2\n for (i = 0; i < context_numBits; i++) {\n context_data_val = (context_data_val << 1) | (value & 1)\n if (context_data_position == 15) {\n context_data_position = 0\n context_data_string += f(context_data_val)\n context_data_val = 0\n } else {\n context_data_position++\n }\n value = value >> 1\n }\n\n // Flush the last char\n while (true) {\n context_data_val = (context_data_val << 1)\n if (context_data_position == 15) {\n context_data_string += f(context_data_val)\n break\n } else context_data_position++\n }\n return context_data_string\n}\n\nexport const getKeyStr = () => {\n let key = ''\n let i = 0\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 65)\n }\n\n for (i = 0; i <= 25; i++) {\n key = key + String.fromCharCode(i + 97)\n }\n\n for (i = 0; i < 10; i++) {\n key = key + i\n }\n\n return key + '+/='\n}\n\nconst _keyStr = getKeyStr()\n\nexport const convertToFormattedHex = (byte_arr) => {\n let hex_str = '',\n i,\n len,\n tmp_hex\n\n if (!Array.isArray(byte_arr)) {\n return false\n }\n\n len = byte_arr.length\n\n for (i = 0; i < len; ++i) {\n if (byte_arr[i] < 0) {\n byte_arr[i] = byte_arr[i] + 256\n }\n if (byte_arr[i] === undefined) {\n byte_arr[i] = 0\n }\n tmp_hex = byte_arr[i].toString(16)\n\n if (tmp_hex.length == 1) tmp_hex = '0' + tmp_hex // Add leading zero.\n\n // beautification - needed if you're printing this in the console, else keep commented\n // if ((i + 1) % 16 === 0) {\n // tmp_hex += \"\\n\";\n // } else {\n // tmp_hex += \" \";\n // }\n\n hex_str += tmp_hex\n }\n\n return hex_str.trim()\n}\n\nexport const convertStringToHex = (s) => {\n let byte_arr = []\n for (let i = 0; i < s.length; i++) {\n let value = s.charCodeAt(i)\n byte_arr.push(value & 255)\n byte_arr.push((value >> 8) & 255)\n }\n return convertToFormattedHex(byte_arr)\n}\n\nexport const compressToBase64 = (input) => {\n if (input == null) return ''\n var output = ''\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4\n var i = 0\n\n input = compress(input)\n\n while (i < input.length * 2) {\n\n if (i % 2 == 0) {\n chr1 = input.charCodeAt(i / 2) >> 8\n chr2 = input.charCodeAt(i / 2) & 255\n if (i / 2 + 1 < input.length)\n chr3 = input.charCodeAt(i / 2 + 1) >> 8\n else\n chr3 = NaN\n } else {\n chr1 = input.charCodeAt((i - 1) / 2) & 255\n if ((i + 1) / 2 < input.length) {\n chr2 = input.charCodeAt((i + 1) / 2) >> 8\n chr3 = input.charCodeAt((i + 1) / 2) & 255\n } else\n chr2 = chr3 = NaN\n }\n i += 3\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64\n } else if (isNaN(chr3)) {\n enc4 = 64\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4)\n\n }\n\n return output\n}\n","\nimport { ARP_COOKIE, MAX_TRIES, OPTOUT_COOKIE_ENDSWITH, USEIP_KEY, MAX_DELAY_FREQUENCY, PUSH_DELAY_MS, WZRK_FETCH } from './constants'\nimport { isString, isValueValid } from './datatypes'\nimport { compressData } from './encoder'\nimport { StorageManager, $ct } from './storage'\nimport { addToURL } from './url'\n\nexport default class RequestDispatcher {\n static logger\n static device\n static account\n networkRetryCount = 0\n minDelayFrequency = 0\n\n // ANCHOR - Requests get fired from here\n static #fireRequest (url, tries, skipARP, sendOULFlag, evtName) {\n if (this.#dropRequestDueToOptOut()) {\n this.logger.debug('req dropped due to optout cookie: ' + this.device.gcookie)\n return\n }\n\n // set a request in progress\n // so that if gcookie is not present, no other request can be made asynchronusly\n if (!isValueValid(this.device.gcookie)) {\n $ct.blockRequest = true\n }\n /**\n * if the gcookie is null\n * and the request is not the first request\n * and the tries are less than max tries\n * keep retrying\n */\n\n if (evtName && evtName === WZRK_FETCH) {\n // New retry mechanism\n if (!isValueValid(this.device.gcookie) && ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1)) {\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${this.networkRetryCount}`)\n this.#fireRequest(url, undefined, skipARP, sendOULFlag)\n }, this.getDelayFrequency())\n }\n } else {\n if (!isValueValid(this.device.gcookie) &&\n ($ct.globalCache.RESP_N < $ct.globalCache.REQ_N - 1) &&\n tries < MAX_TRIES) {\n // if ongoing First Request is in progress, initiate retry\n setTimeout(() => {\n this.logger.debug(`retrying fire request for url: ${url}, tries: ${tries}`)\n this.#fireRequest(url, tries + 1, skipARP, sendOULFlag)\n }, 50)\n return\n }\n }\n\n // set isOULInProgress to true\n // when sendOULFlag is set to true\n if (!sendOULFlag) {\n if (isValueValid(this.device.gcookie)) {\n // add gcookie to url\n url = addToURL(url, 'gc', this.device.gcookie)\n }\n url = this.#addARPToRequest(url, skipARP)\n } else {\n window.isOULInProgress = true\n }\n\n url = addToURL(url, 'tries', tries) // Add tries to URL\n\n url = this.#addUseIPToRequest(url)\n url = addToURL(url, 'r', new Date().getTime()) // add epoch to beat caching of the URL\n // TODO: Figure out a better way to handle plugin check\n if (window.clevertap?.hasOwnProperty('plugin') || window.wizrocket?.hasOwnProperty('plugin')) {\n // used to add plugin name in request parameter\n const plugin = window.clevertap.plugin || window.wizrocket.plugin\n url = addToURL(url, 'ct_pl', plugin)\n }\n if (url.indexOf('chrome-extension:') !== -1) {\n url = url.replace('chrome-extension:', 'https:')\n }\n // TODO: Try using Function constructor instead of appending script.\n var ctCbScripts = document.getElementsByClassName('ct-jp-cb')\n while (ctCbScripts[0] && ctCbScripts[0].parentNode) {\n ctCbScripts[0].parentNode.removeChild(ctCbScripts[0])\n }\n const s = document.createElement('script')\n s.setAttribute('type', 'text/javascript')\n s.setAttribute('src', url)\n s.setAttribute('class', 'ct-jp-cb')\n s.setAttribute('rel', 'nofollow')\n s.async = true\n document.getElementsByTagName('head')[0].appendChild(s)\n this.logger.debug('req snt -> url: ' + url)\n }\n\n /**\n *\n * @param {string} url\n * @param {*} skipARP\n * @param {boolean} sendOULFlag\n */\n static fireRequest (url, skipARP, sendOULFlag, evtName) {\n this.#fireRequest(url, 1, skipARP, sendOULFlag, evtName)\n }\n\n static #dropRequestDueToOptOut () {\n if ($ct.isOptInRequest || !isValueValid(this.device.gcookie) || !isString(this.device.gcookie)) {\n $ct.isOptInRequest = false\n return false\n }\n return this.device.gcookie.slice(-3) === OPTOUT_COOKIE_ENDSWITH\n }\n\n static #addUseIPToRequest (pageLoadUrl) {\n var useIP = StorageManager.getMetaProp(USEIP_KEY)\n if (typeof useIP !== 'boolean') {\n useIP = false\n }\n return addToURL(pageLoadUrl, USEIP_KEY, useIP ? 'true' : 'false')\n };\n\n static #addARPToRequest (url, skipResARP) {\n if (skipResARP === true) {\n const _arp = {}\n _arp.skipResARP = true\n return addToURL(url, 'arp', compressData(JSON.stringify(_arp), this.logger))\n }\n if (StorageManager._isLocalStorageSupported() && typeof localStorage.getItem(ARP_COOKIE) !== 'undefined' && localStorage.getItem(ARP_COOKIE) !== null) {\n return addToURL(url, 'arp', compressData(JSON.stringify(StorageManager.readFromLSorCookie(ARP_COOKIE)), this.logger))\n }\n return url\n }\n\n getDelayFrequency () {\n this.logger.debug('Network retry #' + this.networkRetryCount)\n\n // Retry with delay as 1s for first 10 retries\n if (this.networkRetryCount < 10) {\n this.logger.debug(this.account.id, 'Failure count is ' + this.networkRetryCount + '. Setting delay frequency to 1s')\n this.minDelayFrequency = PUSH_DELAY_MS // Reset minimum delay to 1s\n return this.minDelayFrequency\n }\n\n if (this.account.region == null) {\n // Retry with delay as 1s if region is null in case of eu1\n this.logger.debug(this.account.id, 'Setting delay frequency to 1s')\n return PUSH_DELAY_MS\n } else {\n // Retry with delay as minimum delay frequency and add random number of seconds to scatter traffic\n const randomDelay = (Math.floor(Math.random() * 10) + 1) * 1000\n this.minDelayFrequency += randomDelay\n if (this.minDelayFrequency < MAX_DELAY_FREQUENCY) {\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n } else {\n this.minDelayFrequency = PUSH_DELAY_MS\n }\n this.logger.debug(this.account.id, 'Setting delay frequency to ' + this.minDelayFrequency)\n return this.minDelayFrequency\n }\n }\n}\n","// CleverTap specific utilities\n\nimport {\n StorageManager,\n $ct\n} from './storage'\nimport {\n CAMP_COOKIE_NAME,\n singleQuoteRegex,\n PR_COOKIE,\n ARP_COOKIE,\n GCOOKIE_NAME,\n IS_OUL,\n categoryLongKey,\n CAMP_COOKIE_G,\n GLOBAL\n} from './constants'\nimport {\n GENDER_ERROR,\n EMPLOYED_ERROR,\n MARRIED_ERROR,\n EDUCATION_ERROR,\n AGE_ERROR,\n DOB_ERROR,\n PHONE_FORMAT_ERROR,\n ENUM_FORMAT_ERROR\n} from './messages'\nimport {\n getToday,\n convertToWZRKDate,\n setDate,\n getNow\n} from './datetime'\nimport {\n isObject,\n isDateObject,\n isConvertibleToNumber,\n isObjectEmpty,\n isString,\n isNumber,\n isValueValid\n} from './datatypes'\n\nimport { addToURL, getURLParams } from './url'\nimport { compressData } from './encoder'\nimport RequestDispatcher from './requestDispatcher'\n\nexport const getCampaignObject = () => {\n let finalcampObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let campObj = StorageManager.read(CAMP_COOKIE_NAME)\n if (campObj != null) {\n campObj = JSON.parse(decodeURIComponent(campObj).replace(singleQuoteRegex, '\\\"'))\n if (campObj.hasOwnProperty('global')) {\n finalcampObj.wp = campObj\n } else {\n finalcampObj = campObj\n }\n } else {\n finalcampObj = {}\n }\n }\n return finalcampObj\n}\n\nexport const saveCampaignObject = (campaignObj) => {\n if (StorageManager._isLocalStorageSupported()) {\n const newObj = { ...getCampaignObject(), ...campaignObj }\n const campObj = JSON.stringify(newObj)\n StorageManager.save(CAMP_COOKIE_NAME, encodeURIComponent(campObj))\n // Update the CAMP_COOKIE_G to be in sync with CAMP_COOKIE_NAME\n setCampaignObjectForGuid()\n }\n}\n\n// set Campaign Object against the guid, with daily count and total count details\nexport const setCampaignObjectForGuid = () => {\n if (StorageManager._isLocalStorageSupported()) {\n let guid = StorageManager.read(GCOOKIE_NAME)\n if (isValueValid(guid)) {\n try {\n guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n const guidCampObj = StorageManager.read(CAMP_COOKIE_G) ? JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G))) : {}\n if (guid && StorageManager._isLocalStorageSupported()) {\n var finalCampObj = {}\n var campObj = getCampaignObject()\n Object.keys(campObj).forEach(key => {\n const campKeyObj = (guid in guidCampObj && Object.keys(guidCampObj[guid]).length && guidCampObj[guid][key]) ? guidCampObj[guid][key] : {}\n const globalObj = campObj[key].global\n const today = getToday()\n const dailyObj = campObj[key][today]\n if (typeof globalObj !== 'undefined') {\n const campaignIdArray = Object.keys(globalObj)\n for (const index in campaignIdArray) {\n let resultObj = []\n if (campaignIdArray.hasOwnProperty(index)) {\n let dailyC = 0\n let totalC = 0\n const campaignId = campaignIdArray[index]\n if (campaignId === 'tc') {\n continue\n }\n if (typeof dailyObj !== 'undefined' && typeof dailyObj[campaignId] !== 'undefined') {\n dailyC = dailyObj[campaignId]\n }\n if (typeof globalObj !== 'undefined' && typeof globalObj[campaignId] !== 'undefined') {\n totalC = globalObj[campaignId]\n }\n resultObj = [campaignId, dailyC, totalC]\n campKeyObj[campaignId] = resultObj\n }\n }\n }\n finalCampObj = { ...finalCampObj, [key]: campKeyObj }\n })\n guidCampObj[guid] = finalCampObj\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n } catch (e) {\n console.error('Invalid clevertap Id ' + e)\n }\n }\n }\n}\nexport const getCampaignObjForLc = () => {\n // before preparing data to send to LC , check if the entry for the guid is already there in CAMP_COOKIE_G\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n\n let campObj = {}\n if (StorageManager._isLocalStorageSupported()) {\n let resultObj = {}\n campObj = getCampaignObject()\n const storageValue = StorageManager.read(CAMP_COOKIE_G)\n const decodedValue = storageValue ? decodeURIComponent(storageValue) : null\n const parsedValue = decodedValue ? JSON.parse(decodedValue) : null\n\n const resultObjWP = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wp)\n ? Object.values(parsedValue[guid].wp)\n : []\n\n const resultObjWI = (!!guid &&\n storageValue !== undefined && storageValue !== null &&\n parsedValue && parsedValue[guid] && parsedValue[guid].wi)\n ? Object.values(parsedValue[guid].wi)\n : []\n\n const today = getToday()\n let todayCwp = 0\n let todayCwi = 0\n if (campObj.wp && campObj.wp[today] && campObj.wp[today].tc !== 'undefined') {\n todayCwp = campObj.wp[today].tc\n }\n if (campObj.wi && campObj.wi[today] && campObj.wi[today].tc !== 'undefined') {\n todayCwi = campObj.wi[today].tc\n }\n resultObj = {\n wmp: todayCwp,\n wimp: todayCwi,\n tlc: resultObjWP,\n witlc: resultObjWI\n }\n return resultObj\n }\n}\n\nexport const isProfileValid = (profileObj, { logger }) => {\n let valid = false\n if (isObject(profileObj)) {\n for (const profileKey in profileObj) {\n if (profileObj.hasOwnProperty(profileKey)) {\n valid = true\n let profileVal = profileObj[profileKey]\n\n if (profileVal == null) {\n delete profileObj[profileKey]\n continue\n }\n if (profileKey === 'Gender' && !profileVal.match(/^M$|^F$/)) {\n valid = false\n logger.error(GENDER_ERROR)\n }\n\n if (profileKey === 'Employed' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(EMPLOYED_ERROR)\n }\n\n if (profileKey === 'Married' && !profileVal.match(/^Y$|^N$/)) {\n valid = false\n logger.error(MARRIED_ERROR)\n }\n\n if (profileKey === 'Education' && !profileVal.match(/^School$|^College$|^Graduate$/)) {\n valid = false\n logger.error(EDUCATION_ERROR)\n }\n\n if (profileKey === 'Age' && profileVal != null) {\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Age = +profileVal\n } else {\n valid = false\n logger.error(AGE_ERROR)\n }\n }\n // dob will come in like this - $dt_19470815 or dateObject\n if (profileKey === 'DOB') {\n if (((!(/^\\$D_/).test(profileVal) || (profileVal + '').length !== 11)) && !isDateObject(profileVal)) {\n valid = false\n logger.error(DOB_ERROR)\n }\n\n if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n } else if (isDateObject(profileVal)) {\n profileObj[profileKey] = convertToWZRKDate(profileVal)\n }\n\n if (profileKey === 'Phone' && !isObjectEmpty(profileVal)) {\n if (profileVal.length > 8 && (profileVal.charAt(0) === '+')) { // valid phone number\n profileVal = profileVal.substring(1, profileVal.length)\n if (isConvertibleToNumber(profileVal)) {\n profileObj.Phone = +profileVal\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n } else {\n valid = false\n logger.error(PHONE_FORMAT_ERROR + '. Removed.')\n }\n }\n\n if (!valid) {\n delete profileObj[profileKey]\n }\n }\n }\n }\n return valid\n}\n\nexport const processFBUserObj = (user) => {\n const profileData = {}\n profileData.Name = user.name\n if (user.id != null) {\n profileData.FBID = user.id + ''\n }\n // Feb 2014 - FB announced over 58 gender options, hence we specifically look for male or female. Rest we don't care.\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else {\n profileData.Gender = 'O'\n }\n\n const getHighestEducation = function (eduArr) {\n if (eduArr != null) {\n let college = ''\n let highschool = ''\n\n for (let i = 0; i < eduArr.length; i++) {\n const edu = eduArr[i]\n if (edu.type != null) {\n const type = edu.type\n if (type === 'Graduate School') {\n return 'Graduate'\n } else if (type === 'College') {\n college = '1'\n } else if (type === 'High School') {\n highschool = '1'\n }\n }\n }\n\n if (college === '1') {\n return 'College'\n } else if (highschool === '1') {\n return 'School'\n }\n }\n }\n\n if (user.relationship_status != null) {\n profileData.Married = 'N'\n if (user.relationship_status === 'Married') {\n profileData.Married = 'Y'\n }\n }\n\n const edu = getHighestEducation(user.education)\n if (edu != null) {\n profileData.Education = edu\n }\n\n const work = (user.work != null) ? user.work.length : 0\n if (work > 0) {\n profileData.Employed = 'Y'\n } else {\n profileData.Employed = 'N'\n }\n\n if (user.email != null) {\n profileData.Email = user.email\n }\n\n if (user.birthday != null) {\n const mmddyy = user.birthday.split('/') // comes in as \"08/15/1947\"\n profileData.DOB = setDate(mmddyy[2] + mmddyy[0] + mmddyy[1])\n }\n return profileData\n}\n\nexport const processGPlusUserObj = (user, { logger }) => {\n const profileData = {}\n if (user.displayName != null) {\n profileData.Name = user.displayName\n }\n if (user.id != null) {\n profileData.GPID = user.id + ''\n }\n\n if (user.gender != null) {\n if (user.gender === 'male') {\n profileData.Gender = 'M'\n } else if (user.gender === 'female') {\n profileData.Gender = 'F'\n } else if (user.gender === 'other') {\n profileData.Gender = 'O'\n }\n }\n\n if (user.image != null) {\n if (user.image.isDefault === false) {\n profileData.Photo = user.image.url.split('?sz')[0]\n }\n }\n\n if (user.emails != null) {\n for (let emailIdx = 0; emailIdx < user.emails.length; emailIdx++) {\n const emailObj = user.emails[emailIdx]\n if (emailObj.type === 'account') {\n profileData.Email = emailObj.value\n }\n }\n }\n\n if (user.organizations != null) {\n profileData.Employed = 'N'\n for (let i = 0; i < user.organizations.length; i++) {\n const orgObj = user.organizations[i]\n if (orgObj.type === 'work') {\n profileData.Employed = 'Y'\n }\n }\n }\n\n if (user.birthday != null) {\n const yyyymmdd = user.birthday.split('-') // comes in as \"1976-07-27\"\n profileData.DOB = setDate(yyyymmdd[0] + yyyymmdd[1] + yyyymmdd[2])\n }\n\n if (user.relationshipStatus != null) {\n profileData.Married = 'N'\n if (user.relationshipStatus === 'married') {\n profileData.Married = 'Y'\n }\n }\n logger.debug('gplus usr profile ' + JSON.stringify(profileData))\n\n return profileData\n}\n\nexport const addToLocalProfileMap = (profileObj, override) => {\n if (StorageManager._isLocalStorageSupported()) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = {}\n }\n }\n\n // Move props from custom bucket to outside.\n if (profileObj._custom != null) {\n const keys = profileObj._custom\n for (const key in keys) {\n if (keys.hasOwnProperty(key)) {\n profileObj[key] = keys[key]\n }\n }\n delete profileObj._custom\n }\n\n for (const prop in profileObj) {\n if (profileObj.hasOwnProperty(prop)) {\n if ($ct.globalProfileMap.hasOwnProperty(prop) && !override) {\n continue\n }\n $ct.globalProfileMap[prop] = profileObj[prop]\n }\n }\n if ($ct.globalProfileMap._custom != null) {\n delete $ct.globalProfileMap._custom\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n }\n}\n\nexport const closeIframe = (campaignId, divIdIgnored, currentSessionId) => {\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n if ($ct.campaignDivMap != null) {\n const divId = $ct.campaignDivMap[campaignId]\n if (divId != null) {\n document.getElementById(divId).style.display = 'none'\n if (divId === 'intentPreview') {\n if (document.getElementById('intentOpacityDiv') != null) {\n document.getElementById('intentOpacityDiv').style.display = 'none'\n }\n } else if (divId === 'wizParDiv0') {\n if (document.getElementById('intentOpacityDiv0') != null) {\n document.getElementById('intentOpacityDiv0').style.display = 'none'\n }\n } else if (divId === 'wizParDiv2') {\n if (document.getElementById('intentOpacityDiv2') != null) {\n document.getElementById('intentOpacityDiv2').style.display = 'none'\n }\n }\n }\n }\n}\n\nexport const arp = (jsonMap) => {\n // For unregister calls dont set arp in LS\n if (jsonMap.skipResARP != null && jsonMap.skipResARP) {\n console.debug('Update ARP Request rejected', jsonMap)\n return null\n }\n\n const isOULARP = jsonMap[IS_OUL] === true\n\n if (StorageManager._isLocalStorageSupported()) {\n // Update arp only if it is null or an oul request\n try {\n let arpFromStorage = StorageManager.readFromLSorCookie(ARP_COOKIE)\n if (arpFromStorage == null || isOULARP) {\n arpFromStorage = {}\n for (const key in jsonMap) {\n if (jsonMap.hasOwnProperty(key)) {\n if (jsonMap[key] === -1) {\n delete arpFromStorage[key]\n } else {\n arpFromStorage[key] = jsonMap[key]\n }\n }\n }\n StorageManager.saveToLSorCookie(ARP_COOKIE, arpFromStorage)\n }\n } catch (e) {\n console.error('Unable to parse ARP JSON: ' + e)\n }\n }\n}\n\nexport const getWrappedLink = (link, targetId, type, request, account, logger) => {\n let data = {}\n data.sendTo = link\n data.targetId = targetId\n data.epoch = getNow()\n\n if (type != null) {\n data.type = type\n } else {\n data.type = 'view'\n }\n\n data = request.addSystemDataToObject(data, undefined)\n return addToURL(account.recorderURL, 'd', compressData(JSON.stringify(data), logger))\n}\n\nexport const getMessageTemplate = () => {\n return `\n
`\n}\n\nexport const getMessageHeadTemplate = () => {\n return `\n \n \n \n \n `\n}\n\nexport const setEnum = (enumVal, logger) => {\n if (isString(enumVal) || isNumber(enumVal)) {\n return '$E_' + enumVal\n }\n logger.error(ENUM_FORMAT_ERROR)\n}\nexport const handleEmailSubscription = (subscription, reEncoded, fetchGroups, account, logger) => {\n const urlParamsAsIs = getURLParams(location.href) // can't use url_params as it is in lowercase above\n const encodedEmailId = urlParamsAsIs.e\n const encodedProfileProps = urlParamsAsIs.p\n const pageType = urlParamsAsIs.page_type\n\n if (typeof encodedEmailId !== 'undefined') {\n const data = {}\n data.id = account.id // accountId\n data.unsubGroups = $ct.unsubGroups // unsubscribe groups\n\n if ($ct.updatedCategoryLong) {\n data[categoryLongKey] = $ct.updatedCategoryLong\n }\n\n let url = account.emailURL\n if (fetchGroups) {\n url = addToURL(url, 'fetchGroups', fetchGroups)\n }\n if (reEncoded) {\n url = addToURL(url, 'encoded', reEncoded)\n }\n url = addToURL(url, 'e', encodedEmailId)\n url = addToURL(url, 'd', compressData(JSON.stringify(data), logger))\n if (encodedProfileProps) {\n url = addToURL(url, 'p', encodedProfileProps)\n }\n\n if (subscription !== '-1') {\n url = addToURL(url, 'sub', subscription)\n }\n\n if (pageType) {\n $ct.globalUnsubscribe = pageType === GLOBAL\n url = addToURL(url, 'page_type', pageType)\n }\n RequestDispatcher.fireRequest(url)\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\nimport {\n COMMAND_DELETE,\n COMMAND_INCREMENT,\n EVT_PUSH,\n PR_COOKIE\n} from '../util/constants'\nimport {\n addToURL\n} from '../util/url'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport { compressData } from '../util/encoder'\nexport default class ProfileHandler extends Array {\n #logger\n #request\n #account\n #oldValues\n #isPersonalisationActive\n\n constructor ({\n logger,\n request,\n account,\n isPersonalisationActive\n }, values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n push (...profilesArr) {\n this.#processProfileArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processProfileArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n getAttribute (propName) {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap != null) {\n return $ct.globalProfileMap[propName]\n }\n }\n\n #processProfileArray (profileArr) {\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (!isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n }\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {number} value\n * @param {string} command\n * increases or decreases value of the number type properties in profile object\n */\n _handleIncrementDecrementValue (key, value, command) {\n // Check if the value is greater than 0\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if ($ct.globalProfileMap == null && !$ct.globalProfileMap?.hasOwnProperty(key)) {\n // Check if the profile map already has the propery defined\n console.error('Kindly create profile with required proprty to increment/decrement.')\n } else if (!value || typeof value !== 'number' || value <= 0) {\n console.error('Value should be a number greater than 0')\n } else {\n // Update the profile property in local storage\n if (command === COMMAND_INCREMENT) {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] + value\n } else {\n $ct.globalProfileMap[key] = $ct.globalProfileMap[key] - value\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n profileObj[key] = { [command]: value }\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n }\n\n /**\n *\n * @param {any} key\n * @param {array} arrayVal\n * @param {string} command\n * overwrites/sets new value(s) against a key/property in profile object\n */\n _handleMultiValueSet (key, arrayVal, command) {\n const array = []\n for (let i = 0; i < arrayVal.length; i++) {\n if (typeof arrayVal[i] === 'number' && !array.includes(arrayVal[i])) {\n array.push(arrayVal[i])\n } else if (typeof arrayVal[i] === 'string' && !array.includes(arrayVal[i].toLowerCase())) {\n array.push(arrayVal[i].toLowerCase())\n } else {\n console.error('array supports only string or number type values')\n }\n }\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) ?? {}\n }\n $ct.globalProfileMap[key] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(key, arrayVal, command)\n }\n\n /**\n *\n * @param {any} propKey - the property name to be added in the profile object\n * @param {string, number, array} propVal - the property value to be added against the @propkey key\n * @param {string} command\n * Adds array or single value against a key/property in profile object\n */\n _handleMultiValueAdd (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n const existingValue = $ct.globalProfileMap[propKey]\n const array = Array.isArray(existingValue) ? existingValue : (existingValue != null ? [existingValue] : [])\n\n const addValue = (value) => {\n const normalizedValue = typeof value === 'number' ? value : value.toLowerCase()\n if (!array.includes(normalizedValue)) {\n array.push(normalizedValue)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(value => {\n if (typeof value === 'string' || typeof value === 'number') {\n addValue(value)\n } else {\n this.#logger.error('Array supports only string or number type values')\n }\n })\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n addValue(propVal)\n } else {\n this.#logger.error('Unsupported value type')\n return\n }\n\n $ct.globalProfileMap[propKey] = array\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string, number, array} propVal\n * @param {string} command\n * removes value(s) against a key/property in profile object\n */\n _handleMultiValueRemove (propKey, propVal, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE) || {}\n }\n\n if (!$ct.globalProfileMap.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n return\n }\n\n const removeValue = (value) => {\n const index = $ct.globalProfileMap[propKey].indexOf(value)\n if (index !== -1) {\n $ct.globalProfileMap[propKey].splice(index, 1)\n }\n }\n\n if (Array.isArray(propVal)) {\n propVal.forEach(removeValue)\n } else if (typeof propVal === 'string' || typeof propVal === 'number') {\n removeValue(propVal)\n } else {\n this.#logger.error('Unsupported propVal type')\n return\n }\n\n // Remove the key if the array is empty\n if ($ct.globalProfileMap[propKey].length === 0) {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, propVal, command)\n }\n\n /**\n *\n * @param {any} propKey\n * @param {string} command\n * deletes a key value pair from the profile object\n */\n _handleMultiValueDelete (propKey, command) {\n if ($ct.globalProfileMap == null) {\n $ct.globalProfileMap = StorageManager.readFromLSorCookie(PR_COOKIE)\n }\n if (!$ct?.globalProfileMap?.hasOwnProperty(propKey)) {\n this.#logger.error(`The property ${propKey} does not exist.`)\n } else {\n delete $ct.globalProfileMap[propKey]\n }\n StorageManager.saveToLSorCookie(PR_COOKIE, $ct.globalProfileMap)\n this.sendMultiValueData(propKey, null, command)\n }\n\n sendMultiValueData (propKey, propVal, command) {\n // Send the updated value to LC\n let data = {}\n const profileObj = {}\n data.type = 'profile'\n\n // this removes the property at backend\n profileObj[propKey] = { [command]: command === COMMAND_DELETE ? true : propVal }\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n}\n","import {\n isObject,\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n KCOOKIE_NAME,\n GCOOKIE_NAME,\n EVT_PUSH,\n LRU_CACHE_SIZE,\n IS_OUL,\n CAMP_COOKIE_NAME,\n CHARGEDID_COOKIE_NAME,\n PR_COOKIE,\n EV_COOKIE,\n ARP_COOKIE,\n CLEAR,\n META_COOKIE,\n FIRE_PUSH_UNREGISTERED\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport LRUCache from '../util/lruCache'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL,\n getHostName\n} from '../util/url'\nimport {\n isProfileValid,\n processFBUserObj,\n processGPlusUserObj,\n addToLocalProfileMap\n} from '../util/clevertap'\n\nexport default class UserLoginHandler extends Array {\n #request\n #logger\n #account\n #session\n #oldValues\n #device\n\n constructor ({\n request,\n account,\n session,\n logger,\n device\n },\n values) {\n super()\n this.#request = request\n this.#account = account\n this.#session = session\n this.#logger = logger\n this.#oldValues = values\n this.#device = device\n }\n\n // On User Login\n #processOUL (profileArr) {\n let sendOULFlag = true\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n const addToK = (ids) => {\n let k = StorageManager.readFromLSorCookie(KCOOKIE_NAME)\n const g = StorageManager.readFromLSorCookie(GCOOKIE_NAME)\n let kId\n if (k == null) {\n k = {}\n kId = ids\n } else {\n /* check if already exists */\n kId = k.id\n let anonymousUser = false\n let foundInCache = false\n if (kId == null) {\n kId = ids[0]\n anonymousUser = true\n }\n if ($ct.LRU_CACHE == null && StorageManager._isLocalStorageSupported()) {\n $ct.LRU_CACHE = new LRUCache(LRU_CACHE_SIZE)\n }\n\n if (anonymousUser) {\n if ((g) != null) {\n // if have gcookie\n $ct.LRU_CACHE.set(kId, g)\n $ct.blockRequest = false\n }\n } else {\n // check if the id is present in the cache\n // set foundInCache to true\n for (const idx in ids) {\n if (ids.hasOwnProperty(idx)) {\n const id = ids[idx]\n if ($ct.LRU_CACHE.cache[id]) {\n kId = id\n foundInCache = true\n break\n }\n }\n }\n }\n\n if (foundInCache) {\n if (kId !== $ct.LRU_CACHE.getLastKey()) {\n // New User found\n // remove the entire cache\n this.#handleCookieFromCache()\n } else {\n sendOULFlag = false\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, sendOULFlag)\n }\n const gFromCache = $ct.LRU_CACHE.get(kId)\n $ct.LRU_CACHE.set(kId, gFromCache)\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, gFromCache)\n this.#device.gcookie = gFromCache\n\n const lastK = $ct.LRU_CACHE.getSecondLastKey()\n if (StorageManager.readFromLSorCookie(FIRE_PUSH_UNREGISTERED) && lastK !== -1) {\n // CACHED OLD USER FOUND. TRANSFER PUSH TOKEN TO THIS USER\n const lastGUID = $ct.LRU_CACHE.cache[lastK]\n this.#request.unregisterTokenForGuid(lastGUID)\n }\n } else {\n if (!anonymousUser) {\n this.clear()\n } else {\n if ((g) != null) {\n this.#device.gcookie = g\n StorageManager.saveToLSorCookie(GCOOKIE_NAME, g)\n sendOULFlag = false\n }\n }\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n kId = ids[0]\n }\n }\n k.id = kId\n StorageManager.saveToLSorCookie(KCOOKIE_NAME, k)\n }\n\n if (Array.isArray(profileArr) && profileArr.length > 0) {\n for (const index in profileArr) {\n if (profileArr.hasOwnProperty(index)) {\n const outerObj = profileArr[index]\n let data = {}\n let profileObj\n if (outerObj.Site != null) { // organic data from the site\n profileObj = outerObj.Site\n if (isObjectEmpty(profileObj) || !isProfileValid(profileObj, {\n logger: this.#logger\n })) {\n return\n }\n } else if (outerObj.Facebook != null) { // fb connect data\n const FbProfileObj = outerObj.Facebook\n // make sure that the object contains any data at all\n\n if (!isObjectEmpty(FbProfileObj) && (!FbProfileObj.error)) {\n profileObj = processFBUserObj(FbProfileObj)\n }\n } else if (outerObj['Google Plus'] != null) {\n const GPlusProfileObj = outerObj['Google Plus']\n if (isObjectEmpty(GPlusProfileObj) && (!GPlusProfileObj.error)) {\n profileObj = processGPlusUserObj(GPlusProfileObj, { logger: this.#logger })\n }\n }\n if (profileObj != null && (!isObjectEmpty(profileObj))) { // profile got set from above\n data.type = 'profile'\n if (profileObj.tz == null) {\n // try to auto capture user timezone if not present\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n\n data.profile = profileObj\n const ids = []\n if (StorageManager._isLocalStorageSupported()) {\n if (profileObj.Identity) {\n ids.push(profileObj.Identity)\n }\n if (profileObj.Email) {\n ids.push(profileObj.Email)\n }\n if (profileObj.GPID) {\n ids.push('GP:' + profileObj.GPID)\n }\n if (profileObj.FBID) {\n ids.push('FB:' + profileObj.FBID)\n }\n if (ids.length > 0) {\n addToK(ids)\n }\n }\n addToLocalProfileMap(profileObj, true)\n data = this.#request.addSystemDataToObject(data, undefined)\n\n this.#request.addFlags(data)\n // Adding 'isOUL' flag in true for OUL cases which.\n // This flag tells LC to create a new arp object.\n // Also we will receive the same flag in response arp which tells to delete existing arp object.\n if (sendOULFlag) {\n data[IS_OUL] = true\n }\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n // Whenever sendOULFlag is true then dont send arp and gcookie (guid in memory in the request)\n // Also when this flag is set we will get another flag from LC in arp which tells us to delete arp\n // stored in the cache and replace it with the response arp.\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, sendOULFlag)\n }\n }\n }\n }\n }\n\n clear () {\n this.#logger.debug('clear called. Reset flag has been set.')\n this.#deleteUser()\n StorageManager.setMetaProp(CLEAR, true)\n }\n\n #handleCookieFromCache () {\n $ct.blockRequest = false\n console.debug('Block request is false')\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#session.setSessionCookieObject('')\n }\n\n #deleteUser () {\n $ct.blockRequest = true\n this.#logger.debug('Block request is true')\n $ct.globalCache = {\n gcookie: null,\n REQ_N: 0,\n RESP_N: 0\n }\n if (StorageManager._isLocalStorageSupported()) {\n delete localStorage[GCOOKIE_NAME]\n delete localStorage[KCOOKIE_NAME]\n delete localStorage[PR_COOKIE]\n delete localStorage[EV_COOKIE]\n delete localStorage[META_COOKIE]\n delete localStorage[ARP_COOKIE]\n delete localStorage[CAMP_COOKIE_NAME]\n delete localStorage[CHARGEDID_COOKIE_NAME]\n }\n StorageManager.removeCookie(GCOOKIE_NAME, $ct.broadDomain)\n StorageManager.removeCookie(CAMP_COOKIE_NAME, getHostName())\n StorageManager.removeCookie(KCOOKIE_NAME, getHostName())\n StorageManager.removeCookie(this.#session.cookieName, $ct.broadDomain)\n StorageManager.removeCookie(ARP_COOKIE, $ct.broadDomain)\n this.#device.gcookie = null\n this.#session.setSessionCookieObject('')\n }\n\n #processLoginArray (loginArr) {\n if (Array.isArray(loginArr) && loginArr.length > 0) {\n const profileObj = loginArr.pop()\n const processProfile = profileObj != null && isObject(profileObj) &&\n ((profileObj.Site != null && Object.keys(profileObj.Site).length > 0) ||\n (profileObj.Facebook != null && Object.keys(profileObj.Facebook).length > 0) ||\n (profileObj['Google Plus'] != null && Object.keys(profileObj['Google Plus']).length > 0))\n if (processProfile) {\n StorageManager.setInstantDeleteFlagInK()\n try {\n this.#processOUL([profileObj])\n } catch (e) {\n this.#logger.debug(e)\n }\n } else {\n this.#logger.error('Profile object is in incorrect format')\n }\n }\n }\n\n push (...profilesArr) {\n this.#processLoginArray(profilesArr)\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processLoginArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n}\n","import {\n getCampaignObject,\n saveCampaignObject\n} from '../clevertap'\nimport { StorageManager } from '../storage'\n\nexport class CTWebPopupImageOnly extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _target = null\n _session = null\n shadow = null\n popup = null\n container = null\n resizeObserver = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderImageOnlyPopup()\n }\n }\n\n get session () {\n return this._session || ''\n }\n\n set session (val) {\n this._session = val\n }\n\n get msgId () {\n return this.target.wzrk_id\n }\n\n get pivotId () {\n return this.target.wzrk_pivot\n }\n\n get onClickUrl () {\n return this.target.display.onClickUrl\n }\n\n renderImageOnlyPopup () {\n const campaignId = this.target.wzrk_id.split('_')[0]\n const currentSessionId = this.session.sessionId\n\n this.shadow.innerHTML = this.getImageOnlyPopupContent()\n this.popup = this.shadowRoot.getElementById('imageOnlyPopup')\n this.container = this.shadowRoot.getElementById('container')\n this.closeIcon = this.shadowRoot.getElementById('close')\n\n this.popup.addEventListener('load', this.updateImageAndContainerWidth())\n this.resizeObserver = new ResizeObserver(() => this.handleResize(this.popup, this.container))\n this.resizeObserver.observe(this.popup)\n\n this.closeIcon.addEventListener('click', () => {\n this.resizeObserver.unobserve(this.popup)\n document.getElementById('wzrkImageOnlyDiv').style.display = 'none'\n this.remove()\n if (campaignId != null && campaignId !== '-1') {\n if (StorageManager._isLocalStorageSupported()) {\n const campaignObj = getCampaignObject()\n\n let sessionCampaignObj = campaignObj.wp[currentSessionId]\n if (sessionCampaignObj == null) {\n sessionCampaignObj = {}\n campaignObj[currentSessionId] = sessionCampaignObj\n }\n sessionCampaignObj[campaignId] = 'dnd'\n saveCampaignObject(campaignObj)\n }\n }\n })\n\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n\n if (this.onClickUrl) {\n this.popup.addEventListener('click', () => {\n this.target.display.window ? window.open(this.onClickUrl, '_blank') : window.parent.location.href = this.onClickUrl\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n }\n\n handleResize (popup, container) {\n const width = this.getRenderedImageWidth(popup)\n container.style.setProperty('width', `${width}px`)\n }\n\n getImageOnlyPopupContent () {\n return `\n ${this.target.msgContent.css}\n ${this.target.msgContent.html}\n `\n }\n\n updateImageAndContainerWidth () {\n return () => {\n const width = this.getRenderedImageWidth(this.popup)\n this.popup.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('width', `${width}px`)\n this.container.style.setProperty('height', 'auto')\n this.container.style.setProperty('position', 'fixed')\n this.popup.style.setProperty('visibility', 'visible')\n this.closeIcon.style.setProperty('visibility', 'visible')\n document.getElementById('wzrkImageOnlyDiv').style.visibility = 'visible'\n }\n }\n\n getRenderedImageWidth (img) {\n const ratio = img.naturalWidth / img.naturalHeight\n return img.height * ratio\n }\n}\n","import { determineTimeStampText, greenTickSvg } from './helper'\nexport class Message extends HTMLElement {\n constructor (config, message) {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n this.config = config\n this.message = message\n this.renderMessage(message)\n }\n\n wrapper = null\n snackBar = null\n\n get pivotId () {\n return this.message.wzrk_pivot\n }\n\n get campaignId () {\n return this.message.wzrk_id\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n renderMessage (msg) {\n this.wrapper = this.createEl('div', 'messageWrapper')\n\n switch (msg.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n const message = this.prepareBasicMessage(msg.msg[0])\n this.wrapper.appendChild(message)\n }\n }\n\n const timeStamp = this.createEl('div', 'timeStamp')\n timeStamp.innerHTML = `${determineTimeStampText(msg.id.split('_')[1])}`\n if (!msg.viewed) {\n const unreadMarker = this.createEl('span', 'unreadMarker')\n timeStamp.appendChild(unreadMarker)\n }\n\n this.wrapper.appendChild(timeStamp)\n this.shadow.appendChild(this.wrapper)\n }\n\n prepareBasicMessage (msg) {\n const message = this.createEl('div', 'message')\n\n if (msg.imageUrl) {\n const imageContainer = this.addImage(msg.imageUrl, 'mainImg')\n message.appendChild(imageContainer)\n }\n const iconTitleDescWrapper = this.createEl('div', 'iconTitleDescWrapper')\n if (msg.iconUrl) {\n const iconContainer = this.addImage(msg.iconUrl, 'iconImg')\n iconTitleDescWrapper.appendChild(iconContainer)\n }\n const titleDescWrapper = this.createEl('div', 'titleDescWrapper')\n if (msg.title) {\n const title = this.createEl('div', 'title')\n title.innerText = msg.title\n titleDescWrapper.appendChild(title)\n }\n if (msg.description) {\n const description = this.createEl('div', 'description')\n description.innerText = msg.description\n titleDescWrapper.appendChild(description)\n }\n if (msg.title || msg.description) {\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n }\n\n if (msg.iconUrl || msg.title || msg.description) {\n message.appendChild(iconTitleDescWrapper)\n }\n if (msg.buttons && msg.buttons.length) {\n const buttonsContainer = this.addButtons(msg.buttons)\n message.appendChild(buttonsContainer)\n }\n return message\n }\n\n addButtons (buttons = []) {\n const buttonsContainer = this.createEl('div', 'buttonsContainer')\n let hasCopyAction = false\n buttons.forEach((b, i) => {\n const button = this.createEl('button', `button-${i}`, 'button')\n button.innerText = b.text\n if (i > 0) {\n button.style.cssText += 'margin-left: 2px;'\n }\n if (b.action === 'copy') {\n hasCopyAction = true\n }\n buttonsContainer.appendChild(button)\n })\n if (hasCopyAction) {\n this.addSnackbar(buttonsContainer)\n }\n return buttonsContainer\n }\n\n addSnackbar (buttonsContainer) {\n this.snackBar = this.createEl('div', `snackbar-${this.campaignId}`, 'snackbar')\n this.snackBar.innerHTML = greenTickSvg\n const clipboardMsg = this.createEl('span', `snackbar-msg-${this.campaignId}`, 'snackbar-msg')\n clipboardMsg.innerText = 'Copied to clipboard'\n this.snackBar.appendChild(clipboardMsg)\n buttonsContainer.appendChild(this.snackBar)\n }\n\n addImage (url, type) {\n const imageContainer = this.createEl('div', `${type}Container`)\n const image = this.createEl('img', type)\n image.setAttribute('src', url)\n // images will be fetched as and when the element comes into the viewport\n image.setAttribute('loading', 'lazy')\n imageContainer.appendChild(image)\n return imageContainer\n }\n\n raiseClickedEvent (path, isPreview) {\n switch (this.message.templateType) {\n case 'text-only':\n case 'text-with-icon':\n case 'text-with-icon-and-image': {\n this.raiseClickedForBasicTemplates(path, isPreview)\n }\n }\n }\n\n raiseClickedForBasicTemplates (path, isPreview) {\n const msg = this.message.msg[0]\n const payload = { msgId: this.campaignId, pivotId: this.pivotId }\n if (path.tagName === 'BUTTON') {\n const id = path.id.split('-')[1]\n const button = msg.buttons[id]\n payload.kv = {\n wzrk_c2a: button.text\n }\n if (button.action === 'url') {\n button.openUrlInNewTab ? window.open(button.url, '_blank') : (window.location = button.url)\n } else if (button.action === 'copy') {\n window.focus()\n navigator.clipboard.writeText(button.clipboardText)\n this.snackBar.style.setProperty('display', 'flex', 'important')\n setTimeout(() => {\n this.snackBar.style.setProperty('display', 'none', 'important')\n }, 2000)\n }\n } else if (path.tagName === 'CT-INBOX-MESSAGE' && msg.onClickUrl) {\n msg.openUrlInNewTab ? window.open(msg.onClickUrl, '_blank') : (window.location = msg.onClickUrl)\n }\n if (isPreview) {\n console.log('Notifiction clicked event will be raised at run time with payload ::', payload)\n } else {\n window.clevertap.renderNotificationClicked(payload)\n }\n }\n}\n","export const messageStyles = ({ backgroundColor, borderColor, titleColor, descriptionColor, buttonColor, buttonTextColor, unreadMarkerColor }) => {\n return `\n \n `\n}\n\nexport const inboxContainerStyles = ({\n panelBackgroundColor,\n panelBorderColor,\n headerBackgroundColor,\n headerTitleColor,\n closeIconColor,\n categoriesTabColor,\n categoriesTitleColor,\n categoriesBorderColor,\n selectedCategoryTabColor,\n selectedCategoryTitleColor,\n selectedCategoryBorderColor,\n headerCategoryHeight\n}) => {\n return `\n \n `\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Message } from './Message'\nimport { inboxContainerStyles, messageStyles } from './inboxStyles'\nimport { getInboxPosition, determineTimeStampText, arrowSvg, getInboxMessages, saveInboxMessages } from './helper'\nimport { WEBINBOX_CONFIG, MAX_INBOX_MSG } from '../../util/constants'\n\nexport class Inbox extends HTMLElement {\n constructor (logger) {\n super()\n this.logger = logger\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n isInboxOpen = false\n isInboxFromFlutter = false\n selectedCategory = null\n unviewedMessages = {}\n unviewedCounter = 0\n isPreview = false\n inboxConfigForPreview = {}\n\n // dom references\n inboxSelector = null\n inbox = null\n emptyInboxMsg = null\n inboxCard = null\n unviewedBadge = null\n observer = null\n selectedCategoryRef = null\n\n get incomingMessages () {\n return []\n }\n\n set incomingMessages (msgs = []) {\n if (msgs.length > 0 && this.inbox) {\n this.updateInboxMessages(msgs)\n }\n }\n\n get incomingMessagesForPreview () {\n return []\n }\n\n set incomingMessagesForPreview (msgs = []) {\n const previewMsgs = {}\n if (msgs.length > 0 && this.inbox) {\n this.isPreview = true\n this.unviewedCounter = 0\n msgs.forEach((m) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n previewMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n this.buildUIForMessages(previewMsgs)\n this.updateUnviewedBadgeCounter()\n }\n }\n\n connectedCallback () {\n this.init()\n }\n\n init () {\n this.config = this.isPreview ? this.inboxConfigForPreview : StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (Object.keys(this.config).length === 0) {\n return\n }\n this.inboxSelector = document.getElementById(this.config.inboxSelector)\n if (this.inboxSelector === null) {\n return\n }\n\n if (this.config.styles.notificationsBadge) {\n this.addUnviewedBadge()\n } else if (this.unviewedBadge) {\n this.unviewedBadge.remove()\n }\n\n this.createinbox()\n\n /**\n * We need to remove the listener as there could be a scenario where init would be called when\n * we get updated web inbox settings from LC after the inbox has been initialised.\n * It can so happen that the inbox-selector would have changed.\n */\n document.removeEventListener('click', this.addClickListenerOnDocument)\n document.addEventListener('click', this.addClickListenerOnDocument)\n this.config.categories.length && this.updateActiveCategory(this.selectedCategoryRef.innerText)\n\n this.shadow.innerHTML = this.getInboxStyles()\n this.shadow.appendChild(this.inbox)\n }\n\n addMsgsToInboxFromLS () {\n const messages = this.deleteExpiredAndGetUnexpiredMsgs(false)\n const msgIds = messages ? Object.keys(messages) : []\n if (msgIds.length === 0) {\n return\n }\n msgIds.forEach((m) => {\n if (!messages[m].viewed) {\n this.unviewedMessages[m] = messages[m]\n this.unviewedCounter++\n }\n })\n this.buildUIForMessages(messages)\n this.updateUnviewedBadgeCounter()\n }\n\n /**\n * @param {*} deleteMsgsFromUI - If this param is true, then we'll have to check the UI and delete expired messages from the DOM\n * It'll be false when you are building the inbox layout for the very first time.\n *\n * This method reads the inbox messages from LS,\n * based on the deleteMsgsFromUI flag deletes the expired messages from UI and decrements the unviewed counter if the message was not viewed,\n * sorts the messages based on the date,\n * saves the unexpired messages to LS\n * and returns the sorted unexpired messages\n *\n * Scenarios when we encounter expired messages -\n * 1. building ui for the 1st time, no need to decrement the unviewed counter as the correct count will be set at the time of rendering\n * 2. UI is already built (deleteMsgsFromUI = true) and you open the inbox\n * a. You'll find the expired msg in inbox\n * b. You'll not find the expired msg in inbox.\n * This happens when we receive new messages from LC, increment unviewed counter, save it in LS. (We build the UI only when the user opens inbox.)\n * In both the above scenarios, we'll still have to decrement the unviewed counter if the message was not viewed.\n */\n deleteExpiredAndGetUnexpiredMsgs (deleteMsgsFromUI = true) {\n let messages = getInboxMessages()\n\n const now = Math.floor(Date.now() / 1000)\n for (const msg in messages) {\n if (messages[msg].wzrk_ttl && messages[msg].wzrk_ttl > 0 && messages[msg].wzrk_ttl < now) {\n if (deleteMsgsFromUI) {\n const el = this.shadowRoot.getElementById(messages[msg].id)\n el && el.remove()\n if (!messages[msg].viewed) {\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n }\n }\n delete messages[msg]\n }\n }\n if (messages && messages.length > 0) {\n messages = Object.values(messages).sort((a, b) => b.date - a.date).reduce((acc, m) => { acc[m.id] = m; return acc }, {})\n }\n saveInboxMessages(messages)\n return messages\n }\n\n updateInboxMessages (msgs = []) {\n const inboxMsgs = this.deleteExpiredAndGetUnexpiredMsgs()\n const date = Date.now()\n const incomingMsgs = {}\n msgs.forEach((m, i) => {\n const key = `${m.wzrk_id.split('_')[0]}_${Date.now()}`\n m.id = key\n // We are doing this to preserve the order of the messages\n m.date = date - i\n m.viewed = 0\n inboxMsgs[key] = m\n incomingMsgs[key] = m\n this.unviewedMessages[key] = m\n this.unviewedCounter++\n })\n saveInboxMessages(inboxMsgs)\n this.buildUIForMessages(incomingMsgs)\n this.updateUnviewedBadgeCounter()\n }\n\n createEl (type, id, part) {\n const _el = document.createElement(type)\n _el.setAttribute('id', id)\n _el.setAttribute('part', part || id)\n return _el\n }\n\n addUnviewedBadge () {\n if (!this.unviewedBadge) {\n this.unviewedBadge = this.createEl('div', 'unviewedBadge')\n // As this unviewedBadge element will be directly added to the DOM, we are defining inline styles\n this.unviewedBadge.style.cssText = `display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ${this.config.styles.notificationsBadge.backgroundColor}; font-size: 12px; color: ${this.config.styles.notificationsBadge.textColor}; font-weight: bold; align-items: center; justify-content: center;`\n document.body.appendChild(this.unviewedBadge)\n }\n this.updateUnviewedBadgePosition()\n\n // called when user switches b/w portrait and landscape mode.\n window.addEventListener('resize', () => {\n this.updateUnviewedBadgePosition()\n })\n }\n\n updateUnviewedBadgePosition () {\n const { top, right } = this.inboxSelector.getBoundingClientRect()\n this.unviewedBadge.style.top = `${top - 8}px`\n this.unviewedBadge.style.left = `${right - 8}px`\n }\n\n createinbox () {\n this.inbox = this.createEl('div', 'inbox')\n const header = this.createEl('div', 'header')\n\n const headerTitle = this.createEl('div', 'headerTitle')\n headerTitle.innerText = this.config.title\n\n const closeIcon = this.createEl('div', 'closeInbox')\n closeIcon.innerHTML = '×'\n\n header.appendChild(headerTitle)\n header.appendChild(closeIcon)\n this.inbox.appendChild(header)\n if (this.config.categories.length) {\n const categories = this.createCategories()\n this.inbox.appendChild(categories)\n }\n this.inboxCard = this.createEl('div', 'inboxCard')\n this.inbox.appendChild(this.inboxCard)\n\n this.emptyInboxMsg = this.createEl('div', 'emptyInboxMsg')\n this.emptyInboxMsg.innerText = 'All messages will be displayed here.'\n this.inboxCard.appendChild(this.emptyInboxMsg)\n\n // Intersection observer for notification viewed\n const options = {\n root: this.inboxCard,\n rootMargin: '0px',\n threshold: 0.5\n }\n this.observer = new IntersectionObserver((entries, observer) => { this.handleMessageViewed(entries) }, options)\n\n this.addMsgsToInboxFromLS()\n }\n\n createCategories () {\n const categoriesContainer = this.createEl('div', 'categoriesContainer')\n\n const leftArrow = this.createEl('div', 'leftArrow')\n leftArrow.innerHTML = arrowSvg\n leftArrow.children[0].style = 'transform: rotate(180deg)'\n leftArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(-70, 0)\n })\n categoriesContainer.appendChild(leftArrow)\n\n const categoriesWrapper = this.createEl('div', 'categoriesWrapper')\n const _categories = ['All', ...this.config.categories]\n _categories.forEach((c, i) => {\n const category = this.createEl('div', `category-${i}`, 'category')\n category.innerText = c\n if (i === 0) {\n this.selectedCategoryRef = category\n }\n categoriesWrapper.appendChild(category)\n })\n categoriesContainer.appendChild(categoriesWrapper)\n\n const rightArrow = this.createEl('div', 'rightArrow')\n rightArrow.innerHTML = arrowSvg\n rightArrow.addEventListener('click', () => {\n this.shadowRoot.getElementById('categoriesWrapper').scrollBy(70, 0)\n })\n categoriesContainer.appendChild(rightArrow)\n\n const options = { root: categoriesContainer, threshold: 0.9 }\n const firstCategory = categoriesWrapper.children[0]\n const lastCategory = categoriesWrapper.children[this.config.categories.length]\n\n const firstCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(leftArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n firstCategoryObserver.observe(firstCategory)\n\n const lastCategoryObserver = new IntersectionObserver((e) => {\n this.categoryObserverCb(rightArrow, e[0].intersectionRatio >= 0.9)\n }, options)\n lastCategoryObserver.observe(lastCategory)\n\n return categoriesContainer\n }\n\n categoryObserverCb (el, hide) {\n if (!el) {\n return\n }\n el.style.display = hide ? 'none' : 'flex'\n }\n\n updateActiveCategory (activeCategory) {\n this.selectedCategory = activeCategory\n\n this.inboxCard.scrollTop = 0\n let counter = 0\n\n this.prevCategoryRef && this.prevCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef.setAttribute('selected', 'true')\n\n this.inboxCard.childNodes.forEach(c => {\n if (c.getAttribute('id') !== 'emptyInboxMsg') {\n c.style.display = (this.selectedCategory === 'All' || c.getAttribute('category') === this.selectedCategory) ? 'block' : 'none'\n if (c.style.display === 'block') {\n counter++\n }\n }\n })\n if (counter === 0) {\n this.emptyInboxMsg.innerText = `${activeCategory} messages will be displayed here.`\n this.emptyInboxMsg.style.display = 'block'\n } else {\n this.emptyInboxMsg.style.display = 'none'\n }\n }\n\n buildUIForMessages (messages = {}) {\n !this.isPreview && this.updateTSForRenderedMsgs()\n this.inboxCard.scrollTop = 0\n const maxMsgsInInbox = this.config.maxMsgsInInbox ?? MAX_INBOX_MSG\n const firstChild = this.inboxCard.firstChild\n\n const sortedMsgs = Object.values(messages).sort((a, b) => b.date - a.date).map((m) => m.id)\n for (const m of sortedMsgs) {\n const item = new Message(this.config, messages[m])\n item.setAttribute('id', messages[m].id)\n item.setAttribute('pivot', messages[m].wzrk_pivot)\n item.setAttribute('part', 'ct-inbox-message')\n if (this.config.categories.length > 0) {\n item.setAttribute('category', messages[m].tags[0] || '')\n item.style.display = (this.selectedCategory === 'All' || messages[m].category === this.selectedCategory) ? 'block' : 'none'\n } else {\n item.style.display = 'block'\n }\n this.inboxCard.insertBefore(item, firstChild)\n this.observer.observe(item)\n }\n\n let msgTotalCount = this.inboxCard.querySelectorAll('ct-inbox-message').length\n while (msgTotalCount > maxMsgsInInbox) {\n const ctInboxMsgs = this.inboxCard.querySelectorAll('ct-inbox-message')\n if (ctInboxMsgs.length > 0) { ctInboxMsgs[ctInboxMsgs.length - 1].remove() }\n msgTotalCount--\n }\n const hasMessages = this.inboxCard.querySelectorAll('ct-inbox-message[style*=\"display: block\"]').length\n this.emptyInboxMsg.style.display = hasMessages ? 'none' : 'block'\n }\n\n /**\n * Adds a click listener on the document. For every click we check\n * 1. if the click has happenned within the inbox\n * - on close button, we close the inbox\n * - on any of the category, we set that as the activeCategory\n * - on any of the message, we mark raise notification clicked event. To identify the clicks on a button, we have p.id.startsWith('button-')\n * 2. if the user has clicked on the inboxSelector, we toggle inbox\n * 3. if the click is anywhere else on the UI and the inbox is open, we simply close it\n */\n\n addClickListenerOnDocument = (() => {\n return (e) => {\n if (e.composedPath().includes(this.inbox)) {\n // path is not supported on FF. So we fallback to e.composedPath\n const path = e.path || (e.composedPath && e.composedPath())\n if (path.length) {\n const id = path[0].id\n if (id === 'closeInbox') {\n this.toggleInbox()\n } else if (id.startsWith('category-')) {\n this.prevCategoryRef = this.selectedCategoryRef\n this.selectedCategoryRef = path[0]\n this.updateActiveCategory(path[0].innerText)\n } else {\n const _path = path.filter((p) => p.id?.startsWith('button-') || p.tagName === 'CT-INBOX-MESSAGE')\n if (_path.length) {\n const messageEl = _path[_path.length - 1]\n messageEl.raiseClickedEvent(_path[0], this.isPreview)\n }\n }\n }\n } else if (this.inboxSelector.contains(e.target) || this.isInboxOpen) {\n if (this.isInboxFromFlutter) {\n this.isInboxFromFlutter = false\n } else {\n this.toggleInbox(e)\n }\n }\n }\n })()\n\n /**\n * This function will be called every time when a message comes into the inbox viewport and it's visibility increases to 50% or drops below 50%\n * If a msg is 50% visible in the UI, we need to mark the message as viewed in LS and raise notification viewed event\n */\n handleMessageViewed (entries) {\n const raiseViewedEvent = !this.isPreview\n if (this.isInboxOpen) {\n entries.forEach((e) => {\n if (e.isIntersecting && this.unviewedMessages.hasOwnProperty(e.target.id) && e.target.message.viewed === 0) {\n e.target.message.viewed = 1\n if (raiseViewedEvent) {\n window.clevertap.renderNotificationViewed({ msgId: e.target.campaignId, pivotId: e.target.pivotId })\n this.updateMessageInLS(e.target.id, { ...e.target.message, viewed: 1 })\n setTimeout(() => {\n e.target.shadowRoot.getElementById('unreadMarker').style.display = 'none'\n }, 1000)\n } else {\n console.log('Notifiction viewed event will be raised at run time with payload ::', { msgId: e.target.campaignId, pivotId: e.target.pivotId })\n }\n this.unviewedCounter--\n this.updateUnviewedBadgeCounter()\n delete this.unviewedMessages[e.target.id]\n }\n })\n }\n }\n\n updateMessageInLS (key, value) {\n if (!this.isPreview) {\n const messages = getInboxMessages()\n messages[key] = value\n saveInboxMessages(messages)\n }\n }\n\n // create a separte fn fro refactoring\n toggleInbox (e) {\n this.isInboxOpen = !this.isInboxOpen\n this.isInboxFromFlutter = !!e?.rect\n if (this.isInboxOpen) {\n this.inboxCard.scrollTop = 0\n !this.isPreview && this.deleteExpiredAndGetUnexpiredMsgs()\n this.inbox.style.display = 'block'\n this.inbox.style.zIndex = '2147483647' // zIndex should be max for the inbox to be rendered on top of all elements\n if (this.config.categories.length) {\n this.selectedCategoryRef.setAttribute('selected', 'false')\n this.selectedCategoryRef = this.shadowRoot.getElementById('category-0')\n this.updateActiveCategory(this.selectedCategoryRef.innerText)\n this.shadowRoot.getElementById('categoriesWrapper').scrollLeft -= this.shadowRoot.getElementById('categoriesWrapper').scrollWidth\n }\n this.setInboxPosition(e)\n } else {\n this.inbox.style.display = 'none'\n }\n }\n\n setInboxPosition (e) {\n const windowWidth = window.outerWidth\n const customInboxStyles = getComputedStyle($ct.inbox)\n const top = customInboxStyles.getPropertyValue('--inbox-top')\n const bottom = customInboxStyles.getPropertyValue('--inbox-bottom')\n const left = customInboxStyles.getPropertyValue('--inbox-left')\n const right = customInboxStyles.getPropertyValue('--inbox-right')\n const hasPositionDefined = top || bottom || left || right\n if (windowWidth > 481 && !hasPositionDefined) {\n const res = getInboxPosition(e, this.inbox.clientHeight, this.inbox.clientWidth)\n const xPos = res.xPos\n const yPos = res.yPos\n this.inbox.style.top = yPos + 'px'\n this.inbox.style.left = xPos + 'px'\n }\n }\n\n /**\n * Updates the UI with the number of unviewed messages\n * If there are more than 9 unviewed messages, we show the count as 9+\n */\n\n setBadgeStyle = (msgCount) => {\n if (this.unviewedBadge !== null) {\n this.unviewedBadge.innerText = msgCount > 9 ? '9+' : msgCount\n this.unviewedBadge.style.display = msgCount > 0 ? 'flex' : 'none'\n }\n }\n\n updateUnviewedBadgeCounter () {\n if (this.isPreview) {\n this.setBadgeStyle(this.unviewedCounter)\n return\n }\n let counter = 0\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const messages = getInboxMessages()\n if (messages[m.id] && messages[m.id].viewed === 0) {\n counter++\n }\n })\n this.setBadgeStyle(counter)\n }\n\n updateTSForRenderedMsgs () {\n this.inboxCard.querySelectorAll('ct-inbox-message').forEach((m) => {\n const ts = m.id.split('_')[1]\n m.shadow.getElementById('timeStamp').firstChild.innerText = determineTimeStampText(ts)\n })\n }\n\n getInboxStyles () {\n const headerHeight = 36\n const categoriesHeight = this.config.categories.length ? 64 : 16\n\n const styles = {\n panelBackgroundColor: this.config.styles.panelBackgroundColor,\n panelBorderColor: this.config.styles.panelBorderColor,\n headerBackgroundColor: this.config.styles.header.backgroundColor,\n headerTitleColor: this.config.styles.header.titleColor,\n closeIconColor: this.config.styles.closeIconColor,\n categoriesTabColor: this.config.styles.categories.tabColor,\n categoriesTitleColor: this.config.styles.categories.titleColor,\n selectedCategoryTabColor: this.config.styles.categories.selectedTab.tabColor,\n selectedCategoryTitleColor: this.config.styles.categories.selectedTab.titleColor,\n headerCategoryHeight: headerHeight + categoriesHeight\n }\n if (this.config.styles.categories.borderColor) {\n styles.categoriesBorderColor = this.config.styles.categories.borderColor\n }\n if (this.config.styles.categories.selectedTab.borderColor) {\n styles.selectedCategoryBorderColor = this.config.styles.categories.selectedTab.borderColor\n }\n\n const inboxStyles = inboxContainerStyles(styles)\n\n const cardStyles = this.config.styles.cards\n const msgStyles = messageStyles({\n backgroundColor: cardStyles.backgroundColor,\n borderColor: cardStyles.borderColor,\n titleColor: cardStyles.titleColor,\n descriptionColor: cardStyles.descriptionColor,\n buttonColor: cardStyles.buttonColor,\n buttonTextColor: cardStyles.buttonTextColor,\n unreadMarkerColor: cardStyles.unreadMarkerColor\n })\n\n return inboxStyles + msgStyles\n }\n}\n","import { StorageManager, $ct } from '../../util/storage'\nimport { Inbox } from './WebInbox'\nimport { Message } from './Message'\nimport { WEBINBOX_CONFIG, GCOOKIE_NAME, WEBINBOX } from '../../util/constants'\nimport { isValueValid } from '../../util/datatypes'\n\nexport const processWebInboxSettings = (webInboxSetting, isPreview = false) => {\n const _settings = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n if (isPreview) {\n $ct.inbox.inboxConfigForPreview = webInboxSetting\n $ct.inbox.isPreview = true\n $ct.inbox && $ct.inbox.init()\n } else if (JSON.stringify(_settings) !== JSON.stringify(webInboxSetting)) {\n StorageManager.saveToLSorCookie(WEBINBOX_CONFIG, webInboxSetting)\n $ct.inbox && $ct.inbox.init()\n }\n}\n\nexport const processInboxNotifs = (msg) => {\n if (msg.inbox_preview) {\n $ct.inbox.incomingMessagesForPreview = msg.inbox_notifs\n } else {\n $ct.inbox.incomingMessages = msg\n }\n}\n\nexport const processWebInboxResponse = (msg) => {\n if (msg.webInboxSetting) {\n processWebInboxSettings(msg.webInboxSetting, msg.inbox_preview)\n }\n if (msg.inbox_notifs != null) {\n processInboxNotifs(msg)\n }\n}\n\nexport const addWebInbox = (logger) => {\n checkAndRegisterWebInboxElements()\n $ct.inbox = new Inbox({ logger })\n document.body.appendChild($ct.inbox)\n}\n\nconst getAndMigrateInboxMessages = (guid) => {\n const messages = StorageManager.readFromLSorCookie(WEBINBOX) || {}\n // Doing this to migrate message to guid level\n if (Object.keys(messages).length > 0 && Object.keys(messages)[0].includes('_')) {\n const gudInboxObj = {}\n gudInboxObj[guid] = messages\n StorageManager.saveToLSorCookie(WEBINBOX, gudInboxObj)\n return gudInboxObj\n }\n return messages\n}\n\nexport const getInboxMessages = () => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return {} }\n const messages = getAndMigrateInboxMessages(guid)\n\n return messages.hasOwnProperty(guid) ? messages[guid] : {}\n}\n\nexport const saveInboxMessages = (messages) => {\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (!isValueValid(guid)) { return }\n const storedInboxObj = getAndMigrateInboxMessages(guid)\n\n const newObj = { ...storedInboxObj, [guid]: messages }\n StorageManager.saveToLSorCookie(WEBINBOX, newObj)\n}\n\nexport const initializeWebInbox = (logger) => {\n return new Promise((resolve, reject) => {\n if (document.readyState === 'complete') {\n addWebInbox(logger)\n resolve()\n } else {\n const config = StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}\n const onLoaded = () => {\n /**\n * We need this null check here because $ct.inbox could be initialised via init method too on document load.\n * In that case we don't need to call addWebInbox method\n */\n if ($ct.inbox === null) {\n addWebInbox(logger)\n }\n resolve()\n }\n window.addEventListener('load', () => {\n /**\n * Scripts can be loaded layzily, we may not get element from dom as it may not be mounted yet\n * We will to check element for 10 seconds and give up\n */\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n } else {\n // check for element for next 10 seconds\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n if (document.getElementById(config.inboxSelector)) {\n onLoaded()\n clearInterval(t)\n resolve()\n } else if (count >= 20) {\n clearInterval(t)\n logger.debug('Failed to add inbox')\n }\n count++\n }, 500)\n }\n }\n })\n }\n })\n}\n\nexport const checkAndRegisterWebInboxElements = () => {\n if (customElements.get('ct-web-inbox') === undefined) {\n customElements.define('ct-web-inbox', Inbox)\n customElements.define('ct-inbox-message', Message)\n }\n}\n\nexport const getInboxPosition = (e, inboxHeight, inboxWidth) => {\n const horizontalScroll = document.scrollingElement.scrollLeft\n const verticalScroll = document.scrollingElement.scrollTop\n const windowWidth = window.innerWidth + horizontalScroll\n const windowHeight = window.innerHeight + verticalScroll\n const selectorRect = e.rect || e.target.getBoundingClientRect()\n const selectorX = selectorRect.x + horizontalScroll\n const selectorY = selectorRect.y + verticalScroll\n const selectorLeft = selectorRect.left + horizontalScroll\n const selectorRight = selectorRect.right + horizontalScroll\n const selectorTop = selectorRect.top + verticalScroll\n // const selectorBottom = selectorRect.bottom + verticalScroll\n const selectorBottom = selectorRect.bottom\n const selectorHeight = selectorRect.height\n const selectorWidth = selectorRect.width\n const selectorCenter = {\n x: selectorX + (selectorWidth / 2),\n y: selectorY + (selectorHeight / 2)\n }\n const halfOfInboxHeight = (inboxHeight / 2)\n const halfOfInboxWidth = (inboxWidth / 2)\n let inboxOnSide = false\n\n let xPos, yPos\n\n const padding = 16\n\n /**\n * y co-ordinates:\n * Try to push the card downwards\n * if that's not possible, push it upwards\n * if that too is not possible, then the card will be placed on the side. Add some padding.\n *\n * x co-ordinates:\n * If the card is on the side,\n * try to place it to the right. If it's not possible,\n * place it to the left\n * If the card is either on top/ bottom, set the x co-ordinate such that the selector center and the inbox card center become the same\n * Now,\n * if the left of the inbox card is < 0,\n * try to get the left aligned to the selectorLeft.\n * if that's not possible, simply set left to 0\n * if the right of the inbox card > windowWidth,\n * try to get the right of rhe inbox card aligned with the selectorRight\n * if that's not possible, simply set the inbox right to the window Right\n */\n if (selectorBottom + inboxHeight <= windowHeight) { // try to place the card down\n const availableHeight = windowHeight - (selectorBottom + inboxHeight)\n yPos = availableHeight >= padding ? selectorBottom + padding : selectorBottom + availableHeight\n } else if (selectorTop - inboxHeight >= verticalScroll) { // try to place the card up\n const availableHeight = selectorTop - inboxHeight\n yPos = availableHeight >= padding ? selectorTop - inboxHeight - padding : selectorTop - inboxHeight - availableHeight\n } else {\n inboxOnSide = true\n yPos = selectorCenter.y - halfOfInboxHeight // with this the y co-ordinate of the selector center and the inbox card center become the same\n if (yPos < verticalScroll) {\n yPos = verticalScroll\n } else if (yPos + inboxHeight > windowHeight) {\n yPos = windowHeight - inboxHeight\n }\n }\n\n if (inboxOnSide) {\n // See if we can place the card to the right of the selector\n const inboxRight = selectorRight + inboxWidth\n if (inboxRight <= windowWidth) {\n const availableWidth = inboxRight + padding <= windowWidth ? padding : windowWidth - inboxRight\n xPos = selectorRight + availableWidth\n } else {\n const inboxLeft = selectorLeft - inboxWidth\n const availableWidth = inboxLeft - padding >= horizontalScroll ? padding : inboxLeft - horizontalScroll\n xPos = inboxLeft - availableWidth\n }\n } else {\n xPos = selectorCenter.x - halfOfInboxWidth\n if (xPos < horizontalScroll) {\n if (selectorLeft + inboxWidth <= windowWidth) {\n xPos = selectorLeft\n } else {\n xPos = horizontalScroll\n }\n } else if (xPos + inboxWidth > windowWidth) {\n if (selectorRight - inboxWidth >= horizontalScroll) {\n xPos = selectorRight - inboxWidth\n } else {\n xPos = windowWidth - inboxWidth\n }\n }\n }\n\n return { xPos, yPos }\n}\n\nexport const determineTimeStampText = (ts) => {\n const now = Date.now()\n let diff = Math.floor((now - ts) / 60000)\n if (diff < 5) {\n return 'Just now'\n }\n if (diff < 60) {\n return `${diff} minute${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 60)\n if (diff < 24) {\n return `${diff} hour${diff > 1 ? 's' : ''} ago`\n }\n diff = Math.floor(diff / 24)\n return `${diff} day${diff > 1 ? 's' : ''} ago`\n}\n\nexport const hasWebInboxSettingsInLS = () => {\n return Object.keys(StorageManager.readFromLSorCookie(WEBINBOX_CONFIG) || {}).length > 0\n}\n\nexport const arrowSvg = `\n\n\n`\nexport const greenTickSvg = `\n\n\n`\n","export const OVERLAY_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js'\nexport const CSS_PATH = 'https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css'\nexport const WVE_CLASS = {\n FLICKER_SHOW: 'wve-anti-flicker-show',\n FLICKER_HIDE: 'wve-anti-flicker-hide',\n FLICKER_ID: 'wve-flicker-style'\n}\n","export const updateFormData = (element, formStyle, payload, isPreview = false) => {\n // Update the element style\n if (formStyle.style !== undefined) {\n Object.keys(formStyle.style).forEach((property) => {\n element.style.setProperty(property, formStyle.style[property])\n })\n }\n\n // Update underline for element\n if (formStyle.underline !== undefined) {\n const curTextDecoration = element.style.textDecoration\n if (formStyle.underline) {\n element.style.textDecoration = `${curTextDecoration} underline`.trim()\n } else {\n element.style.textDecoration = curTextDecoration.replace('underline', '').trim()\n }\n }\n\n // Update element text\n if (formStyle.text !== undefined) {\n element.innerText = isPreview ? formStyle.text.text : formStyle.text\n }\n\n // Handle element onClick\n if (formStyle.clickDetails !== undefined) {\n const url = formStyle.clickDetails.clickUrl\n element.onclick = formStyle.clickDetails.newTab\n ? () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.open(url, '_blank').focus()\n }\n : () => {\n if (!isPreview) {\n window.clevertap.raiseNotificationClicked(payload)\n }\n window.location.href = url\n }\n }\n\n // Set the image source\n if (formStyle.imgURL !== undefined && element.tagName.toLowerCase() === 'img') {\n element.src = formStyle.imgURL\n }\n\n // Handle elementCss\n if (formStyle.elementCss !== undefined) {\n const style = document.createElement('style')\n style.innerHTML = formStyle.elementCss\n document.head.appendChild(style)\n }\n}\n","import { CSS_PATH, OVERLAY_PATH, WVE_CLASS } from './builder_constants'\nimport { updateFormData } from './dataUpdate'\n\nexport const checkBuilder = (logger, accountId) => {\n const search = window.location.search\n const parentWindow = window.opener\n\n if (search === '?ctBuilder') {\n // open in visual builder mode\n logger.debug('open in visual builder mode')\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'builder', originUrl: window.location.href }, '*')\n }\n return\n }\n if (search === '?ctBuilderPreview') {\n window.addEventListener('message', handleMessageEvent, false)\n if (parentWindow) {\n parentWindow.postMessage({ message: 'preview', originUrl: window.location.href }, '*')\n }\n }\n\n if (search === '?ctBuilderSDKCheck') {\n if (parentWindow) {\n const sdkVersion = '$$PACKAGE_VERSION$$'\n parentWindow.postMessage({\n message: 'SDKVersion',\n accountId,\n originUrl: window.location.href,\n sdkVersion\n },\n '*'\n )\n }\n }\n}\n\nconst handleMessageEvent = (event) => {\n if (event.data && isValidUrl(event.data.originUrl)) {\n const msgOrigin = new URL(event.data.originUrl).origin\n if (event.origin !== msgOrigin) {\n return\n }\n } else {\n return\n }\n if (event.data.message === 'Dashboard') {\n // handle personalisation\n window.evtMaster = event.data.personalisation.evtMaster\n initialiseCTBuilder(\n event.data.url,\n event.data.variant ?? null,\n event.data.details ?? {},\n event.data.personalisation\n )\n } else if (event.data.message === 'Overlay') {\n renderVisualBuilder(event.data, true)\n }\n}\n/**\n * Initializes the Clevertap builder.\n * @param {string} url - The URL to initialize the builder.\n * @param {string} variant - The variant of the builder.\n * @param {Object} details - The details object.\n * @param {Object} personalisation - The personalisation object\n */\nconst initialiseCTBuilder = (url, variant, details, personalisation) => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n onContentLoad(url, variant, details, personalisation)\n }\n })\n }\n}\n\nlet container\nlet contentLoaded = false\nlet isShopify = false\n/**\n * Handles content load for Clevertap builder.\n */\nfunction onContentLoad (url, variant, details, personalisation) {\n if (!contentLoaded) {\n if (window.Shopify) {\n isShopify = true\n }\n document.body.innerHTML = ''\n document.head.innerHTML = ''\n document.documentElement.innerHTML = ''\n container = document.createElement('div')\n container.id = 'overlayDiv'\n container.style.position = 'relative' // Ensure relative positioning for absolute positioning of form\n container.style.display = 'flex'\n document.body.appendChild(container)\n const overlayPath = OVERLAY_PATH\n loadOverlayScript(overlayPath, url, variant, details, personalisation)\n .then(() => {\n console.log('Overlay script loaded successfully.')\n contentLoaded = true\n })\n .catch((error) => {\n console.error('Error loading overlay script:', error)\n })\n loadCSS()\n }\n}\n\n/**\n * Loads CSS file.\n */\nfunction loadCSS () {\n var link = document.createElement('link')\n link.rel = 'stylesheet'\n link.type = 'text/css'\n link.href = CSS_PATH\n document.head.appendChild(link)\n}\n\n/**\n * Loads the overlay script.\n * @param {string} overlayPath - The path to overlay script.\n * @param {string} url - The URL.\n * @param {string} variant - The variant.\n * @param {Object} details - The details object.\n * @param {Object} personalisation\n * @returns {Promise} A promise.\n */\nfunction loadOverlayScript (overlayPath, url, variant, details, personalisation) {\n return new Promise((resolve, reject) => {\n var script = document.createElement('script')\n script.type = 'module'\n script.src = overlayPath\n script.onload = function () {\n if (typeof window.Overlay === 'function') {\n window.Overlay({ id: '#overlayDiv', url, variant, details, isShopify, personalisation })\n resolve()\n } else {\n reject(new Error('ContentLayout not found in overlay.js'))\n }\n }\n script.onerror = function (error) {\n reject(error)\n }\n document.head.appendChild(script)\n })\n}\n\n/**\n * Renders the visual builder.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {boolean} isPreview - Indicates if it's a preview.\n */\nexport const renderVisualBuilder = (targetingMsgJson, isPreview) => {\n const details = isPreview ? targetingMsgJson.details : targetingMsgJson.display.details\n let notificationViewed = false\n const payload = {\n msgId: targetingMsgJson.wzrk_id,\n pivotId: targetingMsgJson.wzrk_pivot\n }\n\n const raiseViewed = () => {\n if (!isPreview && !notificationViewed) {\n notificationViewed = true\n window.clevertap.renderNotificationViewed(payload)\n }\n }\n\n const processElement = (element, selector) => {\n if (!selector.values) return\n if (selector.values.html) {\n element.outerHTML = selector.values.html\n } else if (selector.values?.json) {\n dispatchJsonData(targetingMsgJson, selector.values)\n } else {\n payload.msgCTkv = { wzrk_selector: selector.selector }\n updateFormData(element, selector.values.form, payload, isPreview)\n }\n }\n\n const tryFindingElement = (selector) => {\n let count = 0\n const intervalId = setInterval(() => {\n const retryElement = document.querySelector(selector.selector)\n if (retryElement) {\n raiseViewed()\n processElement(retryElement, selector)\n clearInterval(intervalId)\n } else if (++count >= 20) {\n console.log(`No element present on DOM with selector '${selector}'.`)\n clearInterval(intervalId)\n }\n }, 500)\n }\n\n details.forEach(d => {\n if (d.url === window.location.href.split('?')[0]) {\n d.selectorData.forEach(s => {\n const element = document.querySelector(s.selector)\n if (element) {\n raiseViewed()\n processElement(element, s)\n } else {\n tryFindingElement(s)\n }\n })\n }\n })\n}\n\n/**\n * Dispatches JSON data.\n * @param {Object} targetingMsgJson - The point and click campaign JSON object.\n * @param {Object} selector - The selector object.\n */\nfunction dispatchJsonData (targetingMsgJson, selector) {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (selector.json != null) {\n inaObj.json = selector.json\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display_buider', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n\nfunction isValidUrl (string) {\n try {\n const url = new URL(string)\n return Boolean(url)\n } catch (_err) {\n return false\n }\n}\n\nexport function addAntiFlicker (antiFlicker) {\n const { personalizedSelectors = [], delayTime = 2000 } = antiFlicker\n const retryElements = {} // Track selectors that need retry\n let retryCount = 0 // Counter for retries\n let retryInterval\n function isInViewport (element) {\n const rect = element.getBoundingClientRect()\n const { innerHeight: windowHeight, innerWidth: windowWidth } = window\n return (\n rect.bottom > 0 &&\n rect.right > 0 &&\n rect.top < windowHeight &&\n rect.left < windowWidth\n )\n }\n (function () {\n const styleContent = `\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n `\n // Create and append the style element if it doesn't exist\n const styleId = WVE_CLASS.FLICKER_ID\n if (!document.getElementById(styleId)) {\n const styleElement = document.createElement('style')\n styleElement.id = styleId\n styleElement.textContent = styleContent\n document.head.appendChild(styleElement)\n }\n })()\n function applyAntiFlicker (selectors) {\n function processSelectors (selectorElements) {\n const elements = []\n selectorElements.forEach(selector => {\n const matchedElements = document.querySelectorAll(selector)\n if (matchedElements.length) {\n matchedElements.forEach(el => {\n if (isInViewport(el)) {\n elements.push(el)\n }\n })\n delete retryElements[selector] // Successfully processed, remove from retry list\n } else {\n retryElements[selector] = false // Add to retry list if not found\n }\n })\n applyStyles(elements)\n }\n function retryProcessing () {\n processSelectors(Object.keys(retryElements))\n retryCount++\n if (Object.keys(retryElements).length === 0 || retryCount > 20) {\n retryCount = 0\n clearInterval(retryInterval)\n }\n }\n processSelectors(selectors)\n if (Object.keys(retryElements).length) {\n retryInterval = setInterval(retryProcessing, 100)\n }\n }\n function applyStyles (elements) {\n elements.forEach(el => el.classList.add(WVE_CLASS.FLICKER_HIDE))\n setTimeout(() => {\n elements.forEach(el => {\n el.classList.remove(WVE_CLASS.FLICKER_HIDE)\n el.classList.add(WVE_CLASS.FLICKER_SHOW)\n })\n }, delayTime) // Apply styles after maxRenderTime\n }\n function observeUrlChange () {\n let previousHref = document.location.href\n const observer = new MutationObserver(() => {\n if (previousHref !== document.location.href) {\n previousHref = document.location.href\n applyAntiFlicker(personalizedSelectors)\n }\n })\n observer.observe(document.body, { childList: true, subtree: true })\n }\n window.addEventListener('load', () => {\n observeUrlChange()\n applyAntiFlicker(personalizedSelectors)\n })\n}\n","export class CTWebPersonalisationBanner extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n }\n\n _details = null\n shadow = null\n\n get details () {\n return this._details || ''\n }\n\n set details (val) {\n if (this._details === null) {\n this._details = val\n this.renderBanner()\n }\n }\n\n renderBanner () {\n this.shadow.innerHTML = this.getBannerContent()\n if (this.trackClick !== false) {\n this.addEventListener('click', () => {\n const onClickUrl = this.details.onClick\n if (onClickUrl) {\n this.details.window ? window.open(onClickUrl, '_blank') : window.parent.location.href = onClickUrl\n }\n window.clevertap.renderNotificationClicked({ msgId: this.msgId, pivotId: this.pivotId })\n })\n }\n window.clevertap.renderNotificationViewed({ msgId: this.msgId, pivotId: this.pivotId })\n }\n\n getBannerContent () {\n return `\n \n
\n \n \n \n \"Please\n \n ${this.details.html ? this.details.html : ''}\n
\n `\n }\n}\n","import { CTWebPersonalisationBanner } from './banner'\nexport class CTWebPersonalisationCarousel extends HTMLElement {\n constructor () {\n super()\n this.shadow = this.attachShadow({ mode: 'open' })\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n }\n\n _target = null\n _carousel = null\n shadow = null\n slides = 0\n previouslySelectedItem = -1\n selectedItem = 1\n autoSlide = null\n stopAutoSlideTimeout = null\n\n get target () {\n return this._target || ''\n }\n\n set target (val) {\n if (this._target === null) {\n this._target = val\n this.renderCarousel()\n }\n }\n\n get details () {\n return this.target.display.details\n }\n\n get display () {\n return this.target.display\n }\n\n renderCarousel () {\n this.slides = this.details.length\n this.shadow.innerHTML = this.getStyles()\n const carousel = this.getCarouselContent()\n if (this.display.showNavBtns) {\n carousel.insertAdjacentHTML('beforeend', this.display.navBtnsHtml)\n }\n if (this.display.showNavArrows) {\n carousel.insertAdjacentHTML('beforeend', this.display.leftNavArrowHtml)\n carousel.insertAdjacentHTML('beforeend', this.display.rightNavArrowHtml)\n }\n this._carousel = carousel\n this.shadow.appendChild(carousel)\n this.setupClick()\n this.updateSelectedItem()\n // TODO: enable conditionally\n this.startAutoSlide()\n this.setupOnHover()\n window.clevertap.renderNotificationViewed({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot })\n }\n\n setupClick () {\n this._carousel.addEventListener('click', (event) => {\n const eventID = event.target.id\n if (eventID.startsWith('carousel__button')) {\n const selected = +eventID.split('-')[1]\n if (selected !== this.selectedItem) {\n this.previouslySelectedItem = this.selectedItem\n this.selectedItem = selected\n this.updateSelectedItem()\n this.startAutoSlide()\n }\n } else if (eventID.startsWith('carousel__arrow')) {\n eventID.endsWith('right') ? this.goToNext() : this.goToPrev()\n this.startAutoSlide()\n } else if (eventID.indexOf('-') > -1) {\n const item = +eventID.split('-')[1]\n const index = item - 1\n if (window.parent.clevertap) {\n window.clevertap.renderNotificationClicked({ msgId: this.target.wzrk_id, pivotId: this.target.wzrk_pivot, wzrk_slideNo: item })\n }\n const url = this.details[index].onClick\n if (url !== '') {\n this.details[index].window ? window.open(url, '_blank') : window.location.href = url\n }\n }\n })\n }\n\n setupOnHover () {\n this._carousel.addEventListener('mouseenter', (event) => {\n this.stopAutoSlideTimeout = setTimeout(() => {\n this.autoSlide = clearInterval(this.autoSlide)\n }, 500)\n })\n\n this._carousel.addEventListener('mouseleave', (event) => {\n clearTimeout(this.stopAutoSlideTimeout)\n if (this.autoSlide === undefined) {\n this.startAutoSlide()\n }\n })\n }\n\n getCarouselContent () {\n const carousel = document.createElement('div')\n carousel.setAttribute('class', 'carousel')\n\n this.details.forEach((detail, i) => {\n const banner = document.createElement('ct-web-personalisation-banner')\n banner.classList.add('carousel__item')\n banner.trackClick = false\n banner.setAttribute('id', `carousel__item-${i + 1}`)\n banner.details = detail\n carousel.appendChild(banner)\n })\n\n return carousel\n }\n\n getStyles () {\n return `\n \n `\n }\n\n updateSelectedItem () {\n if (this.previouslySelectedItem !== -1) {\n const prevItem = this.shadow.getElementById(`carousel__item-${this.previouslySelectedItem}`)\n const prevButton = this.shadow.getElementById(`carousel__button-${this.previouslySelectedItem}`)\n prevItem.classList.remove('carousel__item--selected')\n if (prevButton) {\n prevButton.classList.remove('carousel__button--selected')\n }\n }\n const item = this.shadow.getElementById(`carousel__item-${this.selectedItem}`)\n const button = this.shadow.getElementById(`carousel__button-${this.selectedItem}`)\n item.classList.add('carousel__item--selected')\n if (button) {\n button.classList.add('carousel__button--selected')\n }\n }\n\n startAutoSlide () {\n clearInterval(this.autoSlide)\n this.autoSlide = setInterval(() => {\n this.goToNext()\n }, this.display.sliderTime ? this.display.sliderTime * 1000 : 3000)\n }\n\n goToNext () {\n this.goTo(this.selectedItem, (this.selectedItem + 1) % this.slides)\n }\n\n goToPrev () {\n this.goTo(this.selectedItem, this.selectedItem - 1)\n }\n\n goTo (prev, cur) {\n this.previouslySelectedItem = prev\n this.selectedItem = cur\n if (cur === 0) {\n this.selectedItem = this.slides\n }\n this.updateSelectedItem()\n }\n}\n","import { CTWebPersonalisationBanner } from '../web-personalisation/banner'\nimport { CTWebPersonalisationCarousel } from '../web-personalisation/carousel'\n\nexport const renderPersonalisationBanner = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-banner') === undefined) {\n customElements.define('ct-web-personalisation-banner', CTWebPersonalisationBanner)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const bannerEl = document.createElement('ct-web-personalisation-banner')\n bannerEl.msgId = targetingMsgJson.wzrk_id\n bannerEl.pivotId = targetingMsgJson.wzrk_pivot\n bannerEl.divHeight = targetingMsgJson.display.divHeight\n bannerEl.details = targetingMsgJson.display.details[0]\n const containerEl = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n containerEl.innerHTML = ''\n containerEl.appendChild(bannerEl)\n}\n\nexport const renderPersonalisationCarousel = (targetingMsgJson) => {\n if (customElements.get('ct-web-personalisation-carousel') === undefined) {\n customElements.define('ct-web-personalisation-carousel', CTWebPersonalisationCarousel)\n }\n const divId = targetingMsgJson.display.divId ?? targetingMsgJson.display.divSelector\n const carousel = document.createElement('ct-web-personalisation-carousel')\n carousel.target = targetingMsgJson\n const container = targetingMsgJson.display.divId ? document.getElementById(divId) : document.querySelector(divId)\n container.innerHTML = ''\n container.appendChild(carousel)\n}\n\nexport const handleKVpairCampaign = (targetingMsgJson) => {\n const inaObj = {}\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.msgContent.kv != null) {\n inaObj.kv = targetingMsgJson.msgContent.kv\n }\n const kvPairsEvent = new CustomEvent('CT_web_native_display', { detail: inaObj })\n document.dispatchEvent(kvPairsEvent)\n}\n","import { getCampaignObject, saveCampaignObject, closeIframe } from '../clevertap'\nimport { CAMP_COOKIE_G, GCOOKIE_NAME, EV_COOKIE, WZRK_ID, NOTIFICATION_VIEWED } from '../constants'\nimport { StorageManager, $ct } from '../storage'\nimport RequestDispatcher from '../requestDispatcher'\nimport { compressToBase64 } from '../encoder'\n\nexport const invokeExternalJs = (jsFunc, targetingMsgJson) => {\n const func = window.parent[jsFunc]\n if (typeof func === 'function') {\n if (targetingMsgJson.display.kv != null) {\n func(targetingMsgJson.display.kv)\n } else {\n func()\n }\n }\n}\n\nexport const appendScriptForCustomEvent = (targetingMsgJson, html) => {\n const script = `\n `\n return html.replace(/(<\\s*\\/\\s*body)/, `${script}\\n$1`)\n}\n\nexport const staleDataUpdate = (staledata, campType) => {\n const campObj = getCampaignObject()\n const globalObj = campObj[campType].global\n if (globalObj != null && campType) {\n for (const idx in staledata) {\n if (staledata.hasOwnProperty(idx)) {\n delete globalObj[staledata[idx]]\n if (StorageManager.read(CAMP_COOKIE_G)) {\n const guidCampObj = JSON.parse(decodeURIComponent(StorageManager.read(CAMP_COOKIE_G)))\n const guid = JSON.parse(decodeURIComponent(StorageManager.read(GCOOKIE_NAME)))\n if (guidCampObj[guid] && guidCampObj[guid][campType] && guidCampObj[guid][campType][staledata[idx]]) {\n delete guidCampObj[guid][campType][staledata[idx]]\n StorageManager.save(CAMP_COOKIE_G, encodeURIComponent(JSON.stringify(guidCampObj)))\n }\n }\n }\n }\n }\n saveCampaignObject(campObj)\n}\n\nexport const mergeEventMap = (newEvtMap) => {\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if ($ct.globalEventsMap == null) {\n $ct.globalEventsMap = newEvtMap\n return\n }\n }\n for (const key in newEvtMap) {\n if (newEvtMap.hasOwnProperty(key)) {\n const oldEvtObj = $ct.globalEventsMap[key]\n const newEvtObj = newEvtMap[key]\n if ($ct.globalEventsMap[key] != null) {\n if (newEvtObj[0] != null && newEvtObj[0] > oldEvtObj[0]) {\n $ct.globalEventsMap[key] = newEvtObj\n }\n } else {\n $ct.globalEventsMap[key] = newEvtObj\n }\n }\n }\n}\n\nexport const incrementImpression = (targetingMsgJson, _request) => {\n const data = {}\n data.type = 'event'\n data.evtName = NOTIFICATION_VIEWED\n data.evtData = { [WZRK_ID]: targetingMsgJson.wzrk_id }\n if (targetingMsgJson.wzrk_pivot) {\n data.evtData = { ...data.evtData, wzrk_pivot: targetingMsgJson.wzrk_pivot }\n }\n _request.processEvent(data)\n}\n\nexport const setupClickEvent = (onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session) => {\n if (onClick !== '' && onClick != null) {\n let ctaElement\n let jsCTAElements\n if (isLegacy) {\n ctaElement = contentDiv\n } else if (contentDiv !== null) {\n jsCTAElements = contentDiv.getElementsByClassName('jsCT_CTA')\n if (jsCTAElements != null && jsCTAElements.length === 1) {\n ctaElement = jsCTAElements[0]\n }\n }\n const jsFunc = targetingMsgJson.display.jsFunc\n const isPreview = targetingMsgJson.display.preview\n if (isPreview == null) {\n onClick += getCookieParams(_device, _session)\n }\n\n if (ctaElement != null) {\n ctaElement.onclick = () => {\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n if (isPreview == null) {\n RequestDispatcher.fireRequest(onClick)\n }\n invokeExternalJs(jsFunc, targetingMsgJson)\n // close iframe. using -1 for no campaignId\n closeIframe('-1', divId, _session.sessionId)\n } else {\n const rValue = targetingMsgJson.display.preview ? targetingMsgJson.display.onClick : new URL(targetingMsgJson.display.onClick).searchParams.get('r')\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n\n if (rValue === 'pushPrompt') {\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n // Open Web Push Soft prompt\n window.clevertap.notifications.push({\n skipDialog: true\n })\n closeIframe(campaignId, divId, _session.sessionId)\n } else if (rValue === 'none') {\n // Close notification\n closeIframe(campaignId, divId, _session.sessionId)\n } else {\n // Will get the url to open\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n if (targetingMsgJson.display['close-popup']) {\n closeIframe(campaignId, divId, _session.sessionId)\n }\n if (!targetingMsgJson.display.preview) {\n window.parent.clevertap.renderNotificationClicked({ msgId: targetingMsgJson.wzrk_id, pivotId: targetingMsgJson.wzrk_pivot })\n }\n } else {\n window.location = onClick\n }\n }\n }\n }\n }\n }\n}\n\nexport const getCookieParams = (_device, _session) => {\n const gcookie = _device.getGuid()\n const scookieObj = _session.getSessionCookieObject()\n return '&t=wc&d=' + encodeURIComponent(compressToBase64(gcookie + '|' + scookieObj.p + '|' + scookieObj.s))\n}\n","export const renderPopUpImageOnly = (targetingMsgJson, _session) => {\n const divId = 'wzrkImageOnlyDiv'\n const popupImageOnly = document.createElement('ct-web-popup-imageonly')\n popupImageOnly.session = _session\n popupImageOnly.target = targetingMsgJson\n const containerEl = document.getElementById(divId)\n containerEl.innerHTML = ''\n containerEl.style.visibility = 'hidden'\n containerEl.appendChild(popupImageOnly)\n}\n","export const getBoxPromptStyles = (style) => {\n const totalBorderWidth = style.card.borderEnabled ? style.card.border.borderWidth * 2 : 0\n const cardPadding = 16 * 2 // Left and right padding\n const cardContentWidth = 360 - cardPadding - totalBorderWidth\n\n return `\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ${style.overlay.color || 'rgba(0, 0, 0, .15)'};\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ${style.card.color};\n border-radius: ${style.card.borderRadius}px;\n padding: 16px;\n width: ${cardContentWidth}px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ${style.card.borderEnabled ? `\n border-width: ${style.card.border.borderWidth}px;\n border-color: ${style.card.border.borderColor};\n border-style: solid;\n ` : ''}\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ${style.text.titleColor};\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ${style.text.descriptionColor};\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ${style.buttons.primaryButton.buttonColor};\n color: ${style.buttons.primaryButton.textColor};\n border-radius: ${style.buttons.primaryButton.borderRadius}px;\n ${style.buttons.primaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.primaryButton.border.borderWidth}px;\n border-color: ${style.buttons.primaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #secondaryButton {\n background-color: ${style.buttons.secondaryButton.buttonColor};\n color: ${style.buttons.secondaryButton.textColor};\n border-radius: ${style.buttons.secondaryButton.borderRadius}px;\n ${style.buttons.secondaryButton.borderEnabled\n ? `\n border-width: ${style.buttons.secondaryButton.border.borderWidth}px;\n border-color: ${style.buttons.secondaryButton.border.borderColor};\n border-style: solid;\n `\n : 'border: none;'}\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n `\n}\n\nexport const getBellIconStyles = (style) => {\n return `\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ${style.card.backgroundColor};\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n `\n}\n","import { StorageManager, $ct } from '../util/storage'\nimport { isObject } from '../util/datatypes'\nimport {\n PUSH_SUBSCRIPTION_DATA\n} from '../util/constants'\nimport {\n urlBase64ToUint8Array\n} from '../util/encoder'\nimport { enablePush } from './webPushPrompt/prompt'\n\nexport default class NotificationHandler extends Array {\n #oldValues\n #logger\n #request\n #account\n #wizAlertJSPath\n #fcmPublicKey\n\n constructor ({\n logger,\n session,\n request,\n account\n }, values) {\n super()\n this.#wizAlertJSPath = 'https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js'\n this.#fcmPublicKey = null\n this.#oldValues = values\n this.#logger = logger\n this.#request = request\n this.#account = account\n }\n\n push (...displayArgs) {\n this.#setUpWebPush(displayArgs)\n return 0\n }\n\n enable (options = {}) {\n const { swPath } = options\n enablePush(this.#logger, this.#account, this.#request, swPath)\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#setUpWebPush(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #setUpWebPush (displayArgs) {\n if ($ct.webPushEnabled && displayArgs.length > 0) {\n this.#handleNotificationRegistration(displayArgs)\n } else if ($ct.webPushEnabled == null && displayArgs.length > 0) {\n $ct.notifApi.notifEnabledFromApi = true\n $ct.notifApi.displayArgs = displayArgs.slice()\n } else if ($ct.webPushEnabled === false && displayArgs.length > 0) {\n this.#logger.error('Make sure push notifications are fully enabled and integrated')\n }\n }\n\n setUpWebPushNotifications (subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsServiceUrl) {\n if (navigator.userAgent.indexOf('Chrome') !== -1 || navigator.userAgent.indexOf('Firefox') !== -1) {\n this.#setUpChromeFirefoxNotifications(subscriptionCallback, serviceWorkerPath)\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n this.#setUpSafariNotifications(subscriptionCallback, apnsWebPushId, apnsServiceUrl)\n }\n }\n\n setApplicationServerKey (applicationServerKey) {\n this.#fcmPublicKey = applicationServerKey\n }\n\n #setUpSafariNotifications (subscriptionCallback, apnsWebPushId, apnsServiceUrl) {\n // ensure that proper arguments are passed\n if (typeof apnsWebPushId === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push ID is supplied')\n }\n if (typeof apnsServiceUrl === 'undefined') {\n this.#logger.error('Ensure that APNS Web Push service path is supplied')\n }\n if ('safari' in window && 'pushNotification' in window.safari) {\n window.safari.pushNotification.requestPermission(\n apnsServiceUrl,\n apnsWebPushId, {}, (subscription) => {\n if (subscription.permission === 'granted') {\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n subscriptionData.endpoint = subscription.deviceToken\n subscriptionData.browser = 'Safari'\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n\n this.#request.registerToken(subscriptionData)\n this.#logger.info('Safari Web Push registered. Device Token: ' + subscription.deviceToken)\n } else if (subscription.permission === 'denied') {\n this.#logger.info('Error subscribing to Safari web push')\n }\n })\n }\n }\n\n /**\n * Sets up a service worker for WebPush(chrome/Firefox) push notifications and sends the data to LC\n */\n #setUpChromeFirefoxNotifications (subscriptionCallback, serviceWorkerPath) {\n let registrationScope = ''\n\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.register(serviceWorkerPath).then((registration) => {\n if (typeof __wzrk_account_id !== 'undefined') { // eslint-disable-line\n // shopify accounts , since the service worker is not at root, serviceWorker.ready is never resolved.\n // hence add a timeout and hope serviceWroker is ready within that time.\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n }\n registrationScope = registration.scope\n\n // IF SERVICE WORKER IS AT ROOT, RETURN THE READY PROMISE\n // ELSE IF CHROME RETURN PROMISE AFTER 5 SECONDS\n // OR getRegistrations PROMISE IF ITS FIREFOX\n const rootDirRegex = /^(\\.?)(\\/?)([^/]*).js$/\n const isServiceWorkerAtRoot = rootDirRegex.test(serviceWorkerPath)\n if (isServiceWorkerAtRoot) {\n return navigator.serviceWorker.ready\n } else {\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n return new Promise(resolve => setTimeout(() => resolve(registration), 5000))\n } else {\n return navigator.serviceWorker.getRegistrations()\n }\n }\n }).then((serviceWorkerRegistration) => {\n // ITS AN ARRAY IN CASE OF FIREFOX, SO USE THE REGISTRATION WITH PROPER SCOPE\n if (navigator.userAgent.indexOf('Firefox') !== -1 && Array.isArray(serviceWorkerRegistration)) {\n serviceWorkerRegistration = serviceWorkerRegistration.filter((i) => i.scope === registrationScope)[0]\n }\n const subscribeObj = { userVisibleOnly: true }\n\n if (this.#fcmPublicKey != null) {\n subscribeObj.applicationServerKey = urlBase64ToUint8Array(this.#fcmPublicKey)\n }\n\n serviceWorkerRegistration.pushManager.subscribe(subscribeObj)\n .then((subscription) => {\n this.#logger.info('Service Worker registered. Endpoint: ' + subscription.endpoint)\n\n // convert the subscription keys to strings; this sets it up nicely for pushing to LC\n const subscriptionData = JSON.parse(JSON.stringify(subscription))\n\n // remove the common chrome/firefox endpoint at the beginning of the token\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Chrome'\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n subscriptionData.endpoint = subscriptionData.endpoint.split('/').pop()\n subscriptionData.browser = 'Firefox'\n }\n StorageManager.saveToLSorCookie(PUSH_SUBSCRIPTION_DATA, subscriptionData)\n this.#request.registerToken(subscriptionData)\n\n if (typeof subscriptionCallback !== 'undefined' && typeof subscriptionCallback === 'function') {\n subscriptionCallback()\n }\n const existingBellWrapper = document.getElementById('bell_wrapper')\n if (existingBellWrapper) {\n existingBellWrapper.parentNode.removeChild(existingBellWrapper)\n }\n }).catch((error) => {\n // unsubscribe from webpush if error\n serviceWorkerRegistration.pushManager.getSubscription().then((subscription) => {\n if (subscription !== null) {\n subscription.unsubscribe().then((successful) => {\n // You've successfully unsubscribed\n this.#logger.info('Unsubscription successful')\n window.clevertap.notifications.push({\n skipDialog: true\n })\n }).catch((e) => {\n // Unsubscription failed\n this.#logger.error('Error unsubscribing: ' + e)\n })\n }\n })\n this.#logger.error('Error subscribing: ' + error)\n })\n }).catch((err) => {\n this.#logger.error('error registering service worker: ' + err)\n })\n }\n }\n\n #addWizAlertJS () {\n const scriptTag = document.createElement('script')\n scriptTag.setAttribute('type', 'text/javascript')\n scriptTag.setAttribute('id', 'wzrk-alert-js')\n scriptTag.setAttribute('src', this.#wizAlertJSPath)\n\n // add the script tag to the end of the body\n document.getElementsByTagName('body')[0].appendChild(scriptTag)\n\n return scriptTag\n }\n\n #removeWizAlertJS () {\n const scriptTag = document.getElementById('wzrk-alert-js')\n scriptTag.parentNode.removeChild(scriptTag)\n }\n\n #handleNotificationRegistration (displayArgs) {\n // make sure everything is specified\n let titleText\n let bodyText\n let okButtonText\n let rejectButtonText\n let okButtonColor\n let skipDialog\n let askAgainTimeInSeconds\n let okCallback\n let rejectCallback\n let subscriptionCallback\n let serviceWorkerPath\n let httpsPopupPath\n let httpsIframePath\n let apnsWebPushId\n let apnsWebPushServiceUrl\n\n if (displayArgs.length === 1) {\n if (isObject(displayArgs[0])) {\n const notifObj = displayArgs[0]\n titleText = notifObj.titleText\n bodyText = notifObj.bodyText\n okButtonText = notifObj.okButtonText\n rejectButtonText = notifObj.rejectButtonText\n okButtonColor = notifObj.okButtonColor\n skipDialog = notifObj.skipDialog\n askAgainTimeInSeconds = notifObj.askAgainTimeInSeconds\n okCallback = notifObj.okCallback\n rejectCallback = notifObj.rejectCallback\n subscriptionCallback = notifObj.subscriptionCallback\n serviceWorkerPath = notifObj.serviceWorkerPath\n httpsPopupPath = notifObj.httpsPopupPath\n httpsIframePath = notifObj.httpsIframePath\n apnsWebPushId = notifObj.apnsWebPushId\n apnsWebPushServiceUrl = notifObj.apnsWebPushServiceUrl\n }\n } else {\n titleText = displayArgs[0]\n bodyText = displayArgs[1]\n okButtonText = displayArgs[2]\n rejectButtonText = displayArgs[3]\n okButtonColor = displayArgs[4]\n skipDialog = displayArgs[5]\n askAgainTimeInSeconds = displayArgs[6]\n }\n\n if (skipDialog == null) {\n skipDialog = false\n }\n\n if (serviceWorkerPath == null) {\n serviceWorkerPath = '/clevertap_sw.js'\n }\n\n // ensure that the browser supports notifications\n if (typeof navigator.serviceWorker === 'undefined') {\n return\n }\n\n const isHTTP = httpsPopupPath != null && httpsIframePath != null\n\n // make sure the site is on https for chrome notifications\n if (window.location.protocol !== 'https:' && document.location.hostname !== 'localhost' && !isHTTP) {\n this.#logger.error('Make sure you are https or localhost to register for notifications')\n return\n }\n\n // right now, we only support Chrome V50 & higher & Firefox\n if (navigator.userAgent.indexOf('Chrome') !== -1) {\n const chromeAgent = navigator.userAgent.match(/Chrome\\/(\\d+)/)\n if (chromeAgent == null || parseInt(chromeAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Firefox') !== -1) {\n const firefoxAgent = navigator.userAgent.match(/Firefox\\/(\\d+)/)\n if (firefoxAgent == null || parseInt(firefoxAgent[1], 10) < 50) { return }\n } else if (navigator.userAgent.indexOf('Safari') !== -1) {\n const safariAgent = navigator.userAgent.match(/Safari\\/(\\d+)/)\n if (safariAgent == null || parseInt(safariAgent[1], 10) < 50) { return }\n } else {\n return\n }\n\n // we check for the cookie in setUpChromeNotifications() the tokens may have changed\n\n if (!isHTTP) {\n if (Notification == null) {\n return\n }\n // handle migrations from other services -> chrome notifications may have already been asked for before\n if (Notification.permission === 'granted') {\n // skip the dialog and register\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n } else if (Notification.permission === 'denied') {\n // we've lost this profile :'(\n return\n }\n\n if (skipDialog) {\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n return\n }\n }\n\n // make sure the right parameters are passed\n if (!titleText || !bodyText || !okButtonText || !rejectButtonText) {\n this.#logger.error('Missing input parameters; please specify title, body, ok button and cancel button text')\n return\n }\n\n // make sure okButtonColor is formatted properly\n if (okButtonColor == null || !okButtonColor.match(/^#[a-f\\d]{6}$/i)) {\n okButtonColor = '#f28046' // default color for positive button\n }\n\n // make sure the user isn't asked for notifications more than askAgainTimeInSeconds\n const now = new Date().getTime() / 1000\n if ((StorageManager.getMetaProp('notif_last_time')) == null) {\n StorageManager.setMetaProp('notif_last_time', now)\n } else {\n if (askAgainTimeInSeconds == null) {\n // 7 days by default\n askAgainTimeInSeconds = 7 * 24 * 60 * 60\n }\n\n if (now - StorageManager.getMetaProp('notif_last_time') < askAgainTimeInSeconds) {\n return\n } else {\n // continue asking\n StorageManager.setMetaProp('notif_last_time', now)\n }\n }\n\n if (isHTTP) {\n // add the https iframe\n const httpsIframe = document.createElement('iframe')\n httpsIframe.setAttribute('style', 'display:none;')\n httpsIframe.setAttribute('src', httpsIframePath)\n document.body.appendChild(httpsIframe)\n window.addEventListener('message', (event) => {\n if (event.data != null) {\n let obj = {}\n try {\n obj = JSON.parse(event.data)\n } catch (e) {\n // not a call from our iframe\n return\n }\n if (obj.state != null) {\n if (obj.from === 'ct' && obj.state === 'not') {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n // redirect to popup.html\n window.open(httpsPopupPath)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n }\n }, false)\n } else {\n this.#addWizAlertJS().onload = () => {\n // create our wizrocket popup\n window.wzrkPermissionPopup.wizAlert({\n title: titleText,\n body: bodyText,\n confirmButtonText: okButtonText,\n confirmButtonColor: okButtonColor,\n rejectButtonText: rejectButtonText\n }, (enabled) => { // callback function\n if (enabled) {\n // the user accepted on the dialog box\n if (typeof okCallback === 'function') {\n okCallback()\n }\n this.setUpWebPushNotifications(subscriptionCallback, serviceWorkerPath, apnsWebPushId, apnsWebPushServiceUrl)\n } else {\n if (typeof rejectCallback === 'function') {\n rejectCallback()\n }\n }\n this.#removeWizAlertJS()\n })\n }\n }\n }\n\n _enableWebPush (enabled, applicationServerKey) {\n $ct.webPushEnabled = enabled\n if (applicationServerKey != null) {\n this.setApplicationServerKey(applicationServerKey)\n }\n if ($ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#handleNotificationRegistration($ct.notifApi.displayArgs)\n } else if (!$ct.webPushEnabled && $ct.notifApi.notifEnabledFromApi) {\n this.#logger.error('Ensure that web push notifications are fully enabled and integrated before requesting them')\n }\n }\n}\n","export const BELL_BASE64 = 'PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4K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U3NDZDMjIuMzk4NCA0MC4zODkzIDIzLjA1ODkgNDEuMDQ5NyAyMy44NzM1IDQxLjA0OTdIMjkuNzgxMlY0MS43ODQyQzI5Ljc4MTIgNDMuMDA3NyAzMC43NzMxIDQzLjk5OTYgMzEuOTk2NiA0My45OTk2QzMzLjIyMDIgNDMuOTk5NiAzNC4yMTIgNDMuMDA3NyAzNC4yMTIgNDEuNzg0MlY0MS4wNDk3SDQwLjEyMzNDNDAuOTM4IDQxLjA0OTcgNDEuNTk4NCA0MC4zODkzIDQxLjU5ODQgMzkuNTc0NkM0MS41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo='\n","import { getBellIconStyles, getBoxPromptStyles } from './promptStyles.js'\nimport { WEBPUSH_CONFIG } from '../../util/constants.js'\nimport { StorageManager, $ct } from '../../util/storage.js'\nimport NotificationHandler from '../notification.js'\nimport { BELL_BASE64, PROMPT_BELL_BASE64 } from './promptConstants.js'\n\nlet appServerKey = null\nlet swPath = '/clevertap_sw.js'\nlet notificationHandler = null\n\nexport const processWebPushConfig = (webPushConfig, logger, request) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n\n const updatePushConfig = () => {\n $ct.pushConfig = webPushConfig\n StorageManager.saveToLSorCookie(WEBPUSH_CONFIG, webPushConfig)\n }\n\n if (webPushConfig.isPreview) {\n updatePushConfig()\n enablePush(logger, null, request)\n } else if (JSON.stringify(_pushConfig) !== JSON.stringify(webPushConfig)) {\n updatePushConfig()\n }\n}\n\nexport const enablePush = (logger, account, request, customSwPath) => {\n const _pushConfig = StorageManager.readFromLSorCookie(WEBPUSH_CONFIG) || {}\n $ct.pushConfig = _pushConfig\n if (!$ct.pushConfig) {\n logger.error('Web Push config data not present')\n return\n }\n\n if (customSwPath) { swPath = customSwPath }\n\n notificationHandler = new NotificationHandler({ logger, session: {}, request, account })\n const { showBox, boxType, showBellIcon, isPreview } = $ct.pushConfig\n\n if (isPreview) {\n if ($ct.pushConfig.boxConfig) createNotificationBox($ct.pushConfig)\n if ($ct.pushConfig.bellIconConfig) createBellIcon($ct.pushConfig)\n } else {\n if (showBox && boxType === 'new') createNotificationBox($ct.pushConfig)\n if (showBellIcon) createBellIcon($ct.pushConfig)\n }\n}\n\nconst createElementWithAttributes = (tag, attributes = {}) => {\n const element = document.createElement(tag)\n Object.entries(attributes).forEach(([key, value]) => {\n element[key] = value\n })\n return element\n}\n\nexport const createNotificationBox = (configData) => {\n if (document.getElementById('pnWrapper')) return\n\n const { boxConfig: { content, style } } = configData\n\n // Create the wrapper div\n const wrapper = createElementWithAttributes('div', { id: 'pnWrapper' })\n const overlayDiv = createElementWithAttributes('div', { id: 'pnOverlay' })\n const pnCard = createElementWithAttributes('div', { id: 'pnCard' })\n\n const iconTitleDescWrapper = createElementWithAttributes('div', { id: 'iconTitleDescWrapper' })\n const iconContainer = createElementWithAttributes('img', {\n id: 'iconContainer',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${PROMPT_BELL_BASE64}` : content.icon.url\n })\n\n iconTitleDescWrapper.appendChild(iconContainer)\n\n const titleDescWrapper = createElementWithAttributes('div', { id: 'titleDescWrapper' })\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'title', textContent: content.title }))\n titleDescWrapper.appendChild(createElementWithAttributes('div', { id: 'description', textContent: content.description }))\n\n iconTitleDescWrapper.appendChild(titleDescWrapper)\n\n const buttonsContainer = createElementWithAttributes('div', { id: 'buttonsContainer' })\n\n const primaryButton = createElementWithAttributes('button', {\n id: 'primaryButton',\n textContent: content.buttons.primaryButtonText\n })\n const secondaryButton = createElementWithAttributes('button', {\n id: 'secondaryButton',\n textContent: content.buttons.secondaryButtonText\n })\n buttonsContainer.appendChild(secondaryButton)\n buttonsContainer.appendChild(primaryButton)\n\n pnCard.appendChild(iconTitleDescWrapper)\n pnCard.appendChild(buttonsContainer)\n\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBoxPromptStyles(style) })\n\n wrapper.appendChild(styleElement)\n wrapper.appendChild(pnCard)\n wrapper.appendChild(overlayDiv)\n\n setElementPosition(pnCard, style.card.position)\n\n const now = new Date().getTime() / 1000\n const lastNotifTime = StorageManager.getMetaProp('webpush_last_notif_time')\n const popupFrequency = content.popupFrequency || 7 * 24 * 60 * 60\n\n if (!lastNotifTime || now - lastNotifTime >= popupFrequency * 24 * 60 * 60) {\n document.body.appendChild(wrapper)\n if (!configData.isPreview) { addEventListeners(wrapper) }\n }\n}\n\nexport const createBellIcon = (configData) => {\n if (document.getElementById('bell_wrapper') || Notification.permission === 'granted') return\n\n const { bellIconConfig: { content, style } } = configData\n\n const bellWrapper = createElementWithAttributes('div', { id: 'bell_wrapper' })\n const bellIcon = createElementWithAttributes('img', {\n id: 'bell_icon',\n src: content.icon.type === 'default' ? `data:image/svg+xml;base64,${BELL_BASE64}` : content.icon.url\n })\n\n // For playing gif\n const gifModal = createElementWithAttributes('div', { id: 'gif_modal', style: 'display: none;' })\n const gifImage = createElementWithAttributes('img', {\n id: 'gif_image',\n src: 'https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif'\n })\n const closeModal = createElementWithAttributes('div', { id: 'close_modal', innerHTML: '×' })\n\n gifModal.appendChild(gifImage)\n gifModal.appendChild(closeModal)\n\n bellWrapper.appendChild(bellIcon)\n bellWrapper.appendChild(gifModal)\n if (content.hoverText.enabled) {\n const tooltip = createElementWithAttributes('div', {\n id: 'bell_tooltip',\n textContent: content.hoverText.text\n })\n bellWrapper.appendChild(tooltip)\n }\n\n setElementPosition(bellWrapper, style.card.position)\n // Apply styles\n const styleElement = createElementWithAttributes('style', { textContent: getBellIconStyles(style) })\n\n document.head.appendChild(styleElement)\n document.body.appendChild(bellWrapper)\n\n if (!configData.isPreview) {\n addBellEventListeners(bellWrapper)\n }\n return bellWrapper\n}\n\nexport const setServerKey = (serverKey) => {\n appServerKey = serverKey\n}\n\nexport const addEventListeners = (wrapper) => {\n const primaryButton = wrapper.querySelector('#primaryButton')\n const secondaryButton = wrapper.querySelector('#secondaryButton')\n\n const removeWrapper = () => wrapper.parentNode?.removeChild(wrapper)\n\n primaryButton.addEventListener('click', () => {\n removeWrapper()\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n })\n\n secondaryButton.addEventListener('click', () => {\n StorageManager.setMetaProp('webpush_last_notif_time', Date.now() / 1000)\n removeWrapper()\n })\n}\n\nexport const addBellEventListeners = (bellWrapper) => {\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n bellIcon.addEventListener('click', () => {\n if (Notification.permission === 'denied') {\n toggleGifModal(bellWrapper)\n } else {\n notificationHandler.setApplicationServerKey(appServerKey)\n notificationHandler.setUpWebPushNotifications(null, swPath, null, null)\n if (Notification.permission === 'granted') {\n bellWrapper.remove()\n }\n }\n })\n bellIcon.addEventListener('mouseenter', () => displayTooltip(bellWrapper))\n bellIcon.addEventListener('mouseleave', () => clearTooltip(bellWrapper))\n bellWrapper.querySelector('#close_modal').addEventListener('click', () => toggleGifModal(bellWrapper))\n}\n\nexport const setElementPosition = (element, position) => {\n Object.assign(element.style, {\n inset: 'auto',\n transform: 'none'\n })\n\n const positions = {\n 'Top Right': { inset: '16px 16px auto auto' },\n 'Top Left': { inset: '16px auto auto 16px' },\n 'Bottom Right': { inset: 'auto 16px 16px auto' },\n 'Bottom Left': { inset: 'auto auto 16px 16px' },\n Center: { inset: '50%', transform: 'translate(-50%, -50%)' },\n Top: { inset: '16px auto auto 50%', transform: 'translateX(-50%)' },\n Bottom: { inset: 'auto auto 16px 50%', transform: 'translateX(-50%)' }\n }\n\n Object.assign(element.style, positions[position] || positions['top-right'])\n}\n\nconst displayTooltip = (bellWrapper) => {\n const gifModal = bellWrapper.querySelector('#gif_modal')\n if (gifModal.style.display === 'flex') {\n return\n }\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'flex'\n }\n\n const bellIcon = bellWrapper.querySelector('#bell_icon')\n const bellRect = bellIcon.getBoundingClientRect()\n var midX = window.innerWidth / 2\n var midY = window.innerHeight / 2\n bellWrapper.style['flex-direction'] = bellRect.y > midY ? 'column-reverse' : 'column'\n bellWrapper.style['align-items'] = bellRect.x > midX ? 'flex-end' : 'flex-start'\n}\n\nconst clearTooltip = (bellWrapper) => {\n const tooltip = bellWrapper.querySelector('#bell_tooltip')\n if (tooltip) {\n tooltip.style.display = 'none'\n }\n}\n\nconst toggleGifModal = (bellWrapper) => {\n clearTooltip(bellWrapper)\n const gifModal = bellWrapper.querySelector('#gif_modal')\n gifModal.style.display = gifModal.style.display === 'none' ? 'flex' : 'none'\n}\n","import {\n addToLocalProfileMap,\n arp,\n getCampaignObject,\n saveCampaignObject\n} from './clevertap'\n\nimport {\n CAMP_COOKIE_NAME,\n DISPLAY,\n GLOBAL,\n EV_COOKIE,\n NOTIFICATION_CLICKED,\n WZRK_PREFIX,\n WZRK_ID\n} from './constants'\n\nimport {\n getNow,\n getToday\n} from './datetime'\n\nimport { StorageManager, $ct } from './storage'\nimport RequestDispatcher from './requestDispatcher'\nimport { CTWebPopupImageOnly } from './web-popupImageonly/popupImageonly'\nimport { checkAndRegisterWebInboxElements, initializeWebInbox, processWebInboxSettings, hasWebInboxSettingsInLS, processInboxNotifs } from '../modules/web-inbox/helper'\nimport { renderVisualBuilder } from '../modules/visualBuilder/pageBuilder'\nimport { handleKVpairCampaign, renderPersonalisationBanner, renderPersonalisationCarousel } from './campaignRender/nativeDisplay'\nimport { appendScriptForCustomEvent, getCookieParams, incrementImpression, invokeExternalJs, mergeEventMap, setupClickEvent, staleDataUpdate } from './campaignRender/utilities'\nimport { renderPopUpImageOnly } from './campaignRender/webPopup'\nimport { processWebPushConfig } from '../modules/webPushPrompt/prompt'\n\nconst _tr = (msg, {\n device,\n session,\n request,\n logger\n}) => {\n const _device = device\n const _session = session\n const _request = request\n const _logger = logger\n let _wizCounter = 0\n // Campaign House keeping\n const doCampHouseKeeping = (targetingMsgJson) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const today = getToday()\n\n const incrCount = (obj, campaignId, excludeFromFreqCaps) => {\n let currentCount = 0\n let totalCount = 0\n if (obj[campaignId] != null) {\n currentCount = obj[campaignId]\n }\n currentCount++\n if (obj.tc != null) {\n totalCount = obj.tc\n }\n // if exclude from caps then dont add to total counts\n if (excludeFromFreqCaps < 0) {\n totalCount++\n }\n\n obj.tc = totalCount\n obj[campaignId] = currentCount\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n delete sessionStorage[CAMP_COOKIE_NAME]\n var campTypeObj = {}\n const campObj = getCampaignObject()\n if (targetingMsgJson.display.wtarget_type === 3 && campObj.hasOwnProperty('wi')) {\n campTypeObj = campObj.wi\n } else if ((targetingMsgJson.display.wtarget_type === 0 || targetingMsgJson.display.wtarget_type === 1) && campObj.hasOwnProperty('wp')) {\n campTypeObj = campObj.wp\n } else {\n campTypeObj = {}\n }\n if (campObj.hasOwnProperty('global')) {\n campTypeObj.wp = campObj\n }\n // global session limit. default is 1\n if (targetingMsgJson[DISPLAY].wmc == null) {\n targetingMsgJson[DISPLAY].wmc = 1\n }\n\n // global session limit for web inbox. default is 1\n if (targetingMsgJson[DISPLAY].wimc == null) {\n targetingMsgJson[DISPLAY].wimc = 1\n }\n\n var excludeFromFreqCaps = -1 // efc - Exclude from frequency caps\n let campaignSessionLimit = -1 // mdc - Once per session\n let campaignDailyLimit = -1 // tdc - Once per day\n let campaignTotalLimit = -1 // tlc - Once per user for the duration of campaign\n let totalDailyLimit = -1\n let totalSessionLimit = -1 // wmc - Web Popup Global Session Limit\n let totalInboxSessionLimit = -1 // wimc - Web Inbox Global Session Limit\n\n if (targetingMsgJson[DISPLAY].efc != null) { // exclude from frequency cap\n excludeFromFreqCaps = parseInt(targetingMsgJson[DISPLAY].efc, 10)\n }\n if (targetingMsgJson[DISPLAY].mdc != null) { // Campaign Session Limit\n campaignSessionLimit = parseInt(targetingMsgJson[DISPLAY].mdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tdc != null) { // No of web popups in a day per campaign\n campaignDailyLimit = parseInt(targetingMsgJson[DISPLAY].tdc, 10)\n }\n if (targetingMsgJson[DISPLAY].tlc != null) { // Total lifetime count\n campaignTotalLimit = parseInt(targetingMsgJson[DISPLAY].tlc, 10)\n }\n if (targetingMsgJson[DISPLAY].wmp != null) { // No of campaigns per day\n totalDailyLimit = parseInt(targetingMsgJson[DISPLAY].wmp, 10)\n }\n if (targetingMsgJson[DISPLAY].wmc != null) { // No of campaigns per session\n totalSessionLimit = parseInt(targetingMsgJson[DISPLAY].wmc, 10)\n }\n\n if (targetingMsgJson[DISPLAY].wimc != null) { // No of inbox campaigns per session\n totalInboxSessionLimit = parseInt(targetingMsgJson[DISPLAY].wimc, 10)\n }\n // session level capping\n var sessionObj = campTypeObj[_session.sessionId]\n if (sessionObj) {\n const campaignSessionCount = sessionObj[campaignId]\n const totalSessionCount = sessionObj.tc\n // dnd\n if (campaignSessionCount === 'dnd' && !$ct.dismissSpamControl) {\n return false\n }\n\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n // Inbox session\n if (totalInboxSessionLimit > 0 && totalSessionCount >= totalInboxSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n } else {\n // session\n if (totalSessionLimit > 0 && totalSessionCount >= totalSessionLimit && excludeFromFreqCaps < 0) {\n return false\n }\n }\n\n // campaign session\n if (campaignSessionLimit > 0 && campaignSessionCount >= campaignSessionLimit) {\n return false\n }\n } else {\n sessionObj = {}\n campTypeObj[_session.sessionId] = sessionObj\n }\n\n // daily level capping\n var dailyObj = campTypeObj[today]\n if (dailyObj != null) {\n const campaignDailyCount = dailyObj[campaignId]\n const totalDailyCount = dailyObj.tc\n // daily\n if (totalDailyLimit > 0 && totalDailyCount >= totalDailyLimit && excludeFromFreqCaps < 0) {\n return false\n }\n // campaign daily\n if (campaignDailyLimit > 0 && campaignDailyCount >= campaignDailyLimit) {\n return false\n }\n } else {\n dailyObj = {}\n campTypeObj[today] = dailyObj\n }\n\n var globalObj = campTypeObj[GLOBAL]\n if (globalObj != null) {\n const campaignTotalCount = globalObj[campaignId]\n // campaign total\n if (campaignTotalLimit > 0 && campaignTotalCount >= campaignTotalLimit) {\n return false\n }\n } else {\n globalObj = {}\n campTypeObj[GLOBAL] = globalObj\n }\n }\n // delay\n const displayObj = targetingMsgJson.display\n if (displayObj.delay != null && displayObj.delay > 0) {\n const delay = displayObj.delay\n displayObj.delay = 0\n setTimeout(_tr, delay * 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n return false\n }\n\n incrCount(sessionObj, campaignId, excludeFromFreqCaps)\n incrCount(dailyObj, campaignId, excludeFromFreqCaps)\n incrCount(globalObj, campaignId, excludeFromFreqCaps)\n\n let campKey = 'wp'\n if (targetingMsgJson[DISPLAY].wtarget_type === 3) {\n campKey = 'wi'\n }\n // get ride of stale sessions and day entries\n const newCampObj = {}\n newCampObj[_session.sessionId] = sessionObj\n newCampObj[today] = dailyObj\n newCampObj[GLOBAL] = globalObj\n saveCampaignObject({ [campKey]: newCampObj })\n }\n\n const setupClickUrl = (onClick, targetingMsgJson, contentDiv, divId, isLegacy) => {\n incrementImpression(targetingMsgJson, _request)\n setupClickEvent(onClick, targetingMsgJson, contentDiv, divId, isLegacy, _device, _session)\n }\n\n const handleImageOnlyPopup = (targetingMsgJson) => {\n const divId = 'wzrkImageOnlyDiv'\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n element.remove()\n }\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist\n if (document.getElementById(divId) != null || document.getElementById('intentPreview') != null) {\n return\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n document.body.appendChild(msgDiv)\n if (customElements.get('ct-web-popup-imageonly') === undefined) {\n customElements.define('ct-web-popup-imageonly', CTWebPopupImageOnly)\n }\n return renderPopUpImageOnly(targetingMsgJson, _session)\n }\n\n const isExistingCampaign = (campaignId) => {\n const testIframe = document.getElementById('wiz-iframe-intent') || document.getElementById('wiz-iframe')\n if (testIframe) {\n const iframeDocument = testIframe.contentDocument || testIframe.contentWindow.document\n return iframeDocument.documentElement.innerHTML.includes(campaignId)\n }\n return false\n }\n\n const createTemplate = (targetingMsgJson, isExitIntent) => {\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const displayObj = targetingMsgJson.display\n\n if (displayObj.layout === 1) { // Handling Web Exit Intent\n return showExitIntent(undefined, targetingMsgJson)\n }\n if (displayObj.layout === 3) { // Handling Web Popup Image Only\n handleImageOnlyPopup(targetingMsgJson)\n return\n }\n\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n const divId = 'wizParDiv' + displayObj.layout\n const opacityDivId = 'intentOpacityDiv' + displayObj.layout\n\n if ($ct.dismissSpamControl && document.getElementById(divId) != null) {\n const element = document.getElementById(divId)\n const opacityElement = document.getElementById(opacityDivId)\n if (element) {\n element.remove()\n }\n if (opacityElement) {\n opacityElement.remove()\n }\n }\n if (isExistingCampaign(campaignId)) return\n\n if (document.getElementById(divId) != null) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = divId\n const isBanner = displayObj.layout === 2\n if (isExitIntent) {\n const opacityDiv = document.createElement('div')\n opacityDiv.id = opacityDivId\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n }\n const msgDiv = document.createElement('div')\n msgDiv.id = divId\n const viewHeight = window.innerHeight\n const viewWidth = window.innerWidth\n let legacy = false\n\n if (!isBanner) {\n const marginBottom = viewHeight * 5 / 100\n var contentHeight = 10\n let right = viewWidth * 5 / 100\n let bottomPosition = contentHeight + marginBottom\n let width = viewWidth * 30 / 100 + 20\n let widthPerct = 'width:30%;'\n // for small devices - mobile phones\n if ((/mobile/i.test(navigator.userAgent) || (/mini/i.test(navigator.userAgent))) && /iPad/i.test(navigator.userAgent) === false) {\n width = viewWidth * 85 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:80%;'\n // medium devices - tablets\n } else if ('ontouchstart' in window || (/tablet/i.test(navigator.userAgent))) {\n width = viewWidth * 50 / 100 + 20\n right = viewWidth * 5 / 100\n bottomPosition = viewHeight * 5 / 100\n widthPerct = 'width:50%;'\n }\n // legacy footer notif\n if (displayObj.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden; bottom:' + bottomPosition + 'px !important;width:' + width + 'px !important;right:' + right + 'px !important;position:fixed;z-index:2147483647;')\n } else {\n msgDiv.setAttribute('style', widthPerct + displayObj.iFrameStyle)\n }\n } else {\n msgDiv.setAttribute('style', displayObj.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n\n const borderRadius = displayObj.br === false ? '0' : '8'\n\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (displayObj.preview && displayObj['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, leftTd, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n leftTd = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n leftTd = '#f4f4f4'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"\"\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'\" + divId + \"');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"\" +\n // \"\"+\n '' + imageTd + \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
'\n html = css + title + body\n }\n\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for popup box/banner close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (displayObj['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n const adjustIFrameHeight = () => {\n // adjust iframe and body height of html inside correctly\n contentHeight = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv').scrollHeight\n if (displayObj['custom-editor'] !== true && !isBanner) {\n contentHeight += 25\n }\n document.getElementById('wiz-iframe').contentDocument.body.style.margin = '0px'\n document.getElementById('wiz-iframe').style.height = contentHeight + 'px'\n }\n\n const ua = navigator.userAgent.toLowerCase()\n if (ua.indexOf('safari') !== -1) {\n if (ua.indexOf('chrome') > -1) {\n iframe.onload = () => {\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n } else {\n let inDoc = iframe.contentDocument || iframe.contentWindow\n if (inDoc.document) inDoc = inDoc.document\n // safari iphone 7+ needs this.\n const _timer = setInterval(() => {\n if (inDoc.readyState === 'complete') {\n clearInterval(_timer)\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }, 300)\n }\n } else {\n iframe.onload = () => {\n // adjust iframe and body height of html inside correctly\n adjustIFrameHeight()\n const contentDiv = document.getElementById('wiz-iframe').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, divId, legacy)\n }\n }\n }\n const renderFooterNotification = (targetingMsgJson) => {\n createTemplate(targetingMsgJson, false)\n }\n\n let _callBackCalled = false\n\n const showFooterNotification = (targetingMsgJson) => {\n let onClick = targetingMsgJson.display.onClick\n const displayObj = targetingMsgJson.display\n\n // TODO: Needs wizrocket as a global variable\n if (window.clevertap.hasOwnProperty('notificationCallback') &&\n typeof window.clevertap.notificationCallback !== 'undefined' &&\n typeof window.clevertap.notificationCallback === 'function') {\n const notificationCallback = window.clevertap.notificationCallback\n\n if (!_callBackCalled) {\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n window.clevertap.raiseNotificationClicked = () => {\n if (onClick !== '' && onClick != null) {\n const jsFunc = targetingMsgJson.display.jsFunc\n onClick += getCookieParams(_device, _session)\n\n // invoke js function call\n if (jsFunc != null) {\n // track notification clicked event\n RequestDispatcher.fireRequest(onClick)\n invokeExternalJs(jsFunc, targetingMsgJson)\n return\n }\n // pass on the gcookie|page|scookieId for capturing the click event\n if (targetingMsgJson.display.window === 1) {\n window.open(onClick, '_blank')\n } else {\n window.location = onClick\n }\n }\n }\n window.clevertap.raiseNotificationViewed = () => {\n incrementImpression(targetingMsgJson)\n }\n notificationCallback(inaObj)\n _callBackCalled = true\n }\n } else {\n window.clevertap.popupCurrentWzrkId = targetingMsgJson.wzrk_id\n\n if (displayObj.deliveryTrigger) {\n if (displayObj.deliveryTrigger.inactive) {\n triggerByInactivity(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.scroll) {\n triggerByScroll(targetingMsgJson)\n }\n if (displayObj.deliveryTrigger.isExitIntent) {\n exitintentObj = targetingMsgJson\n window.document.body.onmouseleave = showExitIntent\n }\n // delay\n const delay = displayObj.delay || displayObj.deliveryTrigger.deliveryDelayed\n if (delay != null && delay > 0) {\n setTimeout(() => {\n renderFooterNotification(targetingMsgJson)\n }, delay * 1000)\n }\n } else {\n renderFooterNotification(targetingMsgJson)\n }\n\n if (window.clevertap.hasOwnProperty('popupCallbacks') &&\n typeof window.clevertap.popupCallbacks !== 'undefined' &&\n typeof window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id] === 'function') {\n const popupCallback = window.clevertap.popupCallbacks[targetingMsgJson.wzrk_id]\n\n const inaObj = {}\n inaObj.msgContent = targetingMsgJson.msgContent\n inaObj.msgId = targetingMsgJson.wzrk_id\n\n if (targetingMsgJson.wzrk_pivot) {\n inaObj.pivotId = targetingMsgJson.wzrk_pivot\n }\n\n var msgCTkv = []\n for (var wzrkPrefixKey in targetingMsgJson) {\n // ADD WZRK PREFIX KEY VALUE PAIRS\n if (wzrkPrefixKey.startsWith(WZRK_PREFIX) && wzrkPrefixKey !== WZRK_ID) {\n const wzrkJson = { [wzrkPrefixKey]: targetingMsgJson[wzrkPrefixKey] }\n msgCTkv.push(wzrkJson)\n }\n }\n\n if (msgCTkv.length > 0) {\n inaObj.msgCTkv = msgCTkv\n }\n if (targetingMsgJson.display.kv != null) {\n inaObj.kv = targetingMsgJson.display.kv\n }\n\n // PUBLIC API TO RECORD CLICKED EVENT\n window.clevertap.raisePopupNotificationClicked = (notificationData) => {\n if (!notificationData || !notificationData.msgId) { return }\n\n const eventData = {}\n eventData.type = 'event'\n eventData.evtName = NOTIFICATION_CLICKED\n eventData.evtData = { [WZRK_ID]: notificationData.msgId }\n if (targetingMsgJson.wzrk_pivot) {\n eventData.evtData = { ...eventData.evtData, wzrk_pivot: notificationData.pivotId }\n }\n\n // WZRK PREFIX KEY VALUE PAIRS\n if (notificationData.msgCTkv) {\n for (var wzrkPrefixObj of notificationData.msgCTkv) {\n eventData.evtData = { ...eventData.evtData, ...wzrkPrefixObj }\n }\n }\n\n _request.processEvent(eventData)\n }\n popupCallback(inaObj)\n }\n }\n }\n\n const triggerByInactivity = (targetNotif) => {\n const IDLE_TIME_THRESHOLD = targetNotif.display.deliveryTrigger.inactive * 1000 // Convert to milliseconds\n let idleTimer\n const events = ['mousemove', 'keypress', 'scroll', 'mousedown', 'touchmove', 'click']\n const resetIdleTimer = () => {\n clearTimeout(idleTimer)\n idleTimer = setTimeout(() => {\n renderFooterNotification(targetNotif)\n removeEventListeners()\n }, IDLE_TIME_THRESHOLD)\n }\n const eventHandler = () => {\n resetIdleTimer()\n }\n const setupEventListeners = () => {\n events.forEach(eventType => window.addEventListener(eventType, eventHandler, { passive: true }))\n }\n const removeEventListeners = () => {\n events.forEach(eventType => window.removeEventListener(eventType, eventHandler))\n }\n setupEventListeners()\n resetIdleTimer()\n return removeEventListeners// Return a cleanup function\n }\n\n const triggerByScroll = (targetNotif) => {\n const calculateScrollPercentage = () => {\n const { scrollHeight, clientHeight, scrollTop } = document.documentElement\n return (scrollTop / (scrollHeight - clientHeight)) * 100\n }\n const scrollListener = () => {\n const scrollPercentage = calculateScrollPercentage()\n if (scrollPercentage >= targetNotif.display.deliveryTrigger.scroll) {\n renderFooterNotification(targetNotif)\n window.removeEventListener('scroll', throttledScrollListener)\n }\n }\n const throttle = (func, limit) => {\n let inThrottle = false\n return function (...args) {\n const context = this\n if (!inThrottle) {\n func.apply(context, args)\n inThrottle = true\n setTimeout(() => {\n inThrottle = false\n }, limit)\n }\n }\n }\n const throttledScrollListener = throttle(scrollListener, 200)\n window.addEventListener('scroll', throttledScrollListener, { passive: true })\n return () => window.removeEventListener('scroll', throttledScrollListener)// Return a cleanup function\n }\n\n let exitintentObj\n const showExitIntent = (event, targetObj) => {\n if (event?.clientY > 0) return\n const targetingMsgJson = targetObj || exitintentObj\n\n const campaignId = targetingMsgJson.wzrk_id.split('_')[0]\n const layout = targetingMsgJson.display.layout\n if (isExistingCampaign(campaignId)) return\n\n if (targetingMsgJson.display.wtarget_type === 0 && (layout === 0 || layout === 2 || layout === 3)) {\n createTemplate(targetingMsgJson, true)\n return\n }\n if (doCampHouseKeeping(targetingMsgJson) === false) {\n return\n }\n\n if ($ct.dismissSpamControl && targetingMsgJson.display.wtarget_type === 0) {\n const intentPreview = document.getElementById('intentPreview')\n const intentOpacityDiv = document.getElementById('intentOpacityDiv')\n if (intentPreview && intentOpacityDiv) {\n intentPreview.remove()\n intentOpacityDiv.remove()\n }\n }\n\n // ImageOnly campaign and Interstitial/Exit Intent shouldn't coexist`\n if (document.getElementById('intentPreview') != null || document.getElementById('wzrkImageOnlyDiv') != null) {\n return\n }\n // dont show exit intent on tablet/mobile - only on desktop\n if (targetingMsgJson.display.layout == null &&\n ((/mobile/i.test(navigator.userAgent)) || (/mini/i.test(navigator.userAgent)) || (/iPad/i.test(navigator.userAgent)) ||\n ('ontouchstart' in window) || (/tablet/i.test(navigator.userAgent)))) {\n return\n }\n\n $ct.campaignDivMap[campaignId] = 'intentPreview'\n let legacy = false\n const opacityDiv = document.createElement('div')\n opacityDiv.id = 'intentOpacityDiv'\n const opacity = targetingMsgJson.display.opacity || 0.7\n const rgbaColor = `rgba(0,0,0,${opacity})`\n opacityDiv.setAttribute('style', `position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ${rgbaColor};`)\n document.body.appendChild(opacityDiv)\n\n const msgDiv = document.createElement('div')\n msgDiv.id = 'intentPreview'\n\n if (targetingMsgJson.display.proto == null) {\n legacy = true\n msgDiv.setAttribute('style', 'display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;')\n } else {\n msgDiv.setAttribute('style', targetingMsgJson.display.iFrameStyle)\n }\n document.body.appendChild(msgDiv)\n const iframe = document.createElement('iframe')\n const borderRadius = targetingMsgJson.display.br === false ? '0' : '8'\n iframe.frameborder = '0px'\n iframe.marginheight = '0px'\n iframe.marginwidth = '0px'\n iframe.scrolling = 'no'\n iframe.id = 'wiz-iframe-intent'\n const onClick = targetingMsgJson.display.onClick\n let pointerCss = ''\n if (onClick !== '' && onClick != null) {\n pointerCss = 'cursor:pointer;'\n }\n if (targetingMsgJson.display.preview && targetingMsgJson.display['custom-editor']) {\n iframe.sandbox = 'allow-scripts allow-popups allow-popups-to-escape-sandbox'\n }\n let html\n // direct html\n if (targetingMsgJson.msgContent.type === 1) {\n html = targetingMsgJson.msgContent.html\n html = html.replace(/##campaignId##/g, campaignId)\n html = html.replace(/##campaignId_batchId##/g, targetingMsgJson.wzrk_id)\n } else {\n const css = '' +\n ''\n\n let bgColor, textColor, btnBg, btColor\n if (targetingMsgJson.display.theme === 'dark') {\n bgColor = '#2d2d2e'\n textColor = '#eaeaea'\n btnBg = '#353535'\n btColor = '#ffffff'\n } else {\n bgColor = '#ffffff'\n textColor = '#000000'\n btnBg = '#a5a6a6'\n btColor = '#ffffff'\n }\n const titleText = targetingMsgJson.msgContent.title\n const descriptionText = targetingMsgJson.msgContent.description\n let ctaText = ''\n if (targetingMsgJson.msgContent.ctaText != null && targetingMsgJson.msgContent.ctaText !== '') {\n ctaText = \"'\n }\n\n let imageTd = ''\n if (targetingMsgJson.msgContent.imageUrl != null && targetingMsgJson.msgContent.imageUrl !== '') {\n imageTd = \"
\"
'\n }\n const onClickStr = 'parent.$WZRK_WR.closeIframe(' + campaignId + \",'intentPreview');\"\n const title = \"
\" +\n \"×\" +\n \"
\" +\n \"
\" + titleText + '
'\n const body = \"
\" + descriptionText + '
' + imageTd + ctaText +\n '
'\n html = css + title + body\n }\n iframe.setAttribute('style', 'z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;')\n msgDiv.appendChild(iframe)\n\n // Dispatch event for interstitial/exit intent close\n const closeCampaign = new Event('CT_campaign_rendered')\n document.dispatchEvent(closeCampaign)\n\n if (targetingMsgJson.display['custom-editor']) {\n html = appendScriptForCustomEvent(targetingMsgJson, html)\n }\n iframe.srcdoc = html\n\n iframe.onload = () => {\n const contentDiv = document.getElementById('wiz-iframe-intent').contentDocument.getElementById('contentDiv')\n setupClickUrl(onClick, targetingMsgJson, contentDiv, 'intentPreview', legacy)\n }\n }\n\n if (!document.body) {\n if (_wizCounter < 6) {\n _wizCounter++\n setTimeout(_tr, 1000, msg, {\n device: _device,\n session: _session,\n request: _request,\n logger: _logger\n })\n }\n return\n }\n const processNativeDisplayArr = (arrInAppNotifs) => {\n Object.keys(arrInAppNotifs).map(key => {\n var elementId, id\n if (arrInAppNotifs[key].display.divId) {\n elementId = arrInAppNotifs[key].display.divId\n id = document.getElementById(elementId)\n } else {\n elementId = arrInAppNotifs[key].display.divSelector\n id = document.querySelector(elementId)\n }\n if (id !== null) {\n arrInAppNotifs[key].msgContent.type === 2 ? renderPersonalisationBanner(arrInAppNotifs[key]) : renderPersonalisationCarousel(arrInAppNotifs[key])\n delete arrInAppNotifs[key]\n }\n })\n }\n\n const addLoadListener = (arrInAppNotifs) => {\n window.addEventListener('load', () => {\n let count = 0\n if (count < 20) {\n const t = setInterval(() => {\n processNativeDisplayArr(arrInAppNotifs)\n if (Object.keys(arrInAppNotifs).length === 0 || count === 20) {\n clearInterval(t)\n arrInAppNotifs = {}\n }\n count++\n }, 500)\n }\n })\n }\n\n if (msg.inapp_notifs != null) {\n const arrInAppNotifs = {}\n for (let index = 0; index < msg.inapp_notifs.length; index++) {\n const targetNotif = msg.inapp_notifs[index]\n if (targetNotif.display.wtarget_type == null || targetNotif.display.wtarget_type === 0) {\n showFooterNotification(targetNotif)\n } else if (targetNotif.display.wtarget_type === 1) { // if display['wtarget_type']==1 then exit intent\n exitintentObj = targetNotif\n window.document.body.onmouseleave = showExitIntent\n } else if (targetNotif.display.wtarget_type === 2) { // if display['wtarget_type']==2 then web native display\n if (targetNotif.msgContent.type === 1) {\n handleKVpairCampaign(targetNotif)\n } else if (targetNotif.msgContent.type === 2 || targetNotif.msgContent.type === 3) { // Check for banner and carousel\n const element = targetNotif.display.divId ? document.getElementById(targetNotif.display.divId) : document.querySelector(targetNotif.display.divSelector)\n if (element !== null) {\n targetNotif.msgContent.type === 2 ? renderPersonalisationBanner(targetNotif) : renderPersonalisationCarousel(targetNotif)\n } else {\n arrInAppNotifs[targetNotif.wzrk_id.split('_')[0]] = targetNotif // Add targetNotif to object\n }\n } else if (targetNotif.msgContent.type === 4) {\n renderVisualBuilder(targetNotif, false)\n } else {\n showFooterNotification(targetNotif)\n }\n }\n }\n // Process banner or carousel campaign array\n if (Object.keys(arrInAppNotifs).length) {\n if (document.readyState === 'complete') {\n processNativeDisplayArr(arrInAppNotifs)\n } else {\n addLoadListener(arrInAppNotifs)\n }\n }\n }\n\n const handleInboxNotifications = () => {\n if (msg.inbox_preview) {\n processInboxNotifs(msg)\n return\n }\n if (msg.inbox_notifs) {\n const msgArr = []\n for (let index = 0; index < msg.inbox_notifs.length; index++) {\n if (doCampHouseKeeping(msg.inbox_notifs[index]) !== false) {\n msgArr.push(msg.inbox_notifs[index])\n }\n }\n processInboxNotifs(msgArr)\n }\n }\n\n if (msg.webInboxSetting || msg.inbox_notifs != null) {\n /**\n * When the user visits a website for the 1st time after web inbox channel is setup,\n * we need to initialise the inbox here because the initializeWebInbox method within init will not be executed\n * as we would not have any entry related to webInboxSettings in the LS\n */\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n }\n if ($ct.inbox === null) {\n msg.webInboxSetting && processWebInboxSettings(msg.webInboxSetting)\n initializeWebInbox(_logger)\n .then(() => {\n handleInboxNotifications()\n })\n .catch(e => {})\n } else {\n handleInboxNotifications()\n }\n }\n\n if (msg.webPushConfig) {\n processWebPushConfig(msg.webPushConfig, logger, request)\n }\n\n if (msg.vars) {\n $ct.variableStore.mergeVariables(msg.vars)\n return\n }\n\n if (StorageManager._isLocalStorageSupported()) {\n try {\n if (msg.evpr != null) {\n const eventsMap = msg.evpr.events\n const profileMap = msg.evpr.profile\n const syncExpiry = msg.evpr.expires_in\n const now = getNow()\n StorageManager.setMetaProp('lsTime', now)\n StorageManager.setMetaProp('exTs', syncExpiry)\n mergeEventMap(eventsMap)\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n if ($ct.globalProfileMap == null) {\n addToLocalProfileMap(profileMap, true)\n } else {\n addToLocalProfileMap(profileMap, false)\n }\n }\n if (msg.arp != null) {\n arp(msg.arp)\n }\n if (msg.inapp_stale != null && msg.inapp_stale.length > 0) {\n // web popup stale\n staleDataUpdate(msg.inapp_stale, 'wp')\n }\n if (msg.inbox_stale != null && msg.inbox_stale.length > 0) {\n // web inbox stale\n staleDataUpdate(msg.inbox_stale, 'wi')\n }\n } catch (e) {\n _logger.error('Unable to persist evrp/arp: ' + e)\n }\n }\n}\n\nexport default _tr\n","import {\n StorageManager\n} from '../util/storage'\nexport default class User {\n #isPersonalisationActive\n\n constructor ({\n isPersonalisationActive\n }) {\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n getTotalVisits () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n let visitCount = StorageManager.getMetaProp('sc')\n if (visitCount == null) {\n visitCount = 1\n }\n return visitCount\n }\n\n getLastVisit () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n const prevSession = StorageManager.getMetaProp('ps')\n if (prevSession != null) {\n return new Date(prevSession * 1000)\n }\n }\n}\n","import {\n CLEVERTAP_ERROR_PREFIX\n} from '../util/messages'\n\nexport const logLevels = {\n DISABLE: 0,\n ERROR: 1,\n INFO: 2,\n DEBUG: 3,\n DEBUG_PE: 4\n}\n\nexport class Logger {\n #logLevel\n wzrkError = {}\n constructor (logLevel) {\n this.#logLevel = logLevel == null ? logLevel : logLevels.INFO\n this.wzrkError = {}\n }\n\n get logLevel () {\n return this.#logLevel\n }\n\n set logLevel (logLevel) {\n this.#logLevel = logLevel\n }\n\n error (message) {\n if (this.#logLevel >= logLevels.ERROR) {\n this.#log('error', message)\n }\n }\n\n info (message) {\n if (this.#logLevel >= logLevels.INFO) {\n this.#log('log', message)\n }\n }\n\n debug (message) {\n if (this.#logLevel >= logLevels.DEBUG || this.#isLegacyDebug) {\n this.#log('debug', message)\n }\n }\n\n debugPE (message) {\n if (this.#logLevel >= logLevels.DEBUG_PE) {\n this.#log('debug_pe', message)\n }\n }\n\n reportError (code, description) {\n this.wzrkError.c = code\n this.wzrkError.d = description\n this.error(`${CLEVERTAP_ERROR_PREFIX} ${code}: ${description}`)\n }\n\n #log (level, message) {\n if (window.console) {\n try {\n const ts = new Date().getTime()\n console[level](`CleverTap [${ts}]: ${message}`)\n } catch (e) {}\n }\n }\n\n get #isLegacyDebug () {\n return (typeof sessionStorage !== 'undefined' && sessionStorage.WZRK_D === '')\n }\n}\n\nexport default {\n Logger,\n logLevels\n}\n","import { singleQuoteRegex, SCOOKIE_EXP_TIME_IN_SECS } from '../util/constants'\nimport { isObject } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { StorageManager } from '../util/storage'\nimport { getHostName } from '../util/url'\n\nexport default class SessionManager {\n #logger\n #sessionId\n #isPersonalisationActive\n cookieName // SCOOKIE_NAME\n scookieObj\n\n constructor ({\n logger,\n isPersonalisationActive\n }) {\n this.sessionId = StorageManager.getMetaProp('cs')\n this.#logger = logger\n this.#isPersonalisationActive = isPersonalisationActive\n }\n\n get sessionId () {\n return this.#sessionId\n }\n\n set sessionId (sessionId) {\n this.#sessionId = sessionId\n }\n\n getSessionCookieObject () {\n let scookieStr = StorageManager.readCookie(this.cookieName)\n let obj = {}\n\n if (scookieStr != null) {\n // converting back single quotes to double for JSON parsing - http://www.iandevlin.com/blog/2012/04/html5/cookies-json-localstorage-and-opera\n scookieStr = scookieStr.replace(singleQuoteRegex, '\"')\n\n obj = JSON.parse(scookieStr)\n if (!isObject(obj)) {\n obj = {}\n } else {\n if (typeof obj.t !== 'undefined') { // check time elapsed since last request\n const lastTime = obj.t\n const now = getNow()\n if ((now - lastTime) > (SCOOKIE_EXP_TIME_IN_SECS + 60)) {\n // adding 60 seconds to compensate for in-journey requests\n // ideally the cookie should've died after SCOOKIE_EXP_TIME_IN_SECS but it's still around as we can read\n // hence we shouldn't use it.\n obj = {}\n }\n }\n }\n }\n this.scookieObj = obj\n return obj\n }\n\n setSessionCookieObject (obj) {\n const objStr = JSON.stringify(obj)\n StorageManager.createBroadCookie(this.cookieName, objStr, SCOOKIE_EXP_TIME_IN_SECS, getHostName())\n }\n\n manageSession (session) {\n // first time. check if current session id in localstorage is same\n // if not same then prev = current and current = this new session\n if (typeof this.sessionId === 'undefined' || this.sessionId !== session) {\n const currentSessionInLS = StorageManager.getMetaProp('cs')\n // if sessionId in meta is undefined - set current to both\n if (typeof currentSessionInLS === 'undefined') {\n StorageManager.setMetaProp('ps', session)\n StorageManager.setMetaProp('cs', session)\n StorageManager.setMetaProp('sc', 1)\n } else if (currentSessionInLS !== session) {\n // not same as session in local storage. new session\n StorageManager.setMetaProp('ps', currentSessionInLS)\n StorageManager.setMetaProp('cs', session)\n let sessionCount = StorageManager.getMetaProp('sc')\n if (typeof sessionCount === 'undefined') {\n sessionCount = 0\n }\n StorageManager.setMetaProp('sc', sessionCount + 1)\n }\n this.sessionId = session\n }\n }\n\n getTimeElapsed () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n if (this.scookieObj != null) { // TODO: check logic?\n this.scookieObj = this.getSessionCookieObject()\n }\n const sessionStart = this.scookieObj.s\n if (sessionStart != null) {\n const ts = getNow()\n return Math.floor(ts - sessionStart)\n }\n }\n\n getPageCount () {\n if (!this.#isPersonalisationActive()) {\n return\n }\n\n if (this.scookieObj != null) { // TODO: check logic\n this.scookieObj = this.getSessionCookieObject()\n }\n return this.scookieObj.p\n }\n}\n","import { CAMP_COOKIE_NAME, CLEAR, EVT_PUSH, EV_COOKIE, FIRE_PUSH_UNREGISTERED, LCOOKIE_NAME, PUSH_SUBSCRIPTION_DATA, WEBPUSH_LS_KEY } from '../util/constants'\nimport { isObjectEmpty, isValueValid, removeUnsupportedChars } from '../util/datatypes'\nimport { getNow } from '../util/datetime'\nimport { compressData } from '../util/encoder'\nimport RequestDispatcher from '../util/requestDispatcher'\nimport { StorageManager, $ct } from '../util/storage'\nimport { addToURL } from '../util/url'\nimport { getCampaignObjForLc } from '../util/clevertap'\n\nlet seqNo = 0\nlet requestTime = 0\n\nexport default class RequestManager {\n #logger\n #account\n #device\n #session\n #isPersonalisationActive\n #clearCookie = false\n processingBackup = false\n\n constructor ({ logger, account, device, session, isPersonalisationActive }) {\n this.#logger = logger\n this.#account = account\n this.#device = device\n this.#session = session\n this.#isPersonalisationActive = isPersonalisationActive\n\n RequestDispatcher.logger = logger\n RequestDispatcher.device = device\n RequestDispatcher.account = account\n }\n\n processBackupEvents () {\n const backupMap = StorageManager.readFromLSorCookie(LCOOKIE_NAME)\n if (typeof backupMap === 'undefined' || backupMap === null) {\n return\n }\n this.processingBackup = true\n for (const idx in backupMap) {\n if (backupMap.hasOwnProperty(idx)) {\n const backupEvent = backupMap[idx]\n if (typeof backupEvent.fired === 'undefined') {\n this.#logger.debug('Processing backup event : ' + backupEvent.q)\n if (typeof backupEvent.q !== 'undefined') {\n RequestDispatcher.fireRequest(backupEvent.q)\n }\n backupEvent.fired = true\n }\n }\n }\n StorageManager.saveToLSorCookie(LCOOKIE_NAME, backupMap)\n this.processingBackup = false\n }\n\n addSystemDataToObject (dataObject, ignoreTrim) {\n // ignore trim for chrome notifications; undefined everywhere else\n if (typeof ignoreTrim === 'undefined') {\n dataObject = removeUnsupportedChars(dataObject, this.#logger)\n }\n\n if (!isObjectEmpty(this.#logger.wzrkError)) {\n dataObject.wzrk_error = this.#logger.wzrkError\n this.#logger.wzrkError = {}\n }\n\n dataObject.id = this.#account.id\n\n if (isValueValid(this.#device.gcookie)) {\n dataObject.g = this.#device.gcookie\n }\n\n const obj = this.#session.getSessionCookieObject()\n dataObject.s = obj.s // session cookie\n dataObject.pg = (typeof obj.p === 'undefined') ? 1 : obj.p // Page count\n let proto = document.location.protocol\n proto = proto.replace(':', '')\n dataObject.af = { ...dataObject.af, lib: 'web-sdk-v$$PACKAGE_VERSION$$', protocol: proto, ...$ct.flutterVersion } // app fields\n if (sessionStorage.hasOwnProperty('WZRK_D')) { dataObject.debug = true }\n\n return dataObject\n }\n\n addFlags (data) {\n // check if cookie should be cleared.\n this.#clearCookie = StorageManager.getAndClearMetaProp(CLEAR)\n if (this.#clearCookie !== undefined && this.#clearCookie) {\n data.rc = true\n this.#logger.debug('reset cookie sent in request and cleared from meta for future requests.')\n }\n if (this.#isPersonalisationActive()) {\n const lastSyncTime = StorageManager.getMetaProp('lsTime')\n const expirySeconds = StorageManager.getMetaProp('exTs')\n\n // dsync not found in local storage - get data from server\n if (typeof lastSyncTime === 'undefined' || typeof expirySeconds === 'undefined') {\n data.dsync = true\n return\n }\n const now = getNow()\n // last sync time has expired - get fresh data from server\n if (lastSyncTime + expirySeconds < now) {\n data.dsync = true\n }\n }\n }\n\n // saves url to backup cache and fires the request\n /**\n *\n * @param {string} url\n * @param {boolean} override whether the request can go through or not\n * @param {Boolean} sendOULFlag - true in case of a On User Login request\n */\n saveAndFireRequest (url, override, sendOULFlag, evtName) {\n const now = getNow()\n url = addToURL(url, 'rn', ++$ct.globalCache.REQ_N)\n const data = url + '&i=' + now + '&sn=' + seqNo\n StorageManager.backupEvent(data, $ct.globalCache.REQ_N, this.#logger)\n\n // if offline is set to true, save the request in backup and return\n if ($ct.offline) return\n // if there is no override\n // and an OUL request is not in progress\n // then process the request as it is\n // else block the request\n // note - $ct.blockRequest should ideally be used for override\n if ((!override || (this.#clearCookie !== undefined && this.#clearCookie)) && !window.isOULInProgress) {\n if (now === requestTime) {\n seqNo++\n } else {\n requestTime = now\n seqNo = 0\n }\n window.oulReqN = $ct.globalCache.REQ_N\n RequestDispatcher.fireRequest(data, false, sendOULFlag, evtName)\n } else {\n this.#logger.debug(`Not fired due to override - ${$ct.blockRequest} or clearCookie - ${this.#clearCookie} or OUL request in progress - ${window.isOULInProgress}`)\n }\n }\n\n unregisterTokenForGuid (givenGUID) {\n const payload = StorageManager.readFromLSorCookie(PUSH_SUBSCRIPTION_DATA)\n // Send unregister event only when token is available\n if (payload) {\n const data = {}\n data.type = 'data'\n if (isValueValid(givenGUID)) {\n data.g = givenGUID\n }\n data.action = 'unregister'\n data.id = this.#account.id\n\n const obj = this.#session.getSessionCookieObject()\n\n data.s = obj.s // session cookie\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n RequestDispatcher.fireRequest(pageLoadUrl, true)\n StorageManager.saveToLSorCookie(FIRE_PUSH_UNREGISTERED, false)\n }\n // REGISTER TOKEN\n this.registerToken(payload)\n }\n\n registerToken (payload) {\n if (!payload) return\n // add gcookie etc to the payload\n payload = this.addSystemDataToObject(payload, true)\n payload = JSON.stringify(payload)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'data')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(payload, this.#logger))\n RequestDispatcher.fireRequest(pageLoadUrl)\n // set in localstorage\n StorageManager.save(WEBPUSH_LS_KEY, 'ok')\n }\n\n processEvent (data) {\n this.#addToLocalEventMap(data.evtName)\n data = this.addSystemDataToObject(data, undefined)\n this.addFlags(data)\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.saveAndFireRequest(pageLoadUrl, $ct.blockRequest, false, data.evtName)\n }\n\n #addToLocalEventMap (evtName) {\n if (StorageManager._isLocalStorageSupported()) {\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = StorageManager.readFromLSorCookie(EV_COOKIE)\n if (typeof $ct.globalEventsMap === 'undefined') {\n $ct.globalEventsMap = {}\n }\n }\n\n const nowTs = getNow()\n let evtDetail = $ct.globalEventsMap[evtName]\n if (typeof evtDetail !== 'undefined') {\n evtDetail[2] = nowTs\n evtDetail[0]++\n } else {\n evtDetail = []\n evtDetail.push(1)\n evtDetail.push(nowTs)\n evtDetail.push(nowTs)\n }\n $ct.globalEventsMap[evtName] = evtDetail\n StorageManager.saveToLSorCookie(EV_COOKIE, $ct.globalEventsMap)\n }\n }\n\n post (url, body) {\n return fetch(url, {\n method: 'post',\n headers: { 'Content-Type': 'application/json' },\n body: body\n })\n .then((response) => {\n if (response.ok) {\n return response.json()\n }\n throw response\n })\n .then((data) => {\n this.#logger.debug('Sync data successful', data)\n return data\n })\n .catch((e) => {\n this.#logger.debug('Error in syncing variables', e)\n throw e\n })\n }\n}\n","import {\n isObjectEmpty\n} from '../util/datatypes'\nimport {\n EVT_PUSH,\n USEIP_KEY,\n OPTOUT_KEY,\n CT_OPTOUT_KEY\n} from '../util/constants'\nimport {\n StorageManager,\n $ct\n} from '../util/storage'\nimport {\n compressData\n} from '../util/encoder'\nimport {\n addToURL\n} from '../util/url'\n\nexport default class Privacy extends Array {\n #request\n #account\n #oldValues\n #logger\n\n constructor ({\n request,\n account,\n logger\n },\n values) {\n super()\n this.#logger = logger\n this.#request = request\n this.#account = account\n this.#oldValues = values\n }\n\n push (...privacyArr) {\n if ($ct.isPrivacyArrPushed) {\n this.#processPrivacyArray($ct.privacyArray.length > 0 ? $ct.privacyArray : privacyArr)\n } else {\n $ct.privacyArray.push(...privacyArr)\n }\n return 0\n }\n\n _processOldValues () {\n if (this.#oldValues) {\n this.#processPrivacyArray(this.#oldValues)\n }\n this.#oldValues = null\n }\n\n #processPrivacyArray (privacyArr) {\n if (Array.isArray(privacyArr) && privacyArr.length > 0) {\n const privacyObj = privacyArr.reduce((prev, curr) => ({ ...prev, ...curr }), {})\n let data = {}\n const profileObj = {}\n var optOut = false\n\n if (privacyObj.hasOwnProperty(OPTOUT_KEY)) {\n optOut = privacyObj[OPTOUT_KEY]\n if (typeof optOut === 'boolean') {\n profileObj[CT_OPTOUT_KEY] = optOut\n // should be true when user wants to opt in\n $ct.isOptInRequest = !optOut\n }\n }\n if (privacyObj.hasOwnProperty(USEIP_KEY)) {\n const useIP = privacyObj[USEIP_KEY]\n const shouldUseIP = (typeof useIP === 'boolean') ? useIP : false\n StorageManager.setMetaProp(USEIP_KEY, shouldUseIP)\n }\n if (!isObjectEmpty(profileObj)) {\n data.type = 'profile'\n data.profile = profileObj\n data = this.#request.addSystemDataToObject(data, undefined)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n pageLoadUrl = addToURL(pageLoadUrl, OPTOUT_KEY, optOut ? 'true' : 'false')\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n privacyArr.splice(0, privacyArr.length)\n }\n }\n }\n}\n","export class Variable {\n #variableStore\n\n /**\n * Creates an instance of the Variable class.\n *\n * @constructor\n * @param {VariableStore} options.variableStore - The VariableStore instance for registration.\n * @param {string|null} options.name - The name of the variable.\n * @param {*} options.defaultValue - The default value of the variable.\n * @param {*} options.value - The current value of the variable.\n * @param {string|null} options.type - The type of the variable (string, number, boolean).\n * @param {boolean} options.hadStarted - A flag indicating whether the variable has started (used internally).\n * @param {Function[]} options.valueChangedCallbacks - Array to store callbacks to be executed when the variable value changes.\n */\n constructor ({ variableStore }) {\n this.name = null\n this.defaultValue = null\n this.value = null\n this.type = null\n this.hadStarted = false\n this.valueChangedCallbacks = []\n this.#variableStore = variableStore\n }\n\n getValue () {\n return this.value\n }\n\n getdefaultValue () {\n return this.defaultValue\n }\n\n /**\n * Defines a new variable with the provided name, default value, and variable store.\n * @static\n * @param {string} name - The name of the variable.\n * @param {*} defaultValue - The default value of the variable.\n * @param {VariableStore} variableStore - The VariableStore instance for registration.\n * @returns {Variable|null} - The created Variable instance or null if invalid parameters are provided.\n */\n static define (name, defaultValue, variableStore) {\n if (!name || typeof name !== 'string') {\n console.error('Empty or invalid name parameter provided.')\n return null\n }\n if (name.startsWith('.') || name.endsWith('.')) {\n console.error('Variable name starts or ends with a `.` which is not allowed: ' + name)\n return null\n }\n\n const typeOfDefaultValue = typeof defaultValue\n if (typeOfDefaultValue !== 'string' && typeOfDefaultValue !== 'number' && typeOfDefaultValue !== 'boolean') {\n console.error('Only primitive types (string, number, boolean) are accepted as value')\n return null\n }\n\n const existing = variableStore.getVariable(name)\n if (existing) {\n return existing\n }\n\n const varInstance = new Variable({ variableStore })\n try {\n varInstance.name = name\n varInstance.defaultValue = defaultValue\n varInstance.value = defaultValue\n varInstance.type = typeOfDefaultValue\n variableStore.registerVariable(varInstance)\n varInstance.update(defaultValue)\n } catch (error) {\n console.error(error)\n }\n return varInstance\n }\n\n /**\n * Updates the variable's value, triggering callbacks if hasVarsRequestCompleted is returned true.\n * @param {*} newValue - The new value to be assigned to the variable.\n */\n update (newValue) {\n const oldValue = this.value\n this.value = newValue\n if (newValue === null && oldValue === null) {\n return\n }\n if (newValue !== null && newValue === oldValue && this.hadStarted) {\n return\n }\n if (this.#variableStore.hasVarsRequestCompleted()) {\n this.hadStarted = true\n this.triggerValueChanged()\n }\n }\n\n /**\n * Invokes all registered callbacks when the variable value changes.\n */\n triggerValueChanged () {\n this.valueChangedCallbacks.forEach((onValueChanged) => {\n onValueChanged(this)\n })\n }\n\n /**\n * Adds a callback function to the array and triggers it immediately if variable requests have completed.\n * @param {Function} onValueChanged - The callback function to be added.\n */\n addValueChangedCallback (onValueChanged) {\n if (!onValueChanged) {\n console.log('Invalid callback parameter provided.')\n return\n }\n this.valueChangedCallbacks.push(onValueChanged)\n\n if (this.#variableStore.hasVarsRequestCompleted()) {\n onValueChanged(this)\n }\n }\n\n /**\n * Removes a callback function from the array.\n * @param {Function} onValueChanged - The callback function to be removed.\n */\n removeValueChangedCallback (onValueChanged) {\n const index = this.valueChangedCallbacks.indexOf(onValueChanged)\n if (index !== -1) {\n this.valueChangedCallbacks.splice(index, 1)\n }\n }\n\n /**\n * Resets the `hadStarted` flag to false.\n */\n clearStartFlag () {\n this.hadStarted = false\n }\n}\n","import { VARIABLES, WZRK_FETCH } from '../../util/constants'\nimport { StorageManager, $ct } from '../../util/storage'\nclass VariableStore {\n #logger\n #account\n #request\n #event\n\n #variables\n #remoteVariables\n #fetchCallback\n #variablesChangedCallbacks\n #oneTimeVariablesChangedCallbacks\n #hasVarsRequestCompleted = false\n\n constructor ({ logger, request, account, event }) {\n this.#logger = logger\n this.#account = account\n this.#request = request\n this.#event = event\n\n this.#variables = {}\n this.#remoteVariables = {}\n this.#variablesChangedCallbacks = []\n this.#oneTimeVariablesChangedCallbacks = []\n\n $ct.variableStore = this\n }\n\n /**\n * Registers a variable instance in the store.\n * @param {Object} varInstance - The variable instance to be registered.\n */\n registerVariable (varInstance) {\n const { name } = varInstance\n this.#variables[name] = varInstance\n console.log('registerVariable', this.#variables)\n }\n\n /**\n * Retrieves a variable by its name.\n * @param {string} name - The name of the variable to retrieve.\n * @returns {Object} - The variable instance.\n */\n getVariable (name) {\n return this.#variables[name]\n }\n\n hasVarsRequestCompleted () {\n return this.#hasVarsRequestCompleted\n }\n\n /**\n * Synchronizes variables with the server.\n * @param {Function} onSyncSuccess - Callback function on successful synchronization.\n * @param {Function} onSyncFailure - Callback function on synchronization failure.\n * @throws Will throw an error if the account token is missing.\n * @returns {Promise} - The result of the synchronization request.\n */\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (!this.#account.token) {\n const m = 'Account token is missing.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n const payload = {\n type: 'varsPayload',\n vars: {}\n }\n\n for (const name in this.#variables) {\n payload.vars[name] = {\n defaultValue: this.#variables[name].defaultValue,\n type: this.#variables[name].type\n }\n }\n\n // Check if payload.vars is empty\n if (Object.keys(payload.vars).length === 0) {\n const m = 'No variables are defined.'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n\n let meta = {}\n meta = this.#request.addSystemDataToObject(meta, undefined)\n meta.tk = this.#account.token\n\n meta.type = 'meta'\n const body = JSON.stringify([meta, payload])\n const url = this.#account.dataPostPEURL\n\n return this.#request.post(url, body)\n .then((r) => {\n if (onSyncSuccess && typeof onSyncSuccess === 'function') {\n onSyncSuccess(r)\n }\n return r\n })\n .catch((e) => {\n if (onSyncFailure && typeof onSyncFailure === 'function') {\n onSyncFailure(e)\n }\n if (e.status === 400) {\n this.#logger.error('Invalid sync payload or clear the existing draft')\n } else if (e.status === 401) {\n this.#logger.error('This is not a test profile')\n } else {\n this.#logger.error('Sync variable failed')\n }\n throw e\n })\n }\n\n /**\n * Fetches variables from the server.\n * @param {Function} onFetchCallback - Callback function on fetch completion.\n */\n fetchVariables (onFetchCallback) {\n this.#event.push(WZRK_FETCH, { t: 4 })\n if (onFetchCallback && typeof onFetchCallback === 'function') {\n this.#fetchCallback = onFetchCallback\n }\n }\n\n mergeVariables (vars) {\n console.log('msg vars is ', vars)\n this.#hasVarsRequestCompleted = true\n\n StorageManager.saveToLSorCookie(VARIABLES, vars)\n this.#remoteVariables = vars\n\n for (const name in this.#variables) {\n if (vars.hasOwnProperty(name)) {\n this.#variables[name].update(vars[name])\n }\n }\n\n if (this.#fetchCallback) {\n this.#fetchCallback()\n }\n\n this.#runVariablesChangedCallback()\n }\n\n addVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n this.#variablesChangedCallbacks.push(callback)\n\n if (this.hasVarsRequestCompleted()) {\n callback()\n }\n } else {\n this.#logger.error('callback is not a function')\n }\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n if (callback && typeof callback === 'function') {\n if (this.hasVarsRequestCompleted()) {\n callback()\n } else {\n this.#oneTimeVariablesChangedCallbacks.push(callback)\n }\n }\n }\n\n removeVariablesChangedCallback (callback) {\n const index = this.#variablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#variablesChangedCallbacks.splice(index, 1)\n }\n }\n\n removeOneTimeVariablesChangedCallback (callback) {\n const index = this.#oneTimeVariablesChangedCallbacks.indexOf(callback)\n if (index !== -1) {\n this.#oneTimeVariablesChangedCallbacks.splice(index, 1)\n }\n }\n\n #runVariablesChangedCallback () {\n for (var callback of this.#variablesChangedCallbacks) {\n callback()\n }\n for (var callBack of this.#oneTimeVariablesChangedCallbacks) {\n callBack()\n }\n this.#oneTimeVariablesChangedCallbacks.length = 0\n }\n}\n\nexport default VariableStore\n","import Account from './modules/account'\nimport CleverTapAPI from './modules/api'\nimport DeviceManager from './modules/device'\nimport EventHandler from './modules/event'\nimport ProfileHandler from './modules/profile'\nimport UserLoginHandler from './modules/userLogin'\nimport _tr from './util/tr'\nimport User from './modules/user'\nimport { Logger, logLevels } from './modules/logger'\nimport SessionManager from './modules/session'\nimport ReqestManager from './modules/request'\nimport {\n CAMP_COOKIE_NAME,\n SCOOKIE_PREFIX,\n NOTIFICATION_VIEWED,\n NOTIFICATION_CLICKED,\n EVT_PING,\n FIRST_PING_FREQ_IN_MILLIS,\n CONTINUOUS_PING_FREQ_IN_MILLIS,\n GROUP_SUBSCRIPTION_REQUEST_ID,\n WZRK_ID,\n WZRK_PREFIX,\n categoryLongKey,\n COMMAND_INCREMENT,\n COMMAND_DECREMENT,\n COMMAND_SET,\n COMMAND_ADD,\n COMMAND_REMOVE,\n COMMAND_DELETE,\n EVT_PUSH,\n WZRK_FETCH\n} from './util/constants'\nimport { EMBED_ERROR } from './util/messages'\nimport { StorageManager, $ct } from './util/storage'\nimport { addToURL, getDomain, getURLParams } from './util/url'\nimport { getCampaignObjForLc, setEnum, handleEmailSubscription, closeIframe } from './util/clevertap'\nimport { compressData } from './util/encoder'\nimport Privacy from './modules/privacy'\nimport NotificationHandler from './modules/notification'\nimport { hasWebInboxSettingsInLS, checkAndRegisterWebInboxElements, initializeWebInbox, getInboxMessages, saveInboxMessages } from './modules/web-inbox/helper'\nimport { Variable } from './modules/variables/variable'\nimport VariableStore from './modules/variables/variableStore'\nimport { checkBuilder, addAntiFlicker } from './modules/visualBuilder/pageBuilder'\nimport { setServerKey } from './modules/webPushPrompt/prompt'\n\nexport default class CleverTap {\n #logger\n #api\n #onloadcalled\n #device\n #session\n #account\n #request\n #variableStore\n #isSpa\n #previousUrl\n #boundCheckPageChanged = this.#checkPageChanged.bind(this)\n #dismissSpamControl\n enablePersonalization\n\n get spa () {\n return this.#isSpa\n }\n\n set spa (value) {\n const isSpa = value === true\n if (this.#isSpa !== isSpa && this.#onloadcalled === 1) {\n // if clevertap.spa is changed after init has been called then update the click listeners\n if (isSpa) {\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n }\n this.#isSpa = isSpa\n }\n\n get dismissSpamControl () {\n return this.#dismissSpamControl\n }\n\n set dismissSpamControl (value) {\n const dismissSpamControl = value === true\n this.#dismissSpamControl = dismissSpamControl\n $ct.dismissSpamControl = dismissSpamControl\n }\n\n constructor (clevertap = {}) {\n this.#onloadcalled = 0\n this._isPersonalisationActive = this._isPersonalisationActive.bind(this)\n this.raiseNotificationClicked = () => { }\n this.#logger = new Logger(logLevels.INFO)\n this.#account = new Account(clevertap.account?.[0], clevertap.region || clevertap.account?.[1], clevertap.targetDomain || clevertap.account?.[2], clevertap.token || clevertap.account?.[3])\n this.#device = new DeviceManager({ logger: this.#logger })\n this.#dismissSpamControl = clevertap.dismissSpamControl || false\n this.shpfyProxyPath = clevertap.shpfyProxyPath || ''\n this.#session = new SessionManager({\n logger: this.#logger,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.#request = new ReqestManager({\n logger: this.#logger,\n account: this.#account,\n device: this.#device,\n session: this.#session,\n isPersonalisationActive: this._isPersonalisationActive\n })\n this.enablePersonalization = clevertap.enablePersonalization || false\n this.event = new EventHandler({\n logger: this.#logger,\n request: this.#request,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.event)\n\n this.profile = new ProfileHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n isPersonalisationActive: this._isPersonalisationActive\n }, clevertap.profile)\n\n this.onUserLogin = new UserLoginHandler({\n request: this.#request,\n account: this.#account,\n session: this.#session,\n logger: this.#logger,\n device: this.#device\n }, clevertap.onUserLogin)\n\n this.privacy = new Privacy({\n request: this.#request,\n account: this.#account,\n logger: this.#logger\n }, clevertap.privacy)\n\n this.notifications = new NotificationHandler({\n logger: this.#logger,\n request: this.#request,\n account: this.#account\n }, clevertap.notifications)\n\n this.#variableStore = new VariableStore({\n logger: this.#logger,\n request: this.#request,\n account: this.#account,\n event: this.event\n })\n\n this.#api = new CleverTapAPI({\n logger: this.#logger,\n request: this.#request,\n device: this.#device,\n session: this.#session\n })\n\n this.spa = clevertap.spa\n this.dismissSpamControl = clevertap.dismissSpamControl\n\n this.user = new User({\n isPersonalisationActive: this._isPersonalisationActive\n })\n\n this.session = {\n getTimeElapsed: () => {\n return this.#session.getTimeElapsed()\n },\n getPageCount: () => {\n return this.#session.getPageCount()\n }\n }\n\n this.logout = () => {\n this.#logger.debug('logout called')\n StorageManager.setInstantDeleteFlagInK()\n }\n\n this.clear = () => {\n this.onUserLogin.clear()\n }\n\n this.getCleverTapID = () => {\n return this.#device.getGuid()\n }\n\n this.getAccountID = () => {\n return this.#account.id\n }\n\n this.getSCDomain = () => {\n return this.#account.finalTargetDomain\n }\n\n this.setLibrary = (libName, libVersion) => {\n $ct.flutterVersion = { [libName]: libVersion }\n }\n\n // Set the Signed Call sdk version and fire request\n this.setSCSDKVersion = (ver) => {\n this.#account.scSDKVersion = ver\n const data = {}\n data.af = { scv: 'sc-sdk-v' + this.#account.scSDKVersion }\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n if (hasWebInboxSettingsInLS()) {\n checkAndRegisterWebInboxElements()\n initializeWebInbox(this.#logger)\n }\n\n // Get Inbox Message Count\n this.getInboxMessageCount = () => {\n const msgCount = getInboxMessages()\n return Object.keys(msgCount).length\n }\n\n // Get Inbox Unread Message Count\n this.getInboxMessageUnreadCount = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedCounter\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get All Inbox messages\n this.getAllInboxMessages = () => {\n return getInboxMessages()\n }\n\n // Get only Unread messages\n this.getUnreadInboxMessages = () => {\n if ($ct.inbox) {\n return $ct.inbox.unviewedMessages\n } else {\n this.#logger.debug('No unread messages')\n }\n }\n\n // Get message object belonging to the given message id only. Message id should be a String\n this.getInboxMessageForId = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n return messages[messageId]\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n // Delete message from the Inbox. Message id should be a String\n // If the message to be deleted is unviewed then decrement the badge count, delete the message from unviewedMessages list\n // Then remove the message from local storage and update cookie\n this.deleteInboxMessage = (messageId) => {\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && messages.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (messages[messageId].viewed === 0) {\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n document.getElementById('unviewedBadge').innerText = $ct.inbox.unviewedCounter\n document.getElementById('unviewedBadge').style.display = $ct.inbox.unviewedCounter > 0 ? 'flex' : 'none'\n }\n el && el.remove()\n delete messages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. Message id should be a String\n - Check if the message Id exist in the unread message list\n - Remove the unread marker, update the viewed flag, decrement the bage Count\n - renderNotificationViewed */\n this.markReadInboxMessage = (messageId) => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if ((messageId !== null || messageId !== '') && unreadMsg.hasOwnProperty(messageId)) {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(messageId)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[messageId].viewed = 1\n if (document.getElementById('unviewedBadge')) {\n var counter = parseInt(document.getElementById('unviewedBadge').innerText) - 1\n document.getElementById('unviewedBadge').innerText = counter\n document.getElementById('unviewedBadge').style.display = counter > 0 ? 'flex' : 'none'\n }\n window.clevertap.renderNotificationViewed({ msgId: messages[messageId].wzrk_id, pivotId: messages[messageId].pivotId })\n $ct.inbox.unviewedCounter--\n delete $ct.inbox.unviewedMessages[messageId]\n saveInboxMessages(messages)\n } else {\n this.#logger.error('No message available for message Id ' + messageId)\n }\n }\n\n /* Mark Message as Read. messageIds should be a an array of string */\n this.markReadInboxMessagesForIds = (messageIds) => {\n if (Array.isArray(messageIds)) {\n for (var id = 0; id < messageIds.length; id++) {\n this.markReadInboxMessage(messageIds[id])\n }\n }\n }\n\n /* Mark all messages as read\n - Get the count of unread messages, update unread marker style\n - renderNotificationViewed, update the badge count and style\n */\n this.markReadAllInboxMessage = () => {\n const unreadMsg = $ct.inbox.unviewedMessages\n const messages = getInboxMessages()\n if (Object.keys(unreadMsg).length > 0) {\n const msgIds = Object.keys(unreadMsg)\n msgIds.forEach(key => {\n const el = document.querySelector('ct-web-inbox').shadowRoot.getElementById(key)\n if (el !== null) { el.shadowRoot.getElementById('unreadMarker').style.display = 'none' }\n messages[key].viewed = 1\n window.clevertap.renderNotificationViewed({ msgId: messages[key].wzrk_id, pivotId: messages[key].wzrk_pivot })\n })\n document.getElementById('unviewedBadge').innerText = 0\n document.getElementById('unviewedBadge').style.display = 'none'\n saveInboxMessages(messages)\n $ct.inbox.unviewedCounter = 0\n $ct.inbox.unviewedMessages = {}\n } else {\n this.#logger.debug('All messages are already read')\n }\n }\n\n this.toggleInbox = (e) => $ct.inbox?.toggleInbox(e)\n\n // method for notification viewed\n this.renderNotificationViewed = (detail) => {\n processNotificationEvent(NOTIFICATION_VIEWED, detail)\n }\n\n // method for notification clicked\n this.renderNotificationClicked = (detail) => {\n processNotificationEvent(NOTIFICATION_CLICKED, detail)\n }\n\n const processNotificationEvent = (eventName, eventDetail) => {\n if (!eventDetail || !eventDetail.msgId) { return }\n const data = {}\n data.type = 'event'\n data.evtName = eventName\n data.evtData = { [WZRK_ID]: eventDetail.msgId }\n\n if (eventDetail.pivotId) {\n data.evtData = { ...data.evtData, wzrk_pivot: eventDetail.pivotId }\n }\n\n if (eventDetail.wzrk_slideNo) {\n data.evtData = { ...data.evtData, wzrk_slideNo: eventDetail.wzrk_slideNo }\n }\n\n // Adding kv pair to event data\n if (eventDetail.kv && eventDetail.kv !== null && eventDetail.kv !== undefined) {\n for (const key in eventDetail.kv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.kv[key] }\n }\n }\n }\n\n // Adding msgCTkv to event data\n if (eventDetail.msgCTkv && eventDetail.msgCTkv !== null && eventDetail.msgCTkv !== undefined) {\n for (const key in eventDetail.msgCTkv) {\n if (key.startsWith(WZRK_PREFIX)) {\n data.evtData = { ...data.evtData, [key]: eventDetail.msgCTkv[key] }\n }\n }\n }\n this.#request.processEvent(data)\n }\n\n this.setLogLevel = (l) => {\n this.#logger.logLevel = Number(l)\n if (l === 3) {\n sessionStorage.WZRK_D = ''\n } else {\n delete sessionStorage.WZRK_D\n }\n }\n /**\n * @param {} key\n * @param {*} value\n */\n this.handleIncrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_INCREMENT)\n }\n\n this.handleDecrementValue = (key, value) => {\n this.profile._handleIncrementDecrementValue(key, value, COMMAND_DECREMENT)\n }\n\n this.setMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueSet(key, value, COMMAND_SET)\n } else {\n console.error('setMultiValuesForKey should be called with a value of type array')\n }\n }\n\n this.addMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.addMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueAdd(key, value, COMMAND_ADD)\n } else {\n console.error('addMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeMultiValueForKey = (key, value) => {\n if (typeof value === 'string' || typeof value === 'number') {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValueForKey should be called with a value of type string or number.')\n }\n }\n\n this.removeMultiValuesForKey = (key, value) => {\n if (Array.isArray(value)) {\n this.profile._handleMultiValueRemove(key, value, COMMAND_REMOVE)\n } else {\n console.error('removeMultiValuesForKey should be called with a value of type array.')\n }\n }\n\n this.removeValueForKey = (key) => {\n this.profile._handleMultiValueDelete(key, COMMAND_DELETE)\n }\n\n const _handleEmailSubscription = (subscription, reEncoded, fetchGroups) => {\n handleEmailSubscription(subscription, reEncoded, fetchGroups, this.#account, this.#logger)\n }\n\n /**\n *\n * @param {number} lat\n * @param {number} lng\n * @param {callback function} handleCoordinates\n * @returns\n */\n this.getLocation = function (lat, lng) {\n // latitude and longitude should be number type\n if ((lat && typeof lat !== 'number') || (lng && typeof lng !== 'number')) {\n console.log('Latitude and Longitude must be of number type')\n return\n }\n if (lat && lng) {\n // valid latitude ranges bw +-90\n if (lat <= -90 || lat > 90) {\n console.log('A vaid latitude must range between -90 and 90')\n return\n }\n // valid longitude ranges bw +-180\n if (lng <= -180 || lng > 180) {\n console.log('A valid longitude must range between -180 and 180')\n return\n }\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n } else {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition.bind(this), showError)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n }\n }\n\n function showPosition (position) {\n var lat = position.coords.latitude\n var lng = position.coords.longitude\n $ct.location = { Latitude: lat, Longitude: lng }\n this.#sendLocationData({ Latitude: lat, Longitude: lng })\n }\n\n function showError (error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n console.log('User denied the request for Geolocation.')\n break\n case error.POSITION_UNAVAILABLE:\n console.log('Location information is unavailable.')\n break\n case error.TIMEOUT:\n console.log('The request to get user location timed out.')\n break\n case error.UNKNOWN_ERROR:\n console.log('An unknown error occurred.')\n break\n }\n }\n\n const api = this.#api\n api.logout = this.logout\n api.clear = this.clear\n api.closeIframe = (campaignId, divIdIgnored) => {\n closeIframe(campaignId, divIdIgnored, this.#session.sessionId)\n }\n api.enableWebPush = (enabled, applicationServerKey) => {\n setServerKey(applicationServerKey)\n this.notifications._enableWebPush(enabled, applicationServerKey)\n }\n api.tr = (msg) => {\n _tr(msg, {\n device: this.#device,\n session: this.#session,\n request: this.#request,\n logger: this.#logger\n })\n }\n api.setEnum = (enumVal) => {\n setEnum(enumVal, this.#logger)\n }\n api.is_onloadcalled = () => {\n return (this.#onloadcalled === 1)\n }\n api.subEmail = (reEncoded) => {\n _handleEmailSubscription('1', reEncoded)\n }\n api.getEmail = (reEncoded, withGroups) => {\n _handleEmailSubscription('-1', reEncoded, withGroups)\n }\n api.unSubEmail = (reEncoded) => {\n _handleEmailSubscription('0', reEncoded)\n }\n api.unsubEmailGroups = (reEncoded) => {\n $ct.unsubGroups = []\n const elements = document.getElementsByClassName('ct-unsub-group-input-item')\n\n for (let i = 0; i < elements.length; i++) {\n const element = elements[i]\n if (element.name) {\n const data = { name: element.name, isUnsubscribed: element.checked }\n $ct.unsubGroups.push(data)\n }\n }\n\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.setSubscriptionGroups = (value) => {\n $ct.unsubGroups = value\n }\n api.getSubscriptionGroups = () => {\n return $ct.unsubGroups\n }\n api.changeSubscriptionGroups = (reEncoded, updatedGroups) => {\n api.setSubscriptionGroups(updatedGroups)\n _handleEmailSubscription(GROUP_SUBSCRIPTION_REQUEST_ID, reEncoded)\n }\n api.isGlobalUnsubscribe = () => {\n return $ct.globalUnsubscribe\n }\n api.setIsGlobalUnsubscribe = (value) => {\n $ct.globalUnsubscribe = value\n }\n api.setUpdatedCategoryLong = (profile) => {\n if (profile[categoryLongKey]) {\n $ct.updatedCategoryLong = profile[categoryLongKey]\n }\n }\n window.$CLTP_WR = window.$WZRK_WR = api\n\n if (clevertap.account?.[0].id) {\n // The accountId is present so can init with empty values.\n // Needed to maintain backward compatability with legacy implementations.\n // Npm imports/require will need to call init explictly with accountId\n this.init()\n }\n }\n\n // starts here\n init (accountId, region, targetDomain, token, antiFlicker = {}) {\n if (Object.keys(antiFlicker).length > 0) {\n addAntiFlicker(antiFlicker)\n }\n if (this.#onloadcalled === 1) {\n // already initailsed\n return\n }\n\n StorageManager.removeCookie('WZRK_P', window.location.hostname)\n if (!this.#account.id) {\n if (!accountId) {\n this.#logger.error(EMBED_ERROR)\n return\n }\n this.#account.id = accountId\n }\n checkBuilder(this.#logger, this.#account.id)\n this.#session.cookieName = SCOOKIE_PREFIX + '_' + this.#account.id\n\n if (region) {\n this.#account.region = region\n }\n if (targetDomain) {\n this.#account.targetDomain = targetDomain\n }\n if (token) {\n this.#account.token = token\n }\n\n const currLocation = location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n\n // eslint-disable-next-line eqeqeq\n if (typeof urlParams.e !== 'undefined' && urlParams.wzrk_ex == '0') {\n return\n }\n\n $ct.isPrivacyArrPushed = true\n if ($ct.privacyArray.length > 0) {\n this.privacy.push($ct.privacyArray)\n }\n\n this.#processOldValues()\n this.pageChanged()\n const backupInterval = setInterval(() => {\n if (this.#device.gcookie) {\n clearInterval(backupInterval)\n this.#request.processBackupEvents()\n }\n }, 3000)\n if (this.#isSpa) {\n // listen to click on the document and check if URL has changed.\n document.addEventListener('click', this.#boundCheckPageChanged)\n } else {\n // remove existing click listeners if any\n document.removeEventListener('click', this.#boundCheckPageChanged)\n }\n this.#onloadcalled = 1\n }\n\n // process the option array provided to the clevertap object\n // after its been initialized\n #processOldValues () {\n this.onUserLogin._processOldValues()\n this.privacy._processOldValues()\n this.event._processOldValues()\n this.profile._processOldValues()\n this.notifications._processOldValues()\n }\n\n #debounce (func, delay = 300) {\n let timeout\n return function () {\n clearTimeout(timeout)\n timeout = setTimeout(func, delay)\n }\n }\n\n #checkPageChanged () {\n const debouncedPageChanged = this.#debounce(() => {\n if (this.#previousUrl !== location.href) {\n this.pageChanged()\n }\n })\n debouncedPageChanged()\n }\n\n pageChanged () {\n const currLocation = window.location.href\n const urlParams = getURLParams(currLocation.toLowerCase())\n // -- update page count\n const obj = this.#session.getSessionCookieObject()\n let pgCount = (typeof obj.p === 'undefined') ? 0 : obj.p\n obj.p = ++pgCount\n this.#session.setSessionCookieObject(obj)\n // -- update page count\n\n let data = {}\n let referrerDomain = getDomain(document.referrer)\n\n if (window.location.hostname !== referrerDomain) {\n const maxLen = 120\n if (referrerDomain !== '') {\n referrerDomain = referrerDomain.length > maxLen ? referrerDomain.substring(0, maxLen) : referrerDomain\n data.referrer = referrerDomain\n }\n\n let utmSource = urlParams.utm_source || urlParams.wzrk_source\n if (typeof utmSource !== 'undefined') {\n utmSource = utmSource.length > maxLen ? utmSource.substring(0, maxLen) : utmSource\n data.us = utmSource // utm_source\n }\n\n let utmMedium = urlParams.utm_medium || urlParams.wzrk_medium\n if (typeof utmMedium !== 'undefined') {\n utmMedium = utmMedium.length > maxLen ? utmMedium.substring(0, maxLen) : utmMedium\n data.um = utmMedium // utm_medium\n }\n\n let utmCampaign = urlParams.utm_campaign || urlParams.wzrk_campaign\n if (typeof utmCampaign !== 'undefined') {\n utmCampaign = utmCampaign.length > maxLen ? utmCampaign.substring(0, maxLen) : utmCampaign\n data.uc = utmCampaign // utm_campaign\n }\n\n // also independently send wzrk_medium to the backend\n if (typeof urlParams.wzrk_medium !== 'undefined') {\n const wm = urlParams.wzrk_medium\n if (wm.match(/^email$|^social$|^search$/)) {\n data.wm = wm // wzrk_medium\n }\n }\n }\n\n data = this.#request.addSystemDataToObject(data, undefined)\n data.cpg = currLocation\n\n data[CAMP_COOKIE_NAME] = getCampaignObjForLc()\n let pageLoadUrl = this.#account.dataPostURL\n this.#request.addFlags(data)\n // send dsync flag when page = 1\n if (parseInt(data.pg) === 1) {\n this.#overrideDSyncFlag(data)\n }\n pageLoadUrl = addToURL(pageLoadUrl, 'type', 'page')\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n\n if (parseInt(data.pg) === 1) {\n this.event.push(WZRK_FETCH, { t: 4 })\n }\n\n this.#previousUrl = currLocation\n setTimeout(() => {\n if (pgCount <= 3) {\n // send ping for up to 3 pages\n this.#pingRequest()\n }\n\n if (this.#isPingContinuous()) {\n setInterval(() => {\n this.#pingRequest()\n }, CONTINUOUS_PING_FREQ_IN_MILLIS)\n }\n }, FIRST_PING_FREQ_IN_MILLIS)\n }\n\n #pingRequest () {\n let pageLoadUrl = this.#account.dataPostURL\n let data = {}\n data = this.#request.addSystemDataToObject(data, undefined)\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PING)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressData(JSON.stringify(data), this.#logger))\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n #isPingContinuous () {\n return (typeof window.wzrk_d !== 'undefined' && window.wzrk_d.ping === 'continuous')\n }\n\n _isPersonalisationActive () {\n return StorageManager._isLocalStorageSupported() && this.enablePersonalization\n }\n\n #overrideDSyncFlag (data) {\n if (this._isPersonalisationActive()) {\n data.dsync = true\n }\n }\n\n popupCallbacks = {};\n popupCurrentWzrkId = '';\n\n // eslint-disable-next-line accessor-pairs\n set popupCallback (callback) {\n this.popupCallbacks[this.popupCurrentWzrkId] = callback\n }\n\n /**\n *\n * @param {object} payload\n */\n #sendLocationData (payload) {\n // Send the updated value to LC\n let data = {}\n data.af = {}\n const profileObj = {}\n data.type = 'profile'\n if (profileObj.tz == null) {\n profileObj.tz = new Date().toString().match(/([A-Z]+[\\+-][0-9]+)/)[1]\n }\n data.profile = profileObj\n if (payload) {\n const keys = Object.keys(payload)\n keys.forEach(key => {\n data.af[key] = payload[key]\n })\n }\n if ($ct.location) {\n data.af = { ...data.af, ...$ct.location }\n }\n data = this.#request.addSystemDataToObject(data, true)\n this.#request.addFlags(data)\n const compressedData = compressData(JSON.stringify(data), this.#logger)\n let pageLoadUrl = this.#account.dataPostURL\n pageLoadUrl = addToURL(pageLoadUrl, 'type', EVT_PUSH)\n pageLoadUrl = addToURL(pageLoadUrl, 'd', compressedData)\n\n this.#request.saveAndFireRequest(pageLoadUrl, $ct.blockRequest)\n }\n\n // offline mode\n /**\n * events will be recorded and queued locally when passed with true\n * but will not be sent to the server until offline is disabled by passing false\n * @param {boolean} arg\n */\n\n setOffline (arg) {\n if (typeof arg !== 'boolean') {\n console.error('setOffline should be called with a value of type boolean')\n return\n }\n $ct.offline = arg\n // if offline is disabled\n // process events from cache\n if (!arg) {\n this.#request.processBackupEvents()\n }\n }\n\n getSDKVersion () {\n return 'web-sdk-v$$PACKAGE_VERSION$$'\n }\n\n defineVariable (name, defaultValue) {\n return Variable.define(name, defaultValue, this.#variableStore)\n }\n\n syncVariables (onSyncSuccess, onSyncFailure) {\n if (this.#logger.logLevel === 4) {\n return this.#variableStore.syncVariables(onSyncSuccess, onSyncFailure)\n } else {\n const m = 'App log level is not set to 4'\n this.#logger.error(m)\n return Promise.reject(new Error(m))\n }\n }\n\n fetchVariables (onFetchCallback) {\n this.#variableStore.fetchVariables(onFetchCallback)\n }\n\n addVariablesChangedCallback (callback) {\n this.#variableStore.addVariablesChangedCallback(callback)\n }\n\n addOneTimeVariablesChangedCallback (callback) {\n this.#variableStore.addOneTimeVariablesChangedCallback(callback)\n }\n}\n","import Clevertap from './clevertap'\n\nconst clevertap = new Clevertap(window.clevertap)\n\nwindow.clevertap = window.wizrocket = clevertap\n\nexport default clevertap\n"],"names":["TARGET_DOMAIN","TARGET_PROTOCOL","DEFAULT_REGION","Account","id","region","targetDomain","token","accountId","dcSDKVersion","finalTargetDomain","unsupportedKeyCharRegex","RegExp","unsupportedValueCharRegex","singleQuoteRegex","CLEAR","CHARGED_ID","CHARGEDID_COOKIE_NAME","GCOOKIE_NAME","KCOOKIE_NAME","CAMP_COOKIE_NAME","CAMP_COOKIE_G","SCOOKIE_PREFIX","SCOOKIE_EXP_TIME_IN_SECS","EV_COOKIE","META_COOKIE","PR_COOKIE","ARP_COOKIE","LCOOKIE_NAME","GLOBAL","DISPLAY","WEBPUSH_LS_KEY","OPTOUT_KEY","CT_OPTOUT_KEY","OPTOUT_COOKIE_ENDSWITH","USEIP_KEY","LRU_CACHE","LRU_CACHE_SIZE","IS_OUL","EVT_PUSH","EVT_PING","COOKIE_EXPIRY","MAX_TRIES","FIRST_PING_FREQ_IN_MILLIS","CONTINUOUS_PING_FREQ_IN_MILLIS","GROUP_SUBSCRIPTION_REQUEST_ID","categoryLongKey","WZRK_PREFIX","WZRK_ID","NOTIFICATION_VIEWED","NOTIFICATION_CLICKED","FIRE_PUSH_UNREGISTERED","PUSH_SUBSCRIPTION_DATA","COMMAND_INCREMENT","COMMAND_DECREMENT","COMMAND_SET","COMMAND_ADD","COMMAND_REMOVE","COMMAND_DELETE","WEBINBOX_CONFIG","WEBINBOX","MAX_INBOX_MSG","VARIABLES","PUSH_DELAY_MS","MAX_DELAY_FREQUENCY","WZRK_FETCH","WEBPUSH_CONFIG","SYSTEM_EVENTS","isString","input","String","isObject","Object","prototype","toString","call","isDateObject","Date","isObjectEmpty","obj","prop","hasOwnProperty","isConvertibleToNumber","n","isNaN","parseFloat","isFinite","isNumber","test","isValueValid","value","undefined","removeUnsupportedChars","o","logger","key","sanitizedVal","sanitizedKey","sanitize","length","substring","reportError","val","regex","replace","getToday","today","getFullYear","getMonth","getDay","getNow","Math","floor","getTime","convertToWZRKDate","dateObj","round","setDate","dt","isDateValid","date","matches","exec","d","m","y","composedDate","getDate","StorageManager","_isLocalStorageSupported","localStorage","setItem","JSON","stringify","data","getItem","parse","e","removeItem","name","domain","cookieStr","document","cookie","seconds","expires","domainStr","setTime","toGMTString","encodeURIComponent","nameEQ","ca","split","idx","c","charAt","indexOf","decodeURIComponent","window","property","save","createCookie","location","hostname","$ct","globalCache","read","readCookie","trim","err","broadDomain","domainParts","testBroadDomain","testCookieName","removeCookie","tempCookie","metaObj","readFromLSorCookie","wzrkMetaObj","saveToLSorCookie","getMetaProp","setMetaProp","k","flag","reqNo","backupArr","q","debug","respNo","backupMap","gcookie","REQ_N","RESP_N","globalProfileMap","globalEventsMap","blockRequest","isOptInRequest","webPushEnabled","campaignDivMap","currentSessionId","wiz_counter","notifApi","notifEnabledFromApi","unsubGroups","updatedCategoryLong","inbox","isPrivacyArrPushed","privacyArray","offline","dismissSpamControl","globalUnsubscribe","flutterVersion","variableStore","pushConfig","LRUCache","max","lruCache","tempLruCache","cache","entry","push","item","saveCacheToLS","allKeys","objToArray","index","temp","keysArr","keysLength","newCache","indexToDelete","splice","CleverTapAPI","request","device","session","global","resume","respNumber","optOutResponse","oulReq","newGuid","isOULInProgress","oulReqN","removeBackup","sessionObj","getSessionCookieObject","s","getAndClearMetaProp","kIdFromLS","guidFromLRUCache","set","lastK","getSecondLastKey","lastGUID","unregisterTokenForGuid","createBroadCookie","manageSession","t","setSessionCookieObject","processingBackup","processBackupEvents","DeviceManager","getGuid","guid","error","DATA_NOT_SENT_TEXT","CLEVERTAP_ERROR_PREFIX","EMBED_ERROR","EVENT_ERROR","GENDER_ERROR","EMPLOYED_ERROR","MARRIED_ERROR","EDUCATION_ERROR","AGE_ERROR","DOB_ERROR","ENUM_FORMAT_ERROR","PHONE_FORMAT_ERROR","_globalChargedId","isEventStructureFlat","eventObj","Array","isArray","isChargedEventStructureValid","chargedObj","itemKey","chargedId","EventHandler","values","isPersonalisationActive","eventsArr","evtName","evtObj","respObj","firstTime","lastTime","count","eventName","shift","includes","type","unshift","evtData","processEvent","getURLParams","url","urlParams","uri","match","pl","search","decode","replacement","getDomain","a","createElement","href","addToURL","v","getHostName","urlBase64ToUint8Array","base64String","padding","repeat","base64","rawData","atob","processedData","i","charCodeAt","Uint8Array","compressData","dataObject","compressToBase64","compress","uncompressed","context_dictionary","context_dictionaryToCreate","context_c","context_wc","context_w","context_enlargeIn","context_dictSize","context_numBits","context_data_string","context_data_val","context_data_position","ii","f","fromCharCode","pow","getKeyStr","_keyStr","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","NaN","RequestDispatcher","networkRetryCount","minDelayFrequency","account","randomDelay","random","skipARP","sendOULFlag","skipResARP","_arp","pageLoadUrl","useIP","slice","tries","setTimeout","getDelayFrequency","clevertap","wizrocket","plugin","ctCbScripts","getElementsByClassName","parentNode","removeChild","setAttribute","async","getElementsByTagName","appendChild","getCampaignObject","finalcampObj","campObj","wp","saveCampaignObject","campaignObj","newObj","setCampaignObjectForGuid","guidCampObj","finalCampObj","keys","forEach","campKeyObj","globalObj","dailyObj","campaignIdArray","resultObj","dailyC","totalC","campaignId","console","getCampaignObjForLc","storageValue","decodedValue","parsedValue","resultObjWP","resultObjWI","wi","todayCwp","todayCwi","tc","wmp","wimp","tlc","witlc","isProfileValid","profileObj","valid","profileKey","profileVal","Age","Phone","processFBUserObj","user","profileData","Name","FBID","gender","Gender","getHighestEducation","eduArr","college","highschool","edu","relationship_status","Married","education","Education","work","Employed","email","Email","birthday","mmddyy","DOB","processGPlusUserObj","displayName","GPID","image","isDefault","Photo","emails","emailIdx","emailObj","organizations","orgObj","yyyymmdd","relationshipStatus","addToLocalProfileMap","override","_custom","closeIframe","divIdIgnored","sessionCampaignObj","divId","getElementById","style","display","arp","jsonMap","isOULARP","arpFromStorage","setEnum","enumVal","handleEmailSubscription","subscription","reEncoded","fetchGroups","urlParamsAsIs","encodedEmailId","encodedProfileProps","p","pageType","page_type","emailURL","fireRequest","ProfileHandler","profilesArr","propName","command","tz","profile","addSystemDataToObject","addFlags","compressedData","dataPostURL","saveAndFireRequest","arrayVal","array","toLowerCase","sendMultiValueData","propKey","propVal","existingValue","addValue","normalizedValue","removeValue","profileArr","outerObj","Site","Facebook","FbProfileObj","GPlusProfileObj","UserLoginHandler","addToK","ids","g","kId","anonymousUser","foundInCache","getLastKey","gFromCache","get","clear","Identity","cookieName","loginArr","pop","processProfile","setInstantDeleteFlagInK","CTWebPopupImageOnly","_target","_session","shadow","popup","container","resizeObserver","attachShadow","mode","target","wzrk_id","sessionId","innerHTML","getImageOnlyPopupContent","shadowRoot","closeIcon","addEventListener","updateImageAndContainerWidth","ResizeObserver","handleResize","observe","unobserve","remove","renderNotificationViewed","msgId","pivotId","onClickUrl","open","parent","renderNotificationClicked","width","getRenderedImageWidth","setProperty","msgContent","css","html","visibility","img","ratio","naturalWidth","naturalHeight","height","renderImageOnlyPopup","wzrk_pivot","HTMLElement","Message","config","message","wrapper","snackBar","renderMessage","part","_el","msg","createEl","templateType","prepareBasicMessage","timeStamp","determineTimeStampText","viewed","unreadMarker","imageUrl","imageContainer","addImage","iconTitleDescWrapper","iconUrl","iconContainer","titleDescWrapper","title","innerText","description","buttons","buttonsContainer","addButtons","hasCopyAction","b","button","text","cssText","action","addSnackbar","greenTickSvg","clipboardMsg","path","isPreview","raiseClickedForBasicTemplates","payload","tagName","kv","wzrk_c2a","openUrlInNewTab","focus","navigator","clipboard","writeText","clipboardText","log","messageStyles","backgroundColor","borderColor","titleColor","descriptionColor","buttonColor","buttonTextColor","unreadMarkerColor","inboxContainerStyles","panelBackgroundColor","panelBorderColor","headerBackgroundColor","headerTitleColor","closeIconColor","categoriesTabColor","categoriesTitleColor","categoriesBorderColor","selectedCategoryTabColor","selectedCategoryTitleColor","selectedCategoryBorderColor","headerCategoryHeight","Inbox","isInboxOpen","isInboxFromFlutter","selectedCategory","unviewedMessages","unviewedCounter","inboxConfigForPreview","inboxSelector","emptyInboxMsg","inboxCard","unviewedBadge","observer","selectedCategoryRef","addClickListenerOnDocument","composedPath","toggleInbox","startsWith","prevCategoryRef","updateActiveCategory","_path","filter","messageEl","raiseClickedEvent","contains","setBadgeStyle","msgCount","init","styles","notificationsBadge","addUnviewedBadge","createinbox","removeEventListener","categories","getInboxStyles","messages","deleteExpiredAndGetUnexpiredMsgs","msgIds","buildUIForMessages","updateUnviewedBadgeCounter","deleteMsgsFromUI","getInboxMessages","now","wzrk_ttl","el","sort","reduce","acc","saveInboxMessages","msgs","inboxMsgs","incomingMsgs","textColor","body","updateUnviewedBadgePosition","getBoundingClientRect","top","right","left","header","headerTitle","createCategories","options","root","rootMargin","threshold","IntersectionObserver","entries","handleMessageViewed","addMsgsToInboxFromLS","categoriesContainer","leftArrow","arrowSvg","children","scrollBy","categoriesWrapper","_categories","category","rightArrow","firstCategory","lastCategory","firstCategoryObserver","categoryObserverCb","intersectionRatio","lastCategoryObserver","hide","activeCategory","scrollTop","counter","childNodes","getAttribute","updateTSForRenderedMsgs","maxMsgsInInbox","firstChild","sortedMsgs","map","tags","insertBefore","msgTotalCount","querySelectorAll","ctInboxMsgs","hasMessages","raiseViewedEvent","isIntersecting","updateMessageInLS","rect","zIndex","scrollLeft","scrollWidth","setInboxPosition","windowWidth","outerWidth","customInboxStyles","getComputedStyle","getPropertyValue","bottom","hasPositionDefined","res","getInboxPosition","clientHeight","clientWidth","xPos","yPos","ts","headerHeight","categoriesHeight","tabColor","selectedTab","inboxStyles","cardStyles","cards","msgStyles","updateInboxMessages","previewMsgs","processWebInboxSettings","webInboxSetting","_settings","processInboxNotifs","inbox_preview","incomingMessagesForPreview","inbox_notifs","incomingMessages","addWebInbox","checkAndRegisterWebInboxElements","getAndMigrateInboxMessages","gudInboxObj","storedInboxObj","initializeWebInbox","Promise","resolve","reject","readyState","onLoaded","setInterval","clearInterval","customElements","define","inboxHeight","inboxWidth","horizontalScroll","scrollingElement","verticalScroll","innerWidth","windowHeight","innerHeight","selectorRect","selectorX","x","selectorY","selectorLeft","selectorRight","selectorTop","selectorBottom","selectorHeight","selectorWidth","selectorCenter","halfOfInboxHeight","halfOfInboxWidth","inboxOnSide","availableHeight","inboxRight","availableWidth","inboxLeft","diff","hasWebInboxSettingsInLS","OVERLAY_PATH","CSS_PATH","WVE_CLASS","FLICKER_SHOW","FLICKER_HIDE","FLICKER_ID","updateFormData","element","formStyle","underline","curTextDecoration","textDecoration","clickDetails","clickUrl","onclick","newTab","raiseNotificationClicked","imgURL","src","elementCss","head","checkBuilder","parentWindow","opener","handleMessageEvent","postMessage","originUrl","sdkVersion","event","isValidUrl","msgOrigin","URL","origin","evtMaster","personalisation","initialiseCTBuilder","variant","details","renderVisualBuilder","onContentLoad","contentLoaded","isShopify","Shopify","documentElement","position","overlayPath","loadOverlayScript","then","catch","loadCSS","link","rel","script","onload","Overlay","Error","onerror","targetingMsgJson","notificationViewed","raiseViewed","processElement","selector","outerHTML","json","dispatchJsonData","msgCTkv","wzrk_selector","form","tryFindingElement","intervalId","retryElement","querySelector","selectorData","inaObj","kvPairsEvent","CustomEvent","detail","dispatchEvent","string","Boolean","_err","addAntiFlicker","antiFlicker","personalizedSelectors","delayTime","retryElements","retryCount","retryInterval","isInViewport","styleContent","styleId","styleElement","textContent","applyAntiFlicker","selectors","processSelectors","selectorElements","elements","matchedElements","applyStyles","retryProcessing","classList","add","observeUrlChange","previousHref","MutationObserver","childList","subtree","CTWebPersonalisationBanner","_details","getBannerContent","trackClick","onClick","divHeight","desktopImageURL","mobileImageURL","renderBanner","CTWebPersonalisationCarousel","_carousel","slides","previouslySelectedItem","selectedItem","autoSlide","stopAutoSlideTimeout","getStyles","carousel","getCarouselContent","showNavBtns","insertAdjacentHTML","navBtnsHtml","showNavArrows","leftNavArrowHtml","rightNavArrowHtml","setupClick","updateSelectedItem","startAutoSlide","setupOnHover","eventID","selected","endsWith","goToNext","goToPrev","wzrk_slideNo","clearTimeout","banner","navBtnsCss","navArrowsCss","prevItem","prevButton","sliderTime","goTo","prev","cur","renderCarousel","renderPersonalisationBanner","divSelector","bannerEl","containerEl","renderPersonalisationCarousel","handleKVpairCampaign","invokeExternalJs","jsFunc","func","appendScriptForCustomEvent","staleDataUpdate","staledata","campType","mergeEventMap","newEvtMap","oldEvtObj","newEvtObj","incrementImpression","_request","setupClickEvent","contentDiv","isLegacy","_device","ctaElement","jsCTAElements","preview","getCookieParams","rValue","searchParams","notifications","skipDialog","scookieObj","renderPopUpImageOnly","popupImageOnly","getBoxPromptStyles","totalBorderWidth","card","borderEnabled","border","borderWidth","cardPadding","cardContentWidth","overlay","color","borderRadius","primaryButton","secondaryButton","getBellIconStyles","NotificationHandler","displayArgs","swPath","enablePush","subscriptionCallback","serviceWorkerPath","apnsWebPushId","apnsServiceUrl","userAgent","applicationServerKey","enabled","setApplicationServerKey","safari","pushNotification","requestPermission","permission","subscriptionData","endpoint","deviceToken","browser","registerToken","info","registrationScope","serviceWorker","register","registration","__wzrk_account_id","scope","rootDirRegex","isServiceWorkerAtRoot","ready","getRegistrations","serviceWorkerRegistration","subscribeObj","userVisibleOnly","pushManager","subscribe","existingBellWrapper","getSubscription","unsubscribe","successful","scriptTag","titleText","bodyText","okButtonText","rejectButtonText","okButtonColor","askAgainTimeInSeconds","okCallback","rejectCallback","httpsPopupPath","httpsIframePath","apnsWebPushServiceUrl","notifObj","isHTTP","protocol","chromeAgent","parseInt","firefoxAgent","safariAgent","Notification","setUpWebPushNotifications","httpsIframe","state","from","wzrkPermissionPopup","wizAlert","confirmButtonText","confirmButtonColor","BELL_BASE64","PROMPT_BELL_BASE64","appServerKey","notificationHandler","processWebPushConfig","webPushConfig","_pushConfig","updatePushConfig","customSwPath","showBox","boxType","showBellIcon","boxConfig","createNotificationBox","bellIconConfig","createBellIcon","createElementWithAttributes","tag","attributes","configData","content","overlayDiv","pnCard","icon","primaryButtonText","secondaryButtonText","setElementPosition","lastNotifTime","popupFrequency","addEventListeners","bellWrapper","bellIcon","gifModal","gifImage","closeModal","hoverText","tooltip","addBellEventListeners","setServerKey","serverKey","removeWrapper","toggleGifModal","displayTooltip","clearTooltip","assign","inset","transform","positions","Center","Top","Bottom","bellRect","midX","midY","_tr","_logger","_wizCounter","doCampHouseKeeping","incrCount","excludeFromFreqCaps","currentCount","totalCount","sessionStorage","campTypeObj","wtarget_type","wmc","wimc","campaignSessionLimit","campaignDailyLimit","campaignTotalLimit","totalDailyLimit","totalSessionLimit","totalInboxSessionLimit","efc","mdc","tdc","campaignSessionCount","totalSessionCount","campaignDailyCount","totalDailyCount","campaignTotalCount","displayObj","delay","campKey","newCampObj","setupClickUrl","handleImageOnlyPopup","msgDiv","isExistingCampaign","testIframe","iframeDocument","contentDocument","contentWindow","createTemplate","isExitIntent","layout","showExitIntent","opacityDivId","opacityElement","isBanner","opacityDiv","opacity","rgbaColor","viewHeight","viewWidth","legacy","marginBottom","contentHeight","bottomPosition","widthPerct","proto","iFrameStyle","iframe","br","frameborder","marginheight","marginwidth","scrolling","pointerCss","sandbox","bgColor","btnBg","leftTd","btColor","theme","descriptionText","imageTd","onClickStr","closeCampaign","Event","srcdoc","adjustIFrameHeight","scrollHeight","margin","ua","inDoc","_timer","renderFooterNotification","_callBackCalled","showFooterNotification","notificationCallback","raiseNotificationViewed","popupCurrentWzrkId","deliveryTrigger","inactive","triggerByInactivity","scroll","triggerByScroll","exitintentObj","onmouseleave","deliveryDelayed","popupCallbacks","popupCallback","wzrkPrefixKey","wzrkJson","raisePopupNotificationClicked","notificationData","eventData","wzrkPrefixObj","targetNotif","IDLE_TIME_THRESHOLD","idleTimer","events","resetIdleTimer","removeEventListeners","eventHandler","setupEventListeners","eventType","passive","calculateScrollPercentage","scrollListener","scrollPercentage","throttledScrollListener","throttle","limit","inThrottle","context","args","apply","targetObj","clientY","intentPreview","intentOpacityDiv","ctaText","processNativeDisplayArr","arrInAppNotifs","elementId","addLoadListener","inapp_notifs","handleInboxNotifications","msgArr","vars","mergeVariables","evpr","eventsMap","profileMap","syncExpiry","expires_in","inapp_stale","inbox_stale","User","visitCount","prevSession","logLevels","DISABLE","ERROR","INFO","DEBUG","DEBUG_PE","Logger","logLevel","wzrkError","code","level","WZRK_D","SessionManager","scookieStr","objStr","currentSessionInLS","sessionCount","sessionStart","seqNo","requestTime","RequestManager","backupEvent","fired","ignoreTrim","wzrk_error","pg","af","lib","rc","lastSyncTime","expirySeconds","dsync","givenGUID","fetch","method","headers","response","ok","nowTs","evtDetail","Privacy","privacyArr","privacyObj","curr","optOut","shouldUseIP","Variable","defaultValue","hadStarted","valueChangedCallbacks","newValue","oldValue","hasVarsRequestCompleted","triggerValueChanged","onValueChanged","typeOfDefaultValue","existing","getVariable","varInstance","registerVariable","update","VariableStore","onSyncSuccess","onSyncFailure","meta","tk","dataPostPEURL","post","r","status","onFetchCallback","callback","callBack","CleverTap","isSpa","bind","enablePersonalization","_isPersonalisationActive","shpfyProxyPath","ReqestManager","onUserLogin","privacy","spa","getTimeElapsed","getPageCount","logout","getCleverTapID","getAccountID","getSCDomain","setLibrary","libName","libVersion","setSCSDKVersion","ver","scSDKVersion","scv","getInboxMessageCount","getInboxMessageUnreadCount","getAllInboxMessages","getUnreadInboxMessages","getInboxMessageForId","messageId","deleteInboxMessage","markReadInboxMessage","unreadMsg","markReadInboxMessagesForIds","messageIds","markReadAllInboxMessage","processNotificationEvent","eventDetail","setLogLevel","l","Number","handleIncrementValue","_handleIncrementDecrementValue","handleDecrementValue","setMultiValuesForKey","_handleMultiValueSet","addMultiValueForKey","_handleMultiValueAdd","addMultiValuesForKey","removeMultiValueForKey","_handleMultiValueRemove","removeMultiValuesForKey","removeValueForKey","_handleMultiValueDelete","_handleEmailSubscription","getLocation","lat","lng","Latitude","Longitude","geolocation","getCurrentPosition","showPosition","showError","coords","latitude","longitude","PERMISSION_DENIED","POSITION_UNAVAILABLE","TIMEOUT","UNKNOWN_ERROR","api","enableWebPush","_enableWebPush","tr","is_onloadcalled","subEmail","getEmail","withGroups","unSubEmail","unsubEmailGroups","isUnsubscribed","checked","setSubscriptionGroups","getSubscriptionGroups","changeSubscriptionGroups","updatedGroups","isGlobalUnsubscribe","setIsGlobalUnsubscribe","setUpdatedCategoryLong","$CLTP_WR","$WZRK_WR","currLocation","wzrk_ex","pageChanged","backupInterval","pgCount","referrerDomain","referrer","maxLen","utmSource","utm_source","wzrk_source","us","utmMedium","utm_medium","wzrk_medium","um","utmCampaign","utm_campaign","wzrk_campaign","uc","wm","cpg","arg","syncVariables","fetchVariables","addVariablesChangedCallback","addOneTimeVariablesChangedCallback","_processOldValues","timeout","debouncedPageChan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AsB7U,QAAtB,CAAtB;EACA6U,EAAAA,WAAW,GAAGvD,QAAQ,CAACuD,WAAD,EAAc,GAAd,EAAmBmI,cAAnB,CAAtB;;EAEA,4DAAcE,kBAAd,CAAiCrI,WAAjC,EAA8ChN,GAAG,CAAC+B,YAAlD;EACD;;MC9yBGuL,SAAS,GAAG,IAAI6mC,SAAJ,CAAcz0C,MAAM,CAAC4N,SAArB;EAElB5N,MAAM,CAAC4N,SAAP,GAAmB5N,MAAM,CAAC6N,SAAP,GAAmBD,SAAtC;;;;;;;;"} \ No newline at end of file diff --git a/clevertap.min.js b/clevertap.min.js index 83d8153d..12fc5d22 100644 --- a/clevertap.min.js +++ b/clevertap.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}var k=0;function C(e){return"__private_"+k+++"_"+e}function x(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var I,M="clevertap-prod.com",S="https:",P=C("accountId"),O=C("region"),E=C("targetDomain"),_=C("dcSdkversion"),A=C("token"),D=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.id,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:M,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";t(this,e),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:""}),Object.defineProperty(this,E,{writable:!0,value:M}),Object.defineProperty(this,_,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:""}),this.id=i,o&&(this.region=o),r&&(this.targetDomain=r),a&&(this.token=a)}return i(e,[{key:"id",get:function(){return x(this,P)[P]},set:function(e){x(this,P)[P]=e}},{key:"region",get:function(){return x(this,O)[O]},set:function(e){x(this,O)[O]=e}},{key:"dcSDKVersion",get:function(){return x(this,_)[_]},set:function(e){x(this,_)[_]=e}},{key:"targetDomain",get:function(){return x(this,E)[E]},set:function(e){x(this,E)[E]=e}},{key:"token",get:function(){return x(this,A)[A]},set:function(e){x(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===M?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostPEURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/defineVars")}},{key:"dataPostURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(S,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),L=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),j=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),T=new RegExp("'","g"),z="clear",N="Charged ID",R="WZRK_CHARGED_ID",B="WZRK_G",U="WZRK_K",F="WZRK_CAMP",V="WZRK_CAMP_G",W="WZRK_EV",q="WZRK_META",G="WZRK_PR",H="WZRK_ARP",K="WZRK_L",Z="global",J="optOut",Q="useIP",Y="WZRK_X",$="push",X=31536e3,ee="2",te="wzrk_",ne="wzrk_id",ie="Notification Viewed",oe="Notification Clicked",re="WZRK_FPU",ae="WZRK_PSD",se="$incr",le="$decr",ce="$set",de="$add",ue="$remove",pe="$delete",he="WZRK_INBOX_CONFIG",ge="WZRK_INBOX",fe=1e3,ve="wzrk_fetch",ye="WZRK_PUSH_CONFIG",be=["Stayed","UTM Visited","App Launched","Notification Sent",ie,oe],me=function(e){return"string"==typeof e||e instanceof String},we=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ke=function(t){return"object"===e(t)&&t instanceof Date},Ce=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},xe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Ie=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},Me=function(e){return null!=e&&"undefined"!==e},Se=function t(n,i){var o;if("object"!==e(n))return me(n)?(o=Pe(n,j)).length>1024&&(o=o.substring(0,1024),i.reportError(521,o+"... length exceeded 1024 chars. Trimmed.")):o=n,o;for(var r in n)if(n.hasOwnProperty(r)){var a=t(n[r],i),s=void 0;(s=Pe(r,L)).length>1024&&(s=s.substring(0,1024),i.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete n[r],n[s]=a}return n},Pe=function(e,t){return e.replace(t,"")},Oe=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},Ee=function(){return Math.floor((new Date).getTime()/1e3)},_e=function(e){return"$D_"+Math.round(e.getTime()/1e3)},Ae=function(e){if(De(e))return"$D_"+e},De=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var n=t[3],i=t[2]-1,o=t[1],r=new Date(o,i,n);return r.getDate()==n&&r.getMonth()==i&&r.getFullYear()==o},Le=function(){function e(){t(this,e)}return i(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(n=n+" domain="+t+"; path=/"),document.cookie=n}},{key:"createCookie",value:function(e,t,n,i){var o="",r="";if(n){var a=new Date;a.setTime(a.getTime()+1e3*n),o="; expires="+a.toGMTString()}i&&(r="; domain="+i),t=encodeURIComponent(t),document.cookie=e+"="+t+o+r+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i=0;s--){if(a=0===s?r[s]+a:"."+r[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,n,a),this.readCookie(e)==t){o=a,je.broadDomain=o;break}}else this.createCookie(e,t,n,o)}else this.createCookie(e,t,n,i)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(q);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var n=this.readFromLSorCookie(q);null==n&&(n={}),void 0===t?delete n[e]:n[e]=t,this.saveToLSorCookie(q,n)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(U);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(U,e)}},{key:"backupEvent",value:function(e,t,n){var i=this.readFromLSorCookie(K);void 0===i&&(i={}),i[t]={q:e},this.saveToLSorCookie(K,i),n.debug("stored in ".concat(K," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var n=this.readFromLSorCookie(K);null!=n&&void 0!==n[e]&&(t.debug("del event: ".concat(e," data-> ").concat(n[e].q)),delete n[e],this.saveToLSorCookie(K,n))}}]),e}(),je={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_CACHE:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{},pushConfig:null},Te=C("keyOrder"),ze=C("deleteFromObject"),Ne=function(){function e(n){t(this,e),Object.defineProperty(this,ze,{value:Re}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),this.max=n;var i=Le.readFromLSorCookie(Y);if(i){var o={};for(var r in x(this,Te)[Te]=[],i=i.cache)i.hasOwnProperty(r)&&(o[i[r][0]]=i[r][1],x(this,Te)[Te].push(i[r][0]));this.cache=o}else this.cache={},x(this,Te)[Te]=[]}return i(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=x(this,ze)[ze](e,this.cache),this.cache[e]=t,x(this,Te)[Te].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var n=this.cache[e],i=x(this,Te)[Te];null!=n?this.cache=x(this,ze)[ze](e,this.cache):i.length===this.max&&(this.cache=x(this,ze)[ze](i[0],this.cache)),this.cache[e]=t,x(this,Te)[Te][x(this,Te)[Te]-1]!==e&&x(this,Te)[Te].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],n=x(this,Te)[Te];for(var i in n)if(n.hasOwnProperty(i)){var o=[];o.push(n[i]),o.push(e[n[i]]),t.push(o)}Le.saveToLSorCookie(Y,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=x(this,Te)[Te];for(var n in t)if(t.hasOwnProperty(n)&&this.cache[t[n]]===e)return t[n];return null}},{key:"getSecondLastKey",value:function(){var e=x(this,Te)[Te];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=x(this,Te)[Te].length;if(e)return x(this,Te)[Te][e-1]}}]),e}(),Re=function(e,t){var n,i=JSON.parse(JSON.stringify(x(this,Te)[Te])),o={};for(var r in i)i.hasOwnProperty(r)&&(i[r]!==e?o[i[r]]=t[i[r]]:n=r);return i.splice(n,1),x(this,Te)[Te]=JSON.parse(JSON.stringify(i)),o},Be=C("logger"),Ue=C("request"),Fe=C("device"),Ve=C("session"),We=function(){function e(n){var i=n.logger,o=n.request,r=n.device,a=n.session;t(this,e),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Fe,{writable:!0,value:void 0}),Object.defineProperty(this,Ve,{writable:!0,value:void 0}),x(this,Be)[Be]=i,x(this,Ue)[Ue]=o,x(this,Fe)[Fe]=r,x(this,Ve)[Ve]=a}return i(e,[{key:"s",value:function(e,t,n,i,o){var r=!1,a=!1;if(window.isOULInProgress&&(n||"undefined"!==i&&i===window.oulReqN)&&(window.isOULInProgress=!1,r=!0),void 0===i&&(i=0),Le.removeBackup(i,x(this,Be)[Be]),!(i>je.globalCache.REQ_N)){if(Me(x(this,Fe)[Fe].gcookie)||e&&(a=!0),!Me(x(this,Fe)[Fe].gcookie)||n||"boolean"==typeof o){var s=x(this,Ve)[Ve].getSessionCookieObject();if(window.isOULInProgress||s.s&&t50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[n].length),e[n])if(e[n].hasOwnProperty(i)&&(!we(e[n][i])||!ot(e[n][i])))return!1}else{if(we(e[n])||Array.isArray(e[n]))return!1;ke(e[n])&&(e[n]=_e(e[n]))}if(me(e[N])||Ie(e[N])){var o=e[N]+"";if(void 0===I&&(I=Le.readFromLSorCookie(R)),void 0!==I&&I.trim()===o.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;I=o,Le.saveToLSorCookie(R,o)}return!0}return!1},at=C("logger"),st=C("oldValues"),lt=C("request"),ct=C("isPersonalisationActive"),dt=C("processEventArray"),ut=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,o),r=n.call(this),Object.defineProperty(h(r),dt,{value:pt}),Object.defineProperty(h(r),at,{writable:!0,value:void 0}),Object.defineProperty(h(r),st,{writable:!0,value:void 0}),Object.defineProperty(h(r),lt,{writable:!0,value:void 0}),Object.defineProperty(h(r),ct,{writable:!0,value:void 0}),x(h(r),at)[at]=a,x(h(r),st)[st]=i,x(h(r),lt)[lt]=s,x(h(r),ct)[ct]=l,r}return i(o,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0;){var t=e.shift();if(me(t))if(t.length>1024&&(t=t.substring(0,1024),x(this,at)[at].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),be.includes(t))x(this,at)[at].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var n={type:"event"};if(n.evtName=Pe(t,L),0!==e.length){var i=e.shift();if(we(i)){if("Charged"===t){if(!rt(i,x(this,at)[at])){x(this,at)[at].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!ot(i)){x(this,at)[at].reportError(512,t+" event structure invalid. Not sent.");continue}n.evtData=i}else e.unshift(i)}x(this,lt)[lt].processEvent(n)}else x(this,at)[at].error(Je)}},ht=function(e){var t={},n=e.indexOf("?");if(n>1){var i,o=e.substring(n+1),r=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(i=a.exec(o);i;)t[s(i[1])]=s(i[2]),i=a.exec(o)}return t},gt=function(e,t,n){return e+"&"+t+"="+encodeURIComponent(n)},ft=function(){return window.location.hostname},vt=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),bt(e)},yt=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),bt=function(e){if(null==e)return"";var t,n,i,o,r,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,n,i,o={},r={},a="",s="",l="",c=2,d=3,u=2,p="",h=0,g=0,f=String.fromCharCode;for(i=0;i>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++),o[s]=d++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t>=1}else{for(n=1,t=0;t>=1}0==--c&&(c=Math.pow(2,u),u++),delete r[l]}else for(n=o[l],t=0;t>=1;0==--c&&(c=Math.pow(2,u),u++)}for(n=2,t=0;t>=1;for(;;){if(h<<=1,15==g){p+=f(h);break}g++}return p}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,n=255&e.charCodeAt(c/2),i=c/2+1>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2>8,i=255&e.charCodeAt((c+1)/2)):n=i=NaN),c+=3,o=t>>2,r=(3&t)<<4|n>>4,a=(15&n)<<2|i>>6,s=63&i,isNaN(n)?a=s=64:isNaN(i)&&(s=64),l=l+yt.charAt(o)+yt.charAt(r)+yt.charAt(a)+yt.charAt(s);return l},mt=C("fireRequest"),wt=C("dropRequestDueToOptOut"),kt=C("addUseIPToRequest"),Ct=C("addARPToRequest"),xt=function(){function e(){t(this,e),this.networkRetryCount=0,this.minDelayFrequency=0}return i(e,[{key:"getDelayFrequency",value:function(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=fe,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),fe;var e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=fe,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}],[{key:"fireRequest",value:function(e,t,n,i){x(this,mt)[mt](e,1,t,n,i)}}]),e}();xt.logger=void 0,xt.device=void 0,xt.account=void 0,Object.defineProperty(xt,mt,{value:function(e,t,n,i,o){var r,a,s=this;if(x(this,wt)[wt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else{if(Me(this.device.gcookie)||(je.blockRequest=!0),o&&o===ve)!Me(this.device.gcookie)&&je.globalCache.RESP_N url: "+e)}}}),Object.defineProperty(xt,wt,{value:function(){return!je.isOptInRequest&&Me(this.device.gcookie)&&me(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(je.isOptInRequest=!1,!1)}}),Object.defineProperty(xt,kt,{value:function(e){var t=Le.getMetaProp(Q);return"boolean"!=typeof t&&(t=!1),gt(e,Q,t?"true":"false")}}),Object.defineProperty(xt,Ct,{value:function(e,t){if(!0===t){var n={skipResARP:!0};return gt(e,"arp",vt(JSON.stringify(n),this.logger))}return Le._isLocalStorageSupported()&&void 0!==localStorage.getItem(H)&&null!==localStorage.getItem(H)?gt(e,"arp",vt(JSON.stringify(Le.readFromLSorCookie(H)),this.logger)):e}});var It,Mt=function(){var e={};if(Le._isLocalStorageSupported()){var t=Le.read(F);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(T,'"'))).hasOwnProperty("global")?e.wp=t:e=t:e={}}return e},St=function(e){if(Le._isLocalStorageSupported()){var t=a(a({},Mt()),e),n=JSON.stringify(t);Le.save(F,encodeURIComponent(n)),Pt()}},Pt=function(){if(Le._isLocalStorageSupported()){var e=Le.read(B);if(Me(e))try{e=JSON.parse(decodeURIComponent(Le.read(B)));var t=Le.read(V)?JSON.parse(decodeURIComponent(Le.read(V))):{};if(e&&Le._isLocalStorageSupported()){var n={},i=Mt();Object.keys(i).forEach((function(r){var s=e in t&&Object.keys(t[e]).length&&t[e][r]?t[e][r]:{},l=i[r].global,c=Oe(),d=i[r][c];if(void 0!==l){var u=Object.keys(l);for(var p in u){var h=[];if(u.hasOwnProperty(p)){var g=0,f=0,v=u[p];if("tc"===v)continue;void 0!==d&&void 0!==d[v]&&(g=d[v]),void 0!==l&&void 0!==l[v]&&(f=l[v]),h=[v,g,f],s[v]=h}}}n=a(a({},n),{},o({},r,s))})),t[e]=n,Le.save(V,encodeURIComponent(JSON.stringify(t)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},Ot=function(){var e=JSON.parse(decodeURIComponent(Le.read(B))),t={};if(Le._isLocalStorageSupported()){t=Mt();var n=Le.read(V),i=n?decodeURIComponent(n):null,o=i?JSON.parse(i):null,r=e&&null!=n&&o&&o[e]&&o[e].wp?Object.values(o[e].wp):[],a=e&&null!=n&&o&&o[e]&&o[e].wi?Object.values(o[e].wi):[],s=Oe(),l=0,c=0;return t.wp&&t.wp[s]&&"undefined"!==t.wp[s].tc&&(l=t.wp[s].tc),t.wi&&t.wi[s]&&"undefined"!==t.wi[s].tc&&(c=t.wi[s].tc),{wmp:l,wimp:c,tlc:r,witlc:a}}},Et=function(e,t){var n=t.logger,i=!1;if(we(e))for(var o in e)if(e.hasOwnProperty(o)){i=!0;var r=e[o];if(null==r){delete e[o];continue}"Gender"!==o||r.match(/^M$|^F$/)||(i=!1,n.error(Qe)),"Employed"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error(Ye)),"Married"!==o||r.match(/^Y$|^N$/)||(i=!1,n.error($e)),"Education"!==o||r.match(/^School$|^College$|^Graduate$/)||(i=!1,n.error(Xe)),"Age"===o&&null!=r&&(xe(r)?e.Age=+r:(i=!1,n.error(et))),"DOB"===o?(/^\$D_/.test(r)&&11===(r+"").length||ke(r)||(i=!1,n.error(tt)),ke(r)&&(e[o]=_e(r))):ke(r)&&(e[o]=_e(r)),"Phone"!==o||Ce(r)||(r.length>8&&"+"===r.charAt(0)?(r=r.substring(1,r.length),xe(r)?e.Phone=+r:(i=!1,n.error(it+". Removed."))):(i=!1,n.error(it+". Removed."))),i||delete e[o]}return i},_t=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var n=function(e){if(null!=e){for(var t="",n="",i=0;i0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var o=e.birthday.split("/");t.DOB=Ae(o[2]+o[0]+o[1])}return t},At=function(e,t){var n=t.logger,i={};if(null!=e.displayName&&(i.Name=e.displayName),null!=e.id&&(i.GPID=e.id+""),null!=e.gender&&("male"===e.gender?i.Gender="M":"female"===e.gender?i.Gender="F":"other"===e.gender&&(i.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(i.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var o=0;o0)for(var t in e)if(e.hasOwnProperty(t)){var n=e[t],i={},o=void 0;if(null!=n.Site){if(o=n.Site,Ce(o)||!Et(o,{logger:x(this,zt)[zt]}))return}else if(null!=n.Facebook){var r=n.Facebook;Ce(r)||r.error||(o=_t(r))}else if(null!=n["Google Plus"]){var a=n["Google Plus"];Ce(a)||a.error||(o=At(a,{logger:x(this,zt)[zt]}))}if(null!=o&&!Ce(o)){i.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),i.profile=o,Dt(o,!0),i=x(this,Nt)[Nt].addSystemDataToObject(i,void 0),x(this,Nt)[Nt].addFlags(i);var s=vt(JSON.stringify(i),x(this,zt)[zt]),l=x(this,Rt)[Rt].dataPostURL;l=gt(l,"type",$),l=gt(l,"d",s),x(this,Nt)[Nt].saveAndFireRequest(l,je.blockRequest)}}},qt=C("request"),Gt=C("logger"),Ht=C("account"),Kt=C("session"),Zt=C("oldValues"),Jt=C("device"),Qt=C("processOUL"),Yt=C("handleCookieFromCache"),$t=C("deleteUser"),Xt=C("processLoginArray"),en=function(e){s(o,e);var n=f(o);function o(e,i){var r,a=e.request,s=e.account,l=e.session,c=e.logger,d=e.device;return t(this,o),r=n.call(this),Object.defineProperty(h(r),Xt,{value:rn}),Object.defineProperty(h(r),$t,{value:on}),Object.defineProperty(h(r),Yt,{value:nn}),Object.defineProperty(h(r),Qt,{value:tn}),Object.defineProperty(h(r),qt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Gt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Ht,{writable:!0,value:void 0}),Object.defineProperty(h(r),Kt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Zt,{writable:!0,value:void 0}),Object.defineProperty(h(r),Jt,{writable:!0,value:void 0}),x(h(r),qt)[qt]=a,x(h(r),Ht)[Ht]=s,x(h(r),Kt)[Kt]=l,x(h(r),Gt)[Gt]=c,x(h(r),Zt)[Zt]=i,x(h(r),Jt)[Jt]=d,r}return i(o,[{key:"clear",value:function(){x(this,Gt)[Gt].debug("clear called. Reset flag has been set."),x(this,$t)[$t](),Le.setMetaProp(z,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n0)for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],a={},s=void 0;if(null!=r.Site){if(s=r.Site,Ce(s)||!Et(s,{logger:x(this,Gt)[Gt]}))return}else if(null!=r.Facebook){var l=r.Facebook;Ce(l)||l.error||(s=_t(l))}else if(null!=r["Google Plus"]){var c=r["Google Plus"];Ce(c)&&!c.error&&(s=At(c,{logger:x(this,Gt)[Gt]}))}if(null!=s&&!Ce(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var d=[];Le._isLocalStorageSupported()&&(s.Identity&&d.push(s.Identity),s.Email&&d.push(s.Email),s.GPID&&d.push("GP:"+s.GPID),s.FBID&&d.push("FB:"+s.FBID),d.length>0&&i(d)),Dt(s,!0),a=x(this,qt)[qt].addSystemDataToObject(a,void 0),x(this,qt)[qt].addFlags(a),n&&(a.isOUL=!0);var u=vt(JSON.stringify(a),x(this,Gt)[Gt]),p=x(this,Ht)[Ht].dataPostURL;p=gt(p,"type",$),p=gt(p,"d",u),x(this,qt)[qt].saveAndFireRequest(p,je.blockRequest,n)}}},nn=function(){je.blockRequest=!1,console.debug("Block request is false"),Le._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(F,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Kt)[Kt].setSessionCookieObject("")},on=function(){je.blockRequest=!0,x(this,Gt)[Gt].debug("Block request is true"),je.globalCache={gcookie:null,REQ_N:0,RESP_N:0},Le._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),Le.removeCookie(B,je.broadDomain),Le.removeCookie(F,ft()),Le.removeCookie(U,ft()),Le.removeCookie(x(this,Kt)[Kt].cookieName,je.broadDomain),Le.removeCookie(H,je.broadDomain),x(this,Jt)[Jt].gcookie=null,x(this,Kt)[Kt].setSessionCookieObject("")},rn=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&we(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){Le.setInstantDeleteFlagInK();try{x(this,Qt)[Qt]([t])}catch(e){x(this,Gt)[Gt].debug(e)}}else x(this,Gt)[Gt].error("Profile object is in incorrect format")}},an=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._session=null,e.shadow=null,e.popup=null,e.container=null,e.resizeObserver=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderImageOnlyPopup",value:function(){var e=this,t=this.target.wzrk_id.split("_")[0],n=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((function(){return e.handleResize(e.popup,e.container)})),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(function(){if(e.resizeObserver.unobserve(e.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",e.remove(),null!=t&&"-1"!==t&&Le._isLocalStorageSupported()){var i=Mt(),o=i.wp[n];null==o&&(o={},i[n]=o),o[t]="dnd",St(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(function(){e.target.display.window?window.open(e.onClickUrl,"_blank"):window.parent.location.href=e.onClickUrl,window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})}))}},{key:"handleResize",value:function(e,t){var n=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(n,"px"))}},{key:"getImageOnlyPopupContent",value:function(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}},{key:"updateImageAndContainerWidth",value:function(){var e=this;return function(){var t=e.getRenderedImageWidth(e.popup);e.popup.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("width","".concat(t,"px")),e.container.style.setProperty("height","auto"),e.container.style.setProperty("position","fixed"),e.popup.style.setProperty("visibility","visible"),e.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}},{key:"getRenderedImageWidth",value:function(e){var t=e.naturalWidth/e.naturalHeight;return e.height*t}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}},{key:"session",get:function(){return this._session||""},set:function(e){this._session=e}},{key:"msgId",get:function(){return this.target.wzrk_id}},{key:"pivotId",get:function(){return this.target.wzrk_pivot}},{key:"onClickUrl",get:function(){return this.target.display.onClickUrl}}]),o}(p(HTMLElement)),sn=function(e){s(o,e);var n=f(o);function o(e,i){var r;return t(this,o),(r=n.call(this)).wrapper=null,r.snackBar=null,r.shadow=r.attachShadow({mode:"open"}),r.config=e,r.message=i,r.renderMessage(i),r}return i(o,[{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"renderMessage",value:function(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":var t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}var n=this.createEl("div","timeStamp");if(n.innerHTML="".concat(yn(e.id.split("_")[1]),""),!e.viewed){var i=this.createEl("span","unreadMarker");n.appendChild(i)}this.wrapper.appendChild(n),this.shadow.appendChild(this.wrapper)}},{key:"prepareBasicMessage",value:function(e){var t=this.createEl("div","message");if(e.imageUrl){var n=this.addImage(e.imageUrl,"mainImg");t.appendChild(n)}var i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){var o=this.addImage(e.iconUrl,"iconImg");i.appendChild(o)}var r=this.createEl("div","titleDescWrapper");if(e.title){var a=this.createEl("div","title");a.innerText=e.title,r.appendChild(a)}if(e.description){var s=this.createEl("div","description");s.innerText=e.description,r.appendChild(s)}if((e.title||e.description)&&i.appendChild(r),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){var l=this.addButtons(e.buttons);t.appendChild(l)}return t}},{key:"addButtons",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.createEl("div","buttonsContainer"),i=!1;return t.forEach((function(t,o){var r=e.createEl("button","button-".concat(o),"button");r.innerText=t.text,o>0&&(r.style.cssText+="margin-left: 2px;"),"copy"===t.action&&(i=!0),n.appendChild(r)})),i&&this.addSnackbar(n),n}},{key:"addSnackbar",value:function(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=wn;var t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}},{key:"addImage",value:function(e,t){var n=this.createEl("div","".concat(t,"Container")),i=this.createEl("img",t);return i.setAttribute("src",e),i.setAttribute("loading","lazy"),n.appendChild(i),n}},{key:"raiseClickedEvent",value:function(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}},{key:"raiseClickedForBasicTemplates",value:function(e,t){var n=this,i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){var r=e.id.split("-")[1],a=i.buttons[r];o.kv={wzrk_c2a:a.text},"url"===a.action?a.openUrlInNewTab?window.open(a.url,"_blank"):window.location=a.url:"copy"===a.action&&(window.focus(),navigator.clipboard.writeText(a.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((function(){n.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}},{key:"pivotId",get:function(){return this.message.wzrk_pivot}},{key:"campaignId",get:function(){return this.message.wzrk_id}}]),o}(p(HTMLElement)),ln=function(e){s(o,e);var n=f(o);function o(e){var i;return t(this,o),(i=n.call(this)).isInboxOpen=!1,i.isInboxFromFlutter=!1,i.selectedCategory=null,i.unviewedMessages={},i.unviewedCounter=0,i.isPreview=!1,i.inboxConfigForPreview={},i.inboxSelector=null,i.inbox=null,i.emptyInboxMsg=null,i.inboxCard=null,i.unviewedBadge=null,i.observer=null,i.selectedCategoryRef=null,i.addClickListenerOnDocument=function(e){if(e.composedPath().includes(i.inbox)){var t=e.path||e.composedPath&&e.composedPath();if(t.length){var n=t[0].id;if("closeInbox"===n)i.toggleInbox();else if(n.startsWith("category-"))i.prevCategoryRef=i.selectedCategoryRef,i.selectedCategoryRef=t[0],i.updateActiveCategory(t[0].innerText);else{var o=t.filter((function(e){var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));o.length&&o[o.length-1].raiseClickedEvent(o[0],i.isPreview)}}}else(i.inboxSelector.contains(e.target)||i.isInboxOpen)&&(i.isInboxFromFlutter?i.isInboxFromFlutter=!1:i.toggleInbox(e))},i.setBadgeStyle=function(e){null!==i.unviewedBadge&&(i.unviewedBadge.innerText=e>9?"9+":e,i.unviewedBadge.style.display=e>0?"flex":"none")},i.logger=e,i.shadow=i.attachShadow({mode:"open"}),i}return i(o,[{key:"connectedCallback",value:function(){this.init()}},{key:"init",value:function(){this.config=this.isPreview?this.inboxConfigForPreview:Le.readFromLSorCookie(he)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}},{key:"addMsgsToInboxFromLS",value:function(){var e=this,t=this.deleteExpiredAndGetUnexpiredMsgs(!1),n=t?Object.keys(t):[];0!==n.length&&(n.forEach((function(n){t[n].viewed||(e.unviewedMessages[n]=t[n],e.unviewedCounter++)})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}},{key:"deleteExpiredAndGetUnexpiredMsgs",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=pn(),n=Math.floor(Date.now()/1e3);for(var i in t)if(t[i].wzrk_ttl&&t[i].wzrk_ttl>0&&t[i].wzrk_ttl0&&(t=Object.values(t).sort((function(e,t){return t.date-e.date})).reduce((function(e,t){return e[t.id]=t,e}),{})),hn(t),t}},{key:"updateInboxMessages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};t.forEach((function(t,r){var a="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=a,t.date=i-r,t.viewed=0,n[a]=t,o[a]=t,e.unviewedMessages[a]=t,e.unviewedCounter++})),hn(n),this.buildUIForMessages(o),this.updateUnviewedBadgeCounter()}},{key:"createEl",value:function(e,t,n){var i=document.createElement(e);return i.setAttribute("id",t),i.setAttribute("part",n||t),i}},{key:"addUnviewedBadge",value:function(){var e=this;this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(function(){e.updateUnviewedBadgePosition()}))}},{key:"updateUnviewedBadgePosition",value:function(){var e=this.inboxSelector.getBoundingClientRect(),t=e.top,n=e.right;this.unviewedBadge.style.top="".concat(t-8,"px"),this.unviewedBadge.style.left="".concat(n-8,"px")}},{key:"createinbox",value:function(){var e=this;this.inbox=this.createEl("div","inbox");var t=this.createEl("div","header"),n=this.createEl("div","headerTitle");n.innerText=this.config.title;var i=this.createEl("div","closeInbox");if(i.innerHTML="×",t.appendChild(n),t.appendChild(i),this.inbox.appendChild(t),this.config.categories.length){var o=this.createCategories();this.inbox.appendChild(o)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);var r={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver((function(t,n){e.handleMessageViewed(t)}),r),this.addMsgsToInboxFromLS()}},{key:"createCategories",value:function(){var e=this,t=this.createEl("div","categoriesContainer"),n=this.createEl("div","leftArrow");n.innerHTML=mn,n.children[0].style="transform: rotate(180deg)",n.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),t.appendChild(n);var i=this.createEl("div","categoriesWrapper");["All"].concat(y(this.config.categories)).forEach((function(t,n){var o=e.createEl("div","category-".concat(n),"category");o.innerText=t,0===n&&(e.selectedCategoryRef=o),i.appendChild(o)})),t.appendChild(i);var o=this.createEl("div","rightArrow");o.innerHTML=mn,o.addEventListener("click",(function(){e.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),t.appendChild(o);var r={root:t,threshold:.9},a=i.children[0],s=i.children[this.config.categories.length];return new IntersectionObserver((function(t){e.categoryObserverCb(n,t[0].intersectionRatio>=.9)}),r).observe(a),new IntersectionObserver((function(t){e.categoryObserverCb(o,t[0].intersectionRatio>=.9)}),r).observe(s),t}},{key:"categoryObserverCb",value:function(e,t){e&&(e.style.display=t?"none":"flex")}},{key:"updateActiveCategory",value:function(e){var t=this;this.selectedCategory=e,this.inboxCard.scrollTop=0;var n=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((function(e){"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===t.selectedCategory||e.getAttribute("category")===t.selectedCategory?"block":"none","block"===e.style.display&&n++)})),0===n?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}},{key:"buildUIForMessages",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;var n,i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,r=Object.values(t).sort((function(e,t){return t.date-e.date})).map((function(e){return e.id})),a=w(r);try{for(a.s();!(n=a.n()).done;){var s=n.value,l=new sn(this.config,t[s]);l.setAttribute("id",t[s].id),l.setAttribute("pivot",t[s].wzrk_pivot),l.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(l.setAttribute("category",t[s].tags[0]||""),l.style.display="All"===this.selectedCategory||t[s].category===this.selectedCategory?"block":"none"):l.style.display="block",this.inboxCard.insertBefore(l,o),this.observer.observe(l)}}catch(e){a.e(e)}finally{a.f()}for(var c=this.inboxCard.querySelectorAll("ct-inbox-message").length;c>i;){var d=this.inboxCard.querySelectorAll("ct-inbox-message");d.length>0&&d[d.length-1].remove(),c--}var u=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=u?"none":"block"}},{key:"handleMessageViewed",value:function(e){var t=this,n=!this.isPreview;this.isInboxOpen&&e.forEach((function(e){e.isIntersecting&&t.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,n?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.updateMessageInLS(e.target.id,a(a({},e.target.message),{},{viewed:1})),setTimeout((function(){e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),t.unviewedCounter--,t.updateUnviewedBadgeCounter(),delete t.unviewedMessages[e.target.id])}))}},{key:"updateMessageInLS",value:function(e,t){if(!this.isPreview){var n=pn();n[e]=t,hn(n)}}},{key:"toggleInbox",value:function(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}},{key:"setInboxPosition",value:function(e){var t=window.outerWidth,n=getComputedStyle(je.inbox),i=n.getPropertyValue("--inbox-top"),o=n.getPropertyValue("--inbox-bottom"),r=n.getPropertyValue("--inbox-left"),a=n.getPropertyValue("--inbox-right");if(t>481&&!(i||o||r||a)){var s=vn(e,this.inbox.clientHeight,this.inbox.clientWidth),l=s.xPos,c=s.yPos;this.inbox.style.top=c+"px",this.inbox.style.left=l+"px"}}},{key:"updateUnviewedBadgeCounter",value:function(){if(this.isPreview)this.setBadgeStyle(this.unviewedCounter);else{var e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(t){var n=pn();n[t.id]&&0===n[t.id].viewed&&e++})),this.setBadgeStyle(e)}}},{key:"updateTSForRenderedMsgs",value:function(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((function(e){var t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=yn(t)}))}},{key:"getInboxStyles",value:function(){var e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);var n,i,o,r,a,s,l,c,d,u,p,h,g,f,v,y,b,m,w,k,C,x=(i=(n=t).panelBackgroundColor,o=n.panelBorderColor,r=n.headerBackgroundColor,a=n.headerTitleColor,s=n.closeIconColor,l=n.categoriesTabColor,c=n.categoriesTitleColor,d=n.categoriesBorderColor,u=n.selectedCategoryTabColor,p=n.selectedCategoryTitleColor,h=n.selectedCategoryBorderColor,g=n.headerCategoryHeight,'\n \n ")),I=this.config.styles.cards;return x+(f={backgroundColor:I.backgroundColor,borderColor:I.borderColor,titleColor:I.titleColor,descriptionColor:I.descriptionColor,buttonColor:I.buttonColor,buttonTextColor:I.buttonTextColor,unreadMarkerColor:I.unreadMarkerColor},v=f.backgroundColor,y=f.borderColor,b=f.titleColor,m=f.descriptionColor,w=f.buttonColor,k=f.buttonTextColor,C=f.unreadMarkerColor,'\n \n "))}},{key:"incomingMessages",get:function(){return[]},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.length>0&&this.inbox&&this.updateInboxMessages(e)}},{key:"incomingMessagesForPreview",get:function(){return[]},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={};t.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,t.forEach((function(t){var i="".concat(t.wzrk_id.split("_")[0],"_").concat(Date.now());t.id=i,n[i]=t,e.unviewedMessages[i]=t,e.unviewedCounter++})),this.buildUIForMessages(n),this.updateUnviewedBadgeCounter())}}]),o}(p(HTMLElement)),cn=function(e){e.inbox_preview?je.inbox.incomingMessagesForPreview=e.inbox_notifs:je.inbox.incomingMessages=e},dn=function(e){fn(),je.inbox=new ln({logger:e}),document.body.appendChild(je.inbox)},un=function(e){var t=Le.readFromLSorCookie(ge)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){var n={};return n[e]=t,Le.saveToLSorCookie(ge,n),n}return t},pn=function(){var e=JSON.parse(decodeURIComponent(Le.read(B)));if(!Me(e))return{};var t=un(e);return t.hasOwnProperty(e)?t[e]:{}},hn=function(e){var t=JSON.parse(decodeURIComponent(Le.read(B)));if(Me(t)){var n=a(a({},un(t)),{},o({},t,e));Le.saveToLSorCookie(ge,n)}},gn=function(e){return new Promise((function(t,n){if("complete"===document.readyState)dn(e),t();else{var i=Le.readFromLSorCookie(he)||{},o=function(){null===je.inbox&&dn(e),t()};window.addEventListener("load",(function(){if(document.getElementById(i.inboxSelector))o();else{var n=0;if(n<20)var r=setInterval((function(){document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}))}}))},fn=function(){void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",ln),customElements.define("ct-inbox-message",sn))},vn=function(e,t,n){var i,o,r=document.scrollingElement.scrollLeft,a=document.scrollingElement.scrollTop,s=window.innerWidth+r,l=window.innerHeight+a,c=e.rect||e.target.getBoundingClientRect(),d=c.x+r,u=c.y+a,p=c.left+r,h=c.right+r,g=c.top+a,f=c.bottom,v=c.height,y=c.width,b=!1,m=16;if(f+t<=l){var w=l-(f+t);o=w>=m?f+m:f+w}else if(g-t>=a){var k=g-t;o=k>=m?g-t-m:g-t-k}else b=!0,(o=u+v/2-t/2)l&&(o=l-t);if(b){var C=h+n;if(C<=s){i=h+(C+m<=s?m:s-C)}else{var x=p-n;i=x-(x-m>=r?m:x-r)}}else(i=d+y/2-n/2)s&&(i=h-n>=r?h-n:s-n);return{xPos:i,yPos:o}},yn=function(e){var t=Date.now(),n=Math.floor((t-e)/6e4);return n<5?"Just now":n<60?"".concat(n," minute").concat(n>1?"s":""," ago"):(n=Math.floor(n/60))<24?"".concat(n," hour").concat(n>1?"s":""," ago"):(n=Math.floor(n/24),"".concat(n," day").concat(n>1?"s":""," ago"))},bn=function(){return Object.keys(Le.readFromLSorCookie(he)||{}).length>0},mn='\n\n\n',wn='\n\n\n',kn="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Cn="wve-anti-flicker-show",xn="wve-anti-flicker-hide",In="wve-flicker-style",Mn=function(e,t){var n=window.location.search,i=window.opener;if("?ctBuilder"===n)return e.debug("open in visual builder mode"),window.addEventListener("message",Sn,!1),void(i&&i.postMessage({message:"builder",originUrl:window.location.href},"*"));if("?ctBuilderPreview"===n&&(window.addEventListener("message",Sn,!1),i&&i.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===n&&i){i.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:"1.11.3"},"*")}},Sn=function(e){if(e.data&&function(e){try{var t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){var t,n,i=new URL(e.data.originUrl).origin;if(e.origin===i)if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,Pn(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(n=e.data.details)&&void 0!==n?n:{},e.data.personalisation);else"Overlay"===e.data.message&&An(e.data,!0)}},Pn=function(e,t,n,i){"complete"===document.readyState?_n(e,t,n,i):document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&_n(e,t,n,i)}))},On=!1,En=!1;function _n(e,t,n,i){if(!On){window.Shopify&&(En=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",(It=document.createElement("div")).id="overlayDiv",It.style.position="relative",It.style.display="flex",document.body.appendChild(It);(function(e,t,n,i,o){return new Promise((function(r,a){var s=document.createElement("script");s.type="module",s.src=e,s.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:n,details:i,isShopify:En,personalisation:o}),r()):a(new Error("ContentLayout not found in overlay.js"))},s.onerror=function(e){a(e)},document.head.appendChild(s)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,n,i).then((function(){console.log("Overlay script loaded successfully."),On=!0})).catch((function(e){console.error("Error loading overlay script:",e)})),(o=document.createElement("link")).rel="stylesheet",o.type="text/css",o.href=kn,document.head.appendChild(o)}var o}var An=function(e,t){var n=t?e.details:e.display.details,i=!1,o={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=function(){t||i||(i=!0,window.clevertap.renderNotificationViewed(o))},a=function(n,i){var r;i.values&&(i.values.html?n.outerHTML=i.values.html:(null===(r=i.values)||void 0===r?void 0:r.json)?function(e,t){var n={};n.msgId=e.wzrk_id,e.wzrk_pivot&&(n.pivotId=e.wzrk_pivot);null!=t.json&&(n.json=t.json);var i=new CustomEvent("CT_web_native_display_buider",{detail:n});document.dispatchEvent(i)}(e,i.values):(o.msgCTkv={wzrk_selector:i.selector},function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((function(n){e.style.setProperty(n,t.style[n])})),void 0!==t.underline){var o=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(o," underline").trim():e.style.textDecoration=o.replace("underline","").trim()}if(void 0!==t.text&&(console.log(t.text),e.innerText=i?t.text.text:t.text),void 0!==t.clickDetails){var r=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?function(){i||window.clevertap.raiseNotificationClicked(n),window.open(r,"_blank").focus()}:function(){i||window.clevertap.raiseNotificationClicked(n),window.location.href=r}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){var a=document.createElement("style");a.innerHTML=t.elementCss,document.head.appendChild(a)}}(n,i.values.form,o,t)))};n.forEach((function(e){e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((function(e){var t,n,i,o=document.querySelector(e.selector);o?(r(),a(o,e)):(t=e,n=0,i=setInterval((function(){var e=document.querySelector(t.selector);e?(r(),a(e,t),clearInterval(i)):++n>=20&&(console.log("No element present on DOM with selector '".concat(t,"'.")),clearInterval(i))}),500))}))}))};function Dn(e){var t,n=e.personalizedSelectors,i=void 0===n?[]:n,o=e.delayTime,r=void 0===o?2e3:o,a={},s=0;function l(e){function n(e){var t=[];e.forEach((function(e){var n=document.querySelectorAll(e);n.length?(n.forEach((function(e){var n,i,o,r;n=e.getBoundingClientRect(),i=window,o=i.innerHeight,r=i.innerWidth,n.bottom>0&&n.right>0&&n.top20)&&(s=0,clearInterval(t))}),100))}!function(){var e=In;if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("load",(function(){var e;e=document.location.href,new MutationObserver((function(){e!==document.location.href&&(e=document.location.href,l(i))})).observe(document.body,{childList:!0,subtree:!0}),l(i)}))}var Ln=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._details=null,e.shadow=null,e.shadow=e.attachShadow({mode:"open"}),e}return i(o,[{key:"renderBanner",value:function(){var e=this;this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(function(){var t=e.details.onClick;t&&(e.details.window?window.open(t,"_blank"):window.parent.location.href=t),window.clevertap.renderNotificationClicked({msgId:e.msgId,pivotId:e.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}},{key:"getBannerContent",value:function(){return'\n \n \n ")}},{key:"details",get:function(){return this._details||""},set:function(e){null===this._details&&(this._details=e,this.renderBanner())}}]),o}(p(HTMLElement)),jn=function(e){s(o,e);var n=f(o);function o(){var e;return t(this,o),(e=n.call(this))._target=null,e._carousel=null,e.shadow=null,e.slides=0,e.previouslySelectedItem=-1,e.selectedItem=1,e.autoSlide=null,e.stopAutoSlideTimeout=null,e.shadow=e.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln),e}return i(o,[{key:"renderCarousel",value:function(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();var e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}},{key:"setupClick",value:function(){var e=this;this._carousel.addEventListener("click",(function(t){var n=t.target.id;if(n.startsWith("carousel__button")){var i=+n.split("-")[1];i!==e.selectedItem&&(e.previouslySelectedItem=e.selectedItem,e.selectedItem=i,e.updateSelectedItem(),e.startAutoSlide())}else if(n.startsWith("carousel__arrow"))n.endsWith("right")?e.goToNext():e.goToPrev(),e.startAutoSlide();else if(n.indexOf("-")>-1){var o=+n.split("-")[1],r=o-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:e.target.wzrk_id,pivotId:e.target.wzrk_pivot,wzrk_slideNo:o});var a=e.details[r].onClick;""!==a&&(e.details[r].window?window.open(a,"_blank"):window.location.href=a)}}))}},{key:"setupOnHover",value:function(){var e=this;this._carousel.addEventListener("mouseenter",(function(t){e.stopAutoSlideTimeout=setTimeout((function(){e.autoSlide=clearInterval(e.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(function(t){clearTimeout(e.stopAutoSlideTimeout),void 0===e.autoSlide&&e.startAutoSlide()}))}},{key:"getCarouselContent",value:function(){var e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach((function(t,n){var i=document.createElement("ct-web-personalisation-banner");i.classList.add("carousel__item"),i.trackClick=!1,i.setAttribute("id","carousel__item-".concat(n+1)),i.details=t,e.appendChild(i)})),e}},{key:"getStyles",value:function(){var e,t;return"\n \n ")}},{key:"updateSelectedItem",value:function(){if(-1!==this.previouslySelectedItem){var e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}var n=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),i=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));n.classList.add("carousel__item--selected"),i&&i.classList.add("carousel__button--selected")}},{key:"startAutoSlide",value:function(){var e=this;clearInterval(this.autoSlide),this.autoSlide=setInterval((function(){e.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}},{key:"goToNext",value:function(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}},{key:"goToPrev",value:function(){this.goTo(this.selectedItem,this.selectedItem-1)}},{key:"goTo",value:function(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}},{key:"target",get:function(){return this._target||""},set:function(e){null===this._target&&(this._target=e,this.renderCarousel())}},{key:"details",get:function(){return this.target.display.details}},{key:"display",get:function(){return this.target.display}}]),o}(p(HTMLElement)),Tn=function(e){var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",Ln);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-banner");i.msgId=e.wzrk_id,i.pivotId=e.wzrk_pivot,i.divHeight=e.display.divHeight,i.details=e.display.details[0];var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},zn=function(e){var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",jn);var n=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,i=document.createElement("ct-web-personalisation-carousel");i.target=e;var o=e.display.divId?document.getElementById(n):document.querySelector(n);o.innerHTML="",o.appendChild(i)},Nn=function(e){var t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);var n=new CustomEvent("CT_web_native_display",{detail:t});document.dispatchEvent(n)},Rn=function(e,t){var n=window.parent[e];"function"==typeof n&&(null!=t.display.kv?n(t.display.kv):n())},Bn=function(e,t){var n="