apxor-rtm-ui 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,6 +52,307 @@
52
52
  }
53
53
  return e;
54
54
  }
55
+ function _regeneratorRuntime() {
56
+ _regeneratorRuntime = function () {
57
+ return e;
58
+ };
59
+ var t,
60
+ e = {},
61
+ r = Object.prototype,
62
+ n = r.hasOwnProperty,
63
+ o = Object.defineProperty || function (t, e, r) {
64
+ t[e] = r.value;
65
+ },
66
+ i = "function" == typeof Symbol ? Symbol : {},
67
+ a = i.iterator || "@@iterator",
68
+ c = i.asyncIterator || "@@asyncIterator",
69
+ u = i.toStringTag || "@@toStringTag";
70
+ function define(t, e, r) {
71
+ return Object.defineProperty(t, e, {
72
+ value: r,
73
+ enumerable: !0,
74
+ configurable: !0,
75
+ writable: !0
76
+ }), t[e];
77
+ }
78
+ try {
79
+ define({}, "");
80
+ } catch (t) {
81
+ define = function (t, e, r) {
82
+ return t[e] = r;
83
+ };
84
+ }
85
+ function wrap(t, e, r, n) {
86
+ var i = e && e.prototype instanceof Generator ? e : Generator,
87
+ a = Object.create(i.prototype),
88
+ c = new Context(n || []);
89
+ return o(a, "_invoke", {
90
+ value: makeInvokeMethod(t, r, c)
91
+ }), a;
92
+ }
93
+ function tryCatch(t, e, r) {
94
+ try {
95
+ return {
96
+ type: "normal",
97
+ arg: t.call(e, r)
98
+ };
99
+ } catch (t) {
100
+ return {
101
+ type: "throw",
102
+ arg: t
103
+ };
104
+ }
105
+ }
106
+ e.wrap = wrap;
107
+ var h = "suspendedStart",
108
+ l = "suspendedYield",
109
+ f = "executing",
110
+ s = "completed",
111
+ y = {};
112
+ function Generator() {}
113
+ function GeneratorFunction() {}
114
+ function GeneratorFunctionPrototype() {}
115
+ var p = {};
116
+ define(p, a, function () {
117
+ return this;
118
+ });
119
+ var d = Object.getPrototypeOf,
120
+ v = d && d(d(values([])));
121
+ v && v !== r && n.call(v, a) && (p = v);
122
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
123
+ function defineIteratorMethods(t) {
124
+ ["next", "throw", "return"].forEach(function (e) {
125
+ define(t, e, function (t) {
126
+ return this._invoke(e, t);
127
+ });
128
+ });
129
+ }
130
+ function AsyncIterator(t, e) {
131
+ function invoke(r, o, i, a) {
132
+ var c = tryCatch(t[r], t, o);
133
+ if ("throw" !== c.type) {
134
+ var u = c.arg,
135
+ h = u.value;
136
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
137
+ invoke("next", t, i, a);
138
+ }, function (t) {
139
+ invoke("throw", t, i, a);
140
+ }) : e.resolve(h).then(function (t) {
141
+ u.value = t, i(u);
142
+ }, function (t) {
143
+ return invoke("throw", t, i, a);
144
+ });
145
+ }
146
+ a(c.arg);
147
+ }
148
+ var r;
149
+ o(this, "_invoke", {
150
+ value: function (t, n) {
151
+ function callInvokeWithMethodAndArg() {
152
+ return new e(function (e, r) {
153
+ invoke(t, n, e, r);
154
+ });
155
+ }
156
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
157
+ }
158
+ });
159
+ }
160
+ function makeInvokeMethod(e, r, n) {
161
+ var o = h;
162
+ return function (i, a) {
163
+ if (o === f) throw new Error("Generator is already running");
164
+ if (o === s) {
165
+ if ("throw" === i) throw a;
166
+ return {
167
+ value: t,
168
+ done: !0
169
+ };
170
+ }
171
+ for (n.method = i, n.arg = a;;) {
172
+ var c = n.delegate;
173
+ if (c) {
174
+ var u = maybeInvokeDelegate(c, n);
175
+ if (u) {
176
+ if (u === y) continue;
177
+ return u;
178
+ }
179
+ }
180
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
181
+ if (o === h) throw o = s, n.arg;
182
+ n.dispatchException(n.arg);
183
+ } else "return" === n.method && n.abrupt("return", n.arg);
184
+ o = f;
185
+ var p = tryCatch(e, r, n);
186
+ if ("normal" === p.type) {
187
+ if (o = n.done ? s : l, p.arg === y) continue;
188
+ return {
189
+ value: p.arg,
190
+ done: n.done
191
+ };
192
+ }
193
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
194
+ }
195
+ };
196
+ }
197
+ function maybeInvokeDelegate(e, r) {
198
+ var n = r.method,
199
+ o = e.iterator[n];
200
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
201
+ var i = tryCatch(o, e.iterator, r.arg);
202
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
203
+ var a = i.arg;
204
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
205
+ }
206
+ function pushTryEntry(t) {
207
+ var e = {
208
+ tryLoc: t[0]
209
+ };
210
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
211
+ }
212
+ function resetTryEntry(t) {
213
+ var e = t.completion || {};
214
+ e.type = "normal", delete e.arg, t.completion = e;
215
+ }
216
+ function Context(t) {
217
+ this.tryEntries = [{
218
+ tryLoc: "root"
219
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
220
+ }
221
+ function values(e) {
222
+ if (e || "" === e) {
223
+ var r = e[a];
224
+ if (r) return r.call(e);
225
+ if ("function" == typeof e.next) return e;
226
+ if (!isNaN(e.length)) {
227
+ var o = -1,
228
+ i = function next() {
229
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
230
+ return next.value = t, next.done = !0, next;
231
+ };
232
+ return i.next = i;
233
+ }
234
+ }
235
+ throw new TypeError(typeof e + " is not iterable");
236
+ }
237
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
238
+ value: GeneratorFunctionPrototype,
239
+ configurable: !0
240
+ }), o(GeneratorFunctionPrototype, "constructor", {
241
+ value: GeneratorFunction,
242
+ configurable: !0
243
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
244
+ var e = "function" == typeof t && t.constructor;
245
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
246
+ }, e.mark = function (t) {
247
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
248
+ }, e.awrap = function (t) {
249
+ return {
250
+ __await: t
251
+ };
252
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
253
+ return this;
254
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
255
+ void 0 === i && (i = Promise);
256
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
257
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
258
+ return t.done ? t.value : a.next();
259
+ });
260
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
261
+ return this;
262
+ }), define(g, "toString", function () {
263
+ return "[object Generator]";
264
+ }), e.keys = function (t) {
265
+ var e = Object(t),
266
+ r = [];
267
+ for (var n in e) r.push(n);
268
+ return r.reverse(), function next() {
269
+ for (; r.length;) {
270
+ var t = r.pop();
271
+ if (t in e) return next.value = t, next.done = !1, next;
272
+ }
273
+ return next.done = !0, next;
274
+ };
275
+ }, e.values = values, Context.prototype = {
276
+ constructor: Context,
277
+ reset: function (e) {
278
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
279
+ },
280
+ stop: function () {
281
+ this.done = !0;
282
+ var t = this.tryEntries[0].completion;
283
+ if ("throw" === t.type) throw t.arg;
284
+ return this.rval;
285
+ },
286
+ dispatchException: function (e) {
287
+ if (this.done) throw e;
288
+ var r = this;
289
+ function handle(n, o) {
290
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
291
+ }
292
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
293
+ var i = this.tryEntries[o],
294
+ a = i.completion;
295
+ if ("root" === i.tryLoc) return handle("end");
296
+ if (i.tryLoc <= this.prev) {
297
+ var c = n.call(i, "catchLoc"),
298
+ u = n.call(i, "finallyLoc");
299
+ if (c && u) {
300
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
301
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
302
+ } else if (c) {
303
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
304
+ } else {
305
+ if (!u) throw new Error("try statement without catch or finally");
306
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
307
+ }
308
+ }
309
+ }
310
+ },
311
+ abrupt: function (t, e) {
312
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
313
+ var o = this.tryEntries[r];
314
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
315
+ var i = o;
316
+ break;
317
+ }
318
+ }
319
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
320
+ var a = i ? i.completion : {};
321
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
322
+ },
323
+ complete: function (t, e) {
324
+ if ("throw" === t.type) throw t.arg;
325
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
326
+ },
327
+ finish: function (t) {
328
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
329
+ var r = this.tryEntries[e];
330
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
331
+ }
332
+ },
333
+ catch: function (t) {
334
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
335
+ var r = this.tryEntries[e];
336
+ if (r.tryLoc === t) {
337
+ var n = r.completion;
338
+ if ("throw" === n.type) {
339
+ var o = n.arg;
340
+ resetTryEntry(r);
341
+ }
342
+ return o;
343
+ }
344
+ }
345
+ throw new Error("illegal catch attempt");
346
+ },
347
+ delegateYield: function (e, r, n) {
348
+ return this.delegate = {
349
+ iterator: values(e),
350
+ resultName: r,
351
+ nextLoc: n
352
+ }, "next" === this.method && (this.arg = t), y;
353
+ }
354
+ }, e;
355
+ }
55
356
  function _typeof(o) {
56
357
  "@babel/helpers - typeof";
57
358
 
@@ -61,6 +362,36 @@
61
362
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
62
363
  }, _typeof(o);
63
364
  }
365
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
366
+ try {
367
+ var info = gen[key](arg);
368
+ var value = info.value;
369
+ } catch (error) {
370
+ reject(error);
371
+ return;
372
+ }
373
+ if (info.done) {
374
+ resolve(value);
375
+ } else {
376
+ Promise.resolve(value).then(_next, _throw);
377
+ }
378
+ }
379
+ function _asyncToGenerator(fn) {
380
+ return function () {
381
+ var self = this,
382
+ args = arguments;
383
+ return new Promise(function (resolve, reject) {
384
+ var gen = fn.apply(self, args);
385
+ function _next(value) {
386
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
387
+ }
388
+ function _throw(err) {
389
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
390
+ }
391
+ _next(undefined);
392
+ });
393
+ };
394
+ }
64
395
  function _classCallCheck(instance, Constructor) {
65
396
  if (!(instance instanceof Constructor)) {
66
397
  throw new TypeError("Cannot call a class as a function");
@@ -6395,7 +6726,9 @@
6395
6726
  TOP_CENTER: "top-center",
6396
6727
  BOTTOM_CENTER: "bottom-center",
6397
6728
  CENTER: "center",
6398
- FULL_SCREEN: "full-screen"
6729
+ FULL_SCREEN: "full-screen",
6730
+ LEFT: "left",
6731
+ RIGHT: "right"
6399
6732
  };
6400
6733
  var imgWrapperStyles = {
6401
6734
  "margin-left": "marginLeft",
@@ -6447,8 +6780,17 @@
6447
6780
  cell: "div",
6448
6781
  img: "img",
6449
6782
  text: "span",
6450
- button: "button"
6783
+ button: "button",
6784
+ cta_button: "button"
6451
6785
  };
6786
+ var BUILDER_TEMPLATE_NODE_TYPES = {
6787
+ cell: "div",
6788
+ img: "img",
6789
+ text: "div",
6790
+ button: "button",
6791
+ cta_button: "button"
6792
+ };
6793
+ var CROSS_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"border-radius: inherit; width: 100%; height: 100%;\"><path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"current-color\"></path><path d=\"M18 6l-12 12\"></path><path d=\"M6 6l12 12\"></path></svg>";
6452
6794
 
6453
6795
  /* eslint-disable no-unused-vars */
6454
6796
 
@@ -6808,10 +7150,11 @@
6808
7150
  var index = arguments.length > 10 ? arguments[10] : undefined;
6809
7151
  var button_alignment = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : "center";
6810
7152
  var fontMultiplier = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : 1;
7153
+ var step = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : -1;
6811
7154
  var buttons = document.createElement("div");
6812
7155
  buttons.className = "".concat(position, "-buttons-container");
6813
7156
  buttons.style.zIndex = 99999999;
6814
- var _generateButtonsFromC = generateButtonsFromConfig(buttons_config, actionHandler, id, name, eventPrefix, position, isWalkthrough, uis, index),
7157
+ var _generateButtonsFromC = generateButtonsFromConfig(buttons_config, actionHandler, id, name, eventPrefix, position, isWalkthrough, uis, index, step),
6815
7158
  buttons_array = _generateButtonsFromC.buttons_array,
6816
7159
  buttons_css = _generateButtonsFromC.buttons_css;
6817
7160
  buttons_css.fontMultiplier = fontMultiplier;
@@ -7096,6 +7439,7 @@
7096
7439
  var isWalkthrough = arguments.length > 6 ? arguments[6] : undefined;
7097
7440
  var uis = arguments.length > 7 ? arguments[7] : undefined;
7098
7441
  var ind = arguments.length > 8 ? arguments[8] : undefined;
7442
+ var step = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : -1;
7099
7443
  var buttons_array = [];
7100
7444
  var buttons_css = [];
7101
7445
  buttons_config.sort(function (a, b) {
@@ -7156,6 +7500,10 @@
7156
7500
  action = function action() {
7157
7501
  ActionHandler.complete(false, "dismiss");
7158
7502
  window.Apxor.logActionEvent(configType + text + "_Clicked", uuid, name);
7503
+ if (step != -1) {
7504
+ var _window;
7505
+ (_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || _window.triggerNextStep(uuid, step + 1);
7506
+ }
7159
7507
  };
7160
7508
  break;
7161
7509
  case "next":
@@ -7185,9 +7533,17 @@
7185
7533
  window.Apxor.redirectTo(JSON.stringify(action_config));
7186
7534
  var _type = configType.toLowerCase();
7187
7535
  window.Apxor.logActionEvent("".concat(_type, "dismissed"), uuid, name);
7536
+ if (step != -1) {
7537
+ var _window2;
7538
+ (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || _window2.triggerNextStep(uuid, step + 1);
7539
+ }
7188
7540
  } else {
7189
7541
  ActionHandler.complete(true, "redirect");
7190
7542
  window.Apxor.redirectTo("IN_APP", uuid, name, text, JSON.stringify(action_config));
7543
+ if (step != -1) {
7544
+ var _window3;
7545
+ (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.Apxor) === null || _window3 === void 0 || _window3.triggerNextStep(uuid, step + 1);
7546
+ }
7191
7547
  }
7192
7548
  // if (redirectWithin || isExternal) {
7193
7549
  // window.open(url, redirectWithin ? "_self" : "_blank");
@@ -7500,6 +7856,17 @@
7500
7856
  });
7501
7857
  return newObj;
7502
7858
  }
7859
+ var extractBgImageUrl = function extractBgImageUrl(css) {
7860
+ var _css$backgroundImage;
7861
+ var backgroundImage = (_css$backgroundImage = css === null || css === void 0 ? void 0 : css["background-image"]) !== null && _css$backgroundImage !== void 0 ? _css$backgroundImage : "url()";
7862
+ var pattern = /url\((.*?)\)/;
7863
+ var match = backgroundImage.match(pattern);
7864
+ if (match && match[1]) {
7865
+ return match[1];
7866
+ } else {
7867
+ return "";
7868
+ }
7869
+ };
7503
7870
 
7504
7871
  /**
7505
7872
  * @function getPIPSVG
@@ -11756,69 +12123,109 @@
11756
12123
  render: render
11757
12124
  });
11758
12125
 
11759
- var TemplateContent = /*#__PURE__*/_createClass(function TemplateContent(_config, configId, name, type) {
12126
+ var TemplateContent = /*#__PURE__*/_createClass(function TemplateContent(_config, configId, name, _type, closeCallback) {
11760
12127
  var _this = this,
12128
+ _config$wait_interval,
11761
12129
  _config$termination;
11762
12130
  _classCallCheck(this, TemplateContent);
11763
- _defineProperty(this, "KyAi", function () {
11764
- var element = _this.HjRo(_this.layout);
11765
- //document.body.appendChild(element);
11766
- var tooltipStyles = document.createElement("style");
11767
- tooltipStyles.innerHTML = _this.initialStyles;
11768
- tooltipStyles.setAttribute("apx-tooltip-styles", "");
11769
- document.head.appendChild(tooltipStyles);
11770
- var styleElement = document.createElement("style");
11771
- styleElement.innerHTML = _this.styleContent;
11772
- document.head.appendChild(styleElement);
11773
- try {
11774
- eval(_this.script);
11775
- } catch (e) {
11776
- console.log("found error while executing script: ".concat(e));
11777
- }
11778
- return element;
12131
+ _defineProperty(this, "NszW", function () {
12132
+ return new Promise(function (resolve, reject) {
12133
+ try {
12134
+ var element = _this.xyYY(_this.layout);
12135
+ var styleElement = document.createElement("style");
12136
+ styleElement.innerHTML = _this.styleContent;
12137
+ document.head.appendChild(styleElement);
12138
+ _this.PfLM();
12139
+ try {
12140
+ eval(_this.script);
12141
+ } catch (e) {
12142
+ var _window;
12143
+ console.log("found error while executing script: ".concat(e));
12144
+ (_window = window) === null || _window === void 0 || (_window = _window.ApxorLogger) === null || _window === void 0 || _window.error("found error while executing script: ".concat(e === null || e === void 0 ? void 0 : e.name, " ").concat(e === null || e === void 0 ? void 0 : e.message));
12145
+ reject("found error while executing script: ".concat(e));
12146
+ }
12147
+ _this.imageElements.forEach(function (img) {
12148
+ img.addEventListener("error", function () {
12149
+ _this.JmOW("provided image doesn't exists");
12150
+ });
12151
+ });
12152
+ _this.intervalToCheckMediaLoadingStatus = setInterval(function () {
12153
+ _this.wait_interval -= 1;
12154
+ if (_this.wait_interval <= 0) {
12155
+ _this.JmOW("provided media doesn't exists");
12156
+ } else {
12157
+ if (_this.uDuu() && _this.FgHb() && _this.IJFb()) {
12158
+ clearInterval(_this.intervalToCheckMediaLoadingStatus);
12159
+ resolve(element);
12160
+ }
12161
+ }
12162
+ }, 100);
12163
+ } catch (e) {
12164
+ var _window2;
12165
+ console.log("failed while creating builder template with error ".concat(e));
12166
+ (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.ApxorLogger) === null || _window2 === void 0 || _window2.error("failed while creating builder template with error: ".concat(e === null || e === void 0 ? void 0 : e.name, " ").concat(e === null || e === void 0 ? void 0 : e.message));
12167
+ reject("failed while creating builder template with error: ".concat(e));
12168
+ }
12169
+ });
11779
12170
  });
11780
- _defineProperty(this, "HjRo", function (config) {
11781
- var _window$Apxor;
12171
+ _defineProperty(this, "JmOW", function (reason) {
12172
+ var _window$ApxorRTM, _window$Apxor, _this$config, _this$config2, _window$Apxor2, _this$config3, _this$config4, _this$config5, _this$config6, _window3;
12173
+ !_this.loggedNudgeNotShownEvent && ((_window$ApxorRTM = window.ApxorRTM) === null || _window$ApxorRTM === void 0 ? void 0 : _window$ApxorRTM.logEvent("apx_nudge_not_shown", {
12174
+ apx_nudge_name: _this.name,
12175
+ apx_nudge_id: ((_window$Apxor = window.Apxor) === null || _window$Apxor === void 0 ? void 0 : _window$Apxor.platform) === "ios" ? (_this$config = _this.config) === null || _this$config === void 0 || (_this$config = _this$config.additional_info) === null || _this$config === void 0 ? void 0 : _this$config.id : _this.configId,
12176
+ apx_template_name: _this.type,
12177
+ apx_notshown_type: "error",
12178
+ apx_reason: reason,
12179
+ apx_variant_code: (_this$config2 = _this.config) === null || _this$config2 === void 0 || (_this$config2 = _this$config2.additional_info) === null || _this$config2 === void 0 ? void 0 : _this$config2.apx_variant_code,
12180
+ apx_step: ((_window$Apxor2 = window.Apxor) === null || _window$Apxor2 === void 0 ? void 0 : _window$Apxor2.platform) === "ios" ? (_this$config3 = _this.config) !== null && _this$config3 !== void 0 && (_this$config3 = _this$config3.additional_info) !== null && _this$config3 !== void 0 && _this$config3.is_preview ? 1 : (_this$config4 = _this.config) === null || _this$config4 === void 0 || (_this$config4 = _this$config4.additional_info) === null || _this$config4 === void 0 ? void 0 : _this$config4.apx_step : (_this$config5 = _this.config) !== null && _this$config5 !== void 0 && (_this$config5 = _this$config5.additional_info) !== null && _this$config5 !== void 0 && _this$config5.is_preview ? 1 : (_this$config6 = _this.config) === null || _this$config6 === void 0 || (_this$config6 = _this$config6.additional_info) === null || _this$config6 === void 0 ? void 0 : _this$config6.apx_step
12181
+ }));
12182
+ _this.loggedNudgeNotShownEvent = true;
12183
+ clearInterval(_this.intervalToCheckMediaLoadingStatus);
12184
+ _this.closeCallBack("cancel");
12185
+ (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.ApxorInternals) === null || _window3 === void 0 || _window3.removeBuilderTemplate(_this.configId);
12186
+ });
12187
+ _defineProperty(this, "PfLM", function () {
12188
+ var BuilderTemplatesStyles = document.createElement("style");
12189
+ BuilderTemplatesStyles.innerHTML = _this.initialStyles;
12190
+ BuilderTemplatesStyles.setAttribute("apx-builder-template-styles", "");
12191
+ document.head.appendChild(BuilderTemplatesStyles);
12192
+ });
12193
+ _defineProperty(this, "xyYY", function (config) {
12194
+ var _window$Apxor3;
11782
12195
  var element;
11783
12196
  switch (config.type) {
11784
12197
  case "cell":
11785
12198
  case "img":
11786
12199
  case "text":
12200
+ case "cta_button":
11787
12201
  case "button":
11788
- element = document.createElement(EMBED_CARD_TYPE[config.type]);
12202
+ element = document.createElement(BUILDER_TEMPLATE_NODE_TYPES[config.type]);
11789
12203
  break;
11790
12204
  case "video":
11791
12205
  element = document.createElement("video");
11792
12206
  element.controlsList = "noplaybackrate nodownload nofullscreen";
11793
12207
  element.controls = true;
12208
+ element.muted = true;
11794
12209
  element.disablePictureInPicture = true;
11795
12210
  element.autoplay = true;
11796
- if (((_window$Apxor = window.Apxor) === null || _window$Apxor === void 0 ? void 0 : _window$Apxor.platform) === "ios") {
12211
+ if (((_window$Apxor3 = window.Apxor) === null || _window$Apxor3 === void 0 ? void 0 : _window$Apxor3.platform) === "ios") {
11797
12212
  element.playsInline = true;
11798
12213
  }
11799
- // if (config.source) {
11800
- // let sourceElement = document.createElement("source");
11801
- // for (let prop in config.source) {
11802
- // sourceElement[prop] = config.source[prop];
11803
- // }
11804
- // element.appendChild(sourceElement);
11805
- // }
11806
- // if (config.track) {
11807
- // let trackElement = document.createElement("track");
11808
- // for (let prop in config.track) {
11809
- // trackElement[prop] = config.track[prop];
11810
- // }
11811
- // element.appendChild(trackElement);
11812
- // }
11813
12214
  break;
11814
12215
  case "svg":
11815
12216
  element = document.createElement("span");
11816
12217
  break;
12218
+ case "cross_button":
12219
+ element = document.createElement("div");
12220
+ element.innerHTML = CROSS_ICON_SVG;
12221
+ element.style.display = "flex";
12222
+ break;
11817
12223
  default:
11818
12224
  element = document.createElement(config.type);
11819
12225
  }
11820
12226
  if (config.properties) {
11821
12227
  for (var prop in config.properties) {
12228
+ if (config.type === "img" && prop === "src" || config.type === "img" && prop === "format") continue;
11822
12229
  if (config.type === "video" && prop === "source") {
11823
12230
  var sourceElement = document.createElement("source");
11824
12231
  for (var srcprop in (_config$properties = config.properties) === null || _config$properties === void 0 ? void 0 : _config$properties[prop]) {
@@ -11834,37 +12241,86 @@
11834
12241
  }
11835
12242
  element.classList.add(config._id);
11836
12243
  if (config.css) {
11837
- var styles = ".".concat(config._id, " {\n ").concat(config.css, "\n }\n ");
12244
+ var styles = "";
12245
+ if (config.type === "img") {
12246
+ var styleObject = parseCSS(config.css);
12247
+ var imgStyleObject = removeKeys(styleObject, Object.keys(imgWrapperStyles));
12248
+ styles = ".".concat(config._id, " {\n ").concat(objectToCSS(imgStyleObject), "\n }\n ");
12249
+ } else if (config._id === _this.layout._id) {
12250
+ var layoutStyleObject = parseCSS(config.css);
12251
+ if (layoutStyleObject["background-image"]) {
12252
+ var backgroundImageUrl = extractBgImageUrl(layoutStyleObject);
12253
+ layoutStyleObject["background-image"] = "url(".concat(decodeURIComponent(backgroundImageUrl), ")");
12254
+ _this.bgImageUrl = decodeURIComponent(backgroundImageUrl);
12255
+ }
12256
+ styles = ".".concat(config._id, " {\n ").concat(objectToCSS(layoutStyleObject), "\n }\n ");
12257
+ } else {
12258
+ styles = ".".concat(config._id, " {\n ").concat(config.css, "\n }\n ");
12259
+ }
11838
12260
  _this.initialStyles += styles;
11839
12261
  }
11840
12262
  if (config.enable_actions && config.actions.length > 0) {
11841
12263
  config.actions.forEach(function (action) {
12264
+ var next_step = action !== null && action !== void 0 && action.next_step ? action === null || action === void 0 ? void 0 : action.next_step : 0;
11842
12265
  switch (action.type) {
11843
12266
  case "activity":
11844
12267
  case "deeplink":
11845
12268
  case "ir":
11846
12269
  element.onclick = function (e) {
12270
+ var _this$config7;
11847
12271
  e.stopPropagation();
11848
12272
  window.Apxor.redirect(JSON.stringify(action));
12273
+ var reason = "";
12274
+ if (config.type === "cta_button" || config.type === "button") {
12275
+ reason = "cta-clicked";
12276
+ }
12277
+ _this.STbC(e, "redirect", reason);
12278
+ if ((_this$config7 = _this.config) !== null && _this$config7 !== void 0 && (_this$config7 = _this$config7.additional_info) !== null && _this$config7 !== void 0 && _this$config7.apx_step) {
12279
+ var _window4, _this$config8;
12280
+ (_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.Apxor) === null || _window4 === void 0 || _window4.triggerNextStep(_this.configId, ((_this$config8 = _this.config) === null || _this$config8 === void 0 || (_this$config8 = _this$config8.additional_info) === null || _this$config8 === void 0 ? void 0 : _this$config8.apx_step) + 1);
12281
+ }
11849
12282
  };
11850
12283
  break;
11851
12284
  case "cancel":
11852
12285
  element.onclick = function (e) {
11853
12286
  e.stopPropagation();
11854
- window.Apxor.logActionEvent("walk_through_cancelled", _this.configId, _this.name);
12287
+ var reason = "";
12288
+ if (config.type === "cross_button") {
12289
+ reason = "cross-clicked";
12290
+ } else if (config.type === "cta_button" || config.type === "button") {
12291
+ reason = "cta-clicked";
12292
+ }
12293
+ _this.STbC(e, "cancel", reason);
12294
+ // window.Apxor.logActionEvent(
12295
+ // "walk_through_cancelled",
12296
+ // this.configId,
12297
+ // this.name
12298
+ // );
11855
12299
  };
12300
+
11856
12301
  break;
11857
12302
  case "dismiss":
11858
12303
  element.onclick = function (e) {
12304
+ var _this$config9;
11859
12305
  e.stopPropagation();
11860
- window.Apxor.logActionEvent("".concat(_this.type, "_dismissed"), _this.configId, _this.name);
12306
+ var reason = "";
12307
+ if (config.type === "cross_button") {
12308
+ reason = "cross-clicked";
12309
+ } else if (config.type === "cta_button" || config.type === "button") {
12310
+ reason = "cta-clicked";
12311
+ }
12312
+ _this.STbC(e, "dismiss", reason);
12313
+ if ((_this$config9 = _this.config) !== null && _this$config9 !== void 0 && (_this$config9 = _this$config9.additional_info) !== null && _this$config9 !== void 0 && _this$config9.apx_step) {
12314
+ var _window5, _this$config10;
12315
+ (_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.Apxor) === null || _window5 === void 0 || _window5.triggerNextStep(_this.configId, ((_this$config10 = _this.config) === null || _this$config10 === void 0 || (_this$config10 = _this$config10.additional_info) === null || _this$config10 === void 0 ? void 0 : _this$config10.apx_step) + 1);
12316
+ }
11861
12317
  };
11862
12318
  break;
11863
12319
  case "never":
11864
12320
  element.onclick = function (e) {
11865
12321
  e.stopPropagation();
11866
12322
  window.Apxor.neverShow(_this.configId, _this.name, "IN_APP");
11867
- window.Apxor.logActionEvent("never_show_clicked", _this.configId, _this.name);
12323
+ _this.STbC(e, "never");
11868
12324
  };
11869
12325
  break;
11870
12326
  case "toggle-class":
@@ -11889,6 +12345,10 @@
11889
12345
  tempInput.select();
11890
12346
  document.execCommand("copy");
11891
12347
  document.body.removeChild(tempInput);
12348
+ _this.STbC(e, "copy-content", "cta-clicked");
12349
+ setTimeout(function () {
12350
+ window.Apxor.showInfoToast("Text-Copied:".concat(textToCopy));
12351
+ }, 500);
11892
12352
  };
11893
12353
  break;
11894
12354
  case "log-app-event":
@@ -11906,45 +12366,107 @@
11906
12366
  });
11907
12367
  }
11908
12368
  if (config.absolute_position_children && config.absolute_position_children.length > 0) {
11909
- element.style.position = "relative";
11910
12369
  config.absolute_position_children.forEach(function (childConfig) {
11911
- var childElement = _this.HjRo(childConfig);
11912
- childElement.style.position = "absolute";
11913
- for (var _prop in childConfig.offset) {
11914
- childElement.style[_prop] = childConfig.offset[_prop];
11915
- }
12370
+ var childElement = _this.xyYY(childConfig);
11916
12371
  element.appendChild(childElement);
11917
12372
  });
11918
12373
  }
11919
12374
 
11920
12375
  // Process children
11921
12376
  if (config.children && config.children.length > 0) {
11922
- //element.style.display = "flex";
11923
-
11924
- // if (config.direction) {
11925
- // element.style.flexDirection = config.direction;
11926
- // }
11927
-
11928
12377
  config.children.forEach(function (childConfig) {
11929
- var childElement = _this.HjRo(childConfig);
12378
+ var childElement = _this.xyYY(childConfig);
11930
12379
  element.appendChild(childElement);
11931
12380
  });
11932
12381
  }
11933
12382
  if (config.type === "img") {
12383
+ var _config$properties3, _config$properties4, _window6, _window6$getFilePath;
12384
+ var src = config === null || config === void 0 || (_config$properties3 = config.properties) === null || _config$properties3 === void 0 ? void 0 : _config$properties3.src;
12385
+ var format = config === null || config === void 0 || (_config$properties4 = config.properties) === null || _config$properties4 === void 0 ? void 0 : _config$properties4.format;
12386
+ element["src"] = src && format ? ((_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.Apxor) === null || _window6 === void 0 || (_window6$getFilePath = _window6.getFilePath) === null || _window6$getFilePath === void 0 ? void 0 : _window6$getFilePath.call(_window6, _this.configId, src, format)) || src : src;
12387
+ _this.imageElements.push(element);
11934
12388
  var imgWrapper = document.createElement("div");
12389
+ var _styleObject = parseCSS(config.css);
12390
+ Object.keys(imgWrapperStyles).forEach(function (prop) {
12391
+ if (prop in _styleObject) {
12392
+ imgWrapper.style[imgWrapperStyles[prop]] = _styleObject[prop];
12393
+ }
12394
+ });
12395
+ element.style.maxWidth = "100%";
12396
+ element.style.height = "auto";
12397
+ element.style.display = "flex";
11935
12398
  imgWrapper.appendChild(element);
11936
12399
  return imgWrapper;
12400
+ } else if (config.type === "video") {
12401
+ _this.videoElements.push(element);
11937
12402
  }
11938
12403
  return element;
11939
12404
  });
12405
+ _defineProperty(this, "STbC", function (e, action) {
12406
+ var _window$Apxor4, _this$config11, _this$config12, _window$Apxor5, _this$config13, _this$config14, _this$config15, _this$config16;
12407
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
12408
+ var additional_info = {
12409
+ apx_nudge_name: _this.name,
12410
+ apx_nudge_id: ((_window$Apxor4 = window.Apxor) === null || _window$Apxor4 === void 0 ? void 0 : _window$Apxor4.platform) === "ios" ? (_this$config11 = _this.config) === null || _this$config11 === void 0 || (_this$config11 = _this$config11.additional_info) === null || _this$config11 === void 0 ? void 0 : _this$config11.id : _this.configId,
12411
+ apx_template_name: _this.type,
12412
+ apx_variant_code: (_this$config12 = _this.config) === null || _this$config12 === void 0 || (_this$config12 = _this$config12.additional_info) === null || _this$config12 === void 0 ? void 0 : _this$config12.apx_variant_code,
12413
+ apx_step: ((_window$Apxor5 = window.Apxor) === null || _window$Apxor5 === void 0 ? void 0 : _window$Apxor5.platform) === "ios" ? (_this$config13 = _this.config) !== null && _this$config13 !== void 0 && (_this$config13 = _this$config13.additional_info) !== null && _this$config13 !== void 0 && _this$config13.is_preview ? 1 : (_this$config14 = _this.config) === null || _this$config14 === void 0 || (_this$config14 = _this$config14.additional_info) === null || _this$config14 === void 0 ? void 0 : _this$config14.apx_step : (_this$config15 = _this.config) !== null && _this$config15 !== void 0 && (_this$config15 = _this$config15.additional_info) !== null && _this$config15 !== void 0 && _this$config15.is_preview ? 1 : (_this$config16 = _this.config) === null || _this$config16 === void 0 || (_this$config16 = _this$config16.additional_info) === null || _this$config16 === void 0 ? void 0 : _this$config16.apx_step
12414
+ };
12415
+ if (e.target.tagName === "BUTTON") {
12416
+ var _window$ApxorRTM2;
12417
+ if (action != "never") {
12418
+ var _e$target$innerHTML, _e$target;
12419
+ additional_info["apx_cta_name"] = (_e$target$innerHTML = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.innerHTML) !== null && _e$target$innerHTML !== void 0 ? _e$target$innerHTML : "";
12420
+ }
12421
+ (_window$ApxorRTM2 = window.ApxorRTM) === null || _window$ApxorRTM2 === void 0 || _window$ApxorRTM2.logEvent("apx_nudge_CTA_clicked", additional_info);
12422
+ }
12423
+ if (action == "never") {
12424
+ var _window$ApxorRTM3;
12425
+ additional_info["apx_termination_type"] = "never show cta clicked";
12426
+ (_window$ApxorRTM3 = window.ApxorRTM) === null || _window$ApxorRTM3 === void 0 || _window$ApxorRTM3.logEvent("apx_nudge_terminated", additional_info);
12427
+ }
12428
+ if (type != "") {
12429
+ _this.closeCallBack(action, type);
12430
+ } else {
12431
+ _this.closeCallBack(action);
12432
+ }
12433
+ });
12434
+ _defineProperty(this, "FgHb", function () {
12435
+ //This logic is to make sure that image has loaded, it doesn't check whether image is broken
12436
+ //refer: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete#value
12437
+ if (_this.imageElements.length === 0) return true;
12438
+ return _this.imageElements.every(function (img) {
12439
+ return img.complete;
12440
+ });
12441
+ });
12442
+ _defineProperty(this, "IJFb", function () {
12443
+ if (!_this.bgImageUrl) return true;
12444
+ var img = new Image();
12445
+ img.src = _this.bgImageUrl;
12446
+ return img.complete;
12447
+ });
12448
+ _defineProperty(this, "uDuu", function () {
12449
+ if (_this.videoElements.length === 0) return true;
12450
+ return _this.videoElements.every(function (video) {
12451
+ return video.readyState >= 3;
12452
+ });
12453
+ });
11940
12454
  this.configId = configId;
12455
+ this.config = _config;
11941
12456
  this.name = name;
11942
12457
  this.layout = _config.layout;
11943
- this.styleContent = _config.css;
12458
+ this.styleContent = _config === null || _config === void 0 ? void 0 : _config.css;
12459
+ this.wait_interval = (_config$wait_interval = _config === null || _config === void 0 ? void 0 : _config.wait_interval) !== null && _config$wait_interval !== void 0 ? _config$wait_interval : 5000 / 100;
11944
12460
  this.termination = (_config$termination = _config.termination) !== null && _config$termination !== void 0 ? _config$termination : [];
11945
- this.script = _config.script;
11946
- this.type = type;
12461
+ this.script = _config === null || _config === void 0 ? void 0 : _config.script;
12462
+ this.type = _type;
11947
12463
  this.initialStyles = "";
12464
+ this.imageElements = [];
12465
+ this.videoElements = [];
12466
+ this.bgImageUrl = "";
12467
+ this.intervalToCheckMediaLoadingStatus = null;
12468
+ this.loggedNudgeNotShownEvent = false;
12469
+ this.closeCallBack = closeCallback;
11948
12470
  });
11949
12471
 
11950
12472
  var svgNS$1 = "http://www.w3.org/2000/svg";
@@ -12467,7 +12989,7 @@
12467
12989
  if (this.enable_arrow) this.arrow = new Arrow(config.arrow, this.background_color);
12468
12990
  this.enable_animation = config.enable_animation;
12469
12991
  if (this.enable_animation) this.animation = new Animation(config.animation);
12470
- this.templateContent = new TemplateContent(config, this.configId, this.name, "inline");
12992
+ this.templateContent = new TemplateContent(config, this.configId, this.name, "tooltip", this.closeInlineCallback.bind(this));
12471
12993
  this.set_font_to_scale = (_config$set_font_to_s = config.set_font_to_scale) !== null && _config$set_font_to_s !== void 0 ? _config$set_font_to_s : false;
12472
12994
  this.fontMultiplier = this.set_font_to_scale ? getFontMultiplier() : 1;
12473
12995
  this.fontMultiplier = this.fontMultiplier > 1 ? this.fontMultiplier : 1;
@@ -12498,20 +13020,42 @@
12498
13020
  //If a tooltip can be created
12499
13021
  if (canCreate) {
12500
13022
  // Called when the target element comes into the viewport to show the tooltip
12501
- var targetReachedCallback = function targetReachedCallback() {
12502
- //Set the tooltip dimensions.
12503
- //this._setInLineDimensions();
12504
- //Set the InLine styles
12505
- _this._setInlineStyles();
12506
- //Set the offset to properly align arrow w.r.t view element
12507
- //this._offsetAdjustment();
12508
- //Set the content
12509
- _this._setInLineContent();
12510
- // Set the obervors.
12511
- _this._setObservors();
12512
- // Create a tippy instance
12513
- _this._createTippyInstance();
12514
- };
13023
+ var targetReachedCallback = /*#__PURE__*/function () {
13024
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
13025
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13026
+ while (1) switch (_context.prev = _context.next) {
13027
+ case 0:
13028
+ _context.prev = 0;
13029
+ //Set the tooltip dimensions.
13030
+ //this._setInLineDimensions();
13031
+ //Set the InLine styles
13032
+ _this._setInlineStyles();
13033
+ //Set the offset to properly align arrow w.r.t view element
13034
+ //this._offsetAdjustment();
13035
+ //Set the content
13036
+ _context.next = 4;
13037
+ return _this._setInLineContent();
13038
+ case 4:
13039
+ // Set the obervors.
13040
+ _this._setObservors();
13041
+ // Create a tippy instance
13042
+ _this._createTippyInstance();
13043
+ _context.next = 11;
13044
+ break;
13045
+ case 8:
13046
+ _context.prev = 8;
13047
+ _context.t0 = _context["catch"](0);
13048
+ console.log("failed to create the inline after finding the target element with error ".concat(_context.t0));
13049
+ case 11:
13050
+ case "end":
13051
+ return _context.stop();
13052
+ }
13053
+ }, _callee, null, [[0, 8]]);
13054
+ }));
13055
+ return function targetReachedCallback() {
13056
+ return _ref.apply(this, arguments);
13057
+ };
13058
+ }();
12515
13059
 
12516
13060
  // Called when the valid target is found to show the tooltip
12517
13061
  var targetValidCallback = function targetValidCallback() {
@@ -12659,7 +13203,7 @@
12659
13203
  animationStyles = "\n @-webkit-keyframes ".concat(this.animation.type, " {\n 0% { transform: ").concat(translateDir(this.position.position, 0), "; }\n 50% { transform: ").concat(translateDir(this.position.position, 50), "; }\n 100% { transform: ").concat(translateDir(this.position.position, 100), "; }\n }\n \n @keyframes ").concat(this.animation.type, " {\n 0% { transform: ").concat(translateDir(this.position.position, 0), "; }\n 50% { transform: ").concat(translateDir(this.position.position, 50), "; }\n 100% { transform: ").concat(translateDir(this.position.position, 100), "; }\n }\n \n .tippy-box {\n animation-name: ").concat(this.animation.type, ";\n animation-duration: ").concat(this.animation.duration, "ms;\n animation-timing-function: ").concat(this.animation.anim_function, ";\n animation-iteration-count: ").concat(this.animation.iteration_count, ";\n }\n ");
12660
13204
  }
12661
13205
  // Do not modify these. These tippy styles.
12662
- var tippyStyles = "\n .tippy-box[data-animation=\"fade\"][data-state=hidden]{\n opacity:0;\n } \n [data-tippy-root] {\n max-width:calc(100vw - ".concat(this.enable_arrow && this.arrow.enable_border ? this.arrow.border.width : 0, "px);\n } \n .tippy-box { \n position:relative;\n line-height:1.4;\n white-space:normal;\n outline:0;\n transition-property:transform,visibility,opacity;\n } \n .tippy-box[data-placement^=top] > .tippy-arrow:before {\n ").concat(tippyTopArrowStyle, "\n border-top-color:initial;\n transform-origin:center top;\n }\n .tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n ").concat(tippyBottomArrowStyle, "\n border-bottom-color:initial;\n transform-origin:center bottom;\n }\n .tippy-box[data-placement^=left] > .tippy-arrow:before {\n ").concat(tippyLeftArrowStyle, "\n border-left-color:initial;\n transform-origin:center left;\n }\n .tippy-box[data-placement^=right] > .tippy-arrow:before {\n ").concat(tippyRightArrowStyle, "\n border-right-color:initial;\n transform-origin:center right;\n } \n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)\n } \n .tippy-arrow {\n z-index:9999;\n width:18px;\n height:18px;\n color:").concat(this.enable_arrow ? this.arrow.color : "transparent", ";\n opacity:0;\n visibility:hidden;\n transition:all .5s cubic-bezier(.96,.23,.07,.8);\n } \n .tippy-arrow.open {\n opacity:1;\n visibility:visible;\n }\n .tippy-arrow:before{ \n content:\"\";\n position:absolute;\n border-color:transparent;\n border-style:").concat(this.enable_arrow && this.arrow.enable_border ? this.arrow.border.style : "solid", ";\n } \n .tippy-content {\n padding: 0.3125rem 0.5625rem;\n position:relative;\n z-index:9998;\n } \n ").concat(animationStyles, "\n ");
13206
+ var tippyStyles = "\n .tippy-box[data-animation=\"fade\"][data-state=hidden]{\n opacity:0;\n } \n [data-tippy-root] {\n max-width:calc(100vw - ".concat(this.enable_arrow && this.arrow.enable_border ? this.arrow.border.width : 0, "px);\n } \n .tippy-box { \n position:relative;\n line-height:1.4;\n white-space:normal;\n outline:0;\n transition-property:transform,visibility,opacity;\n } \n .tippy-box[data-placement^=top] > .tippy-arrow:before {\n ").concat(tippyTopArrowStyle, "\n border-top-color:initial;\n transform-origin:center top;\n }\n .tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n ").concat(tippyBottomArrowStyle, "\n border-bottom-color:initial;\n transform-origin:center bottom;\n }\n .tippy-box[data-placement^=left] > .tippy-arrow:before {\n ").concat(tippyLeftArrowStyle, "\n border-left-color:initial;\n transform-origin:center left;\n }\n .tippy-box[data-placement^=right] > .tippy-arrow:before {\n ").concat(tippyRightArrowStyle, "\n border-right-color:initial;\n transform-origin:center right;\n } \n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)\n } \n .tippy-arrow {\n z-index:9999;\n width:18px;\n height:18px;\n color:").concat(this.enable_arrow ? this.arrow.color : "transparent", ";\n opacity:0;\n visibility:hidden;\n transition:all .5s cubic-bezier(.96,.23,.07,.8);\n } \n .tippy-arrow.open {\n opacity:1;\n visibility:visible;\n }\n .tippy-arrow:before{ \n content:\"\";\n position:absolute;\n border-color:transparent;\n border-style:").concat(this.enable_arrow && this.arrow.enable_border ? this.arrow.border.style : "solid", ";\n } \n .tippy-content {\n position:relative;\n z-index:9998;\n } \n ").concat(animationStyles, "\n ");
12663
13207
  var tippyTheme = "\n ".concat(tippyStyles, "\n ");
12664
13208
  return tippyTheme;
12665
13209
  }
@@ -12828,9 +13372,33 @@
12828
13372
  }
12829
13373
  }, {
12830
13374
  key: "_setInLineContent",
12831
- value: function _setInLineContent() {
12832
- this.inLineContainer = this.templateContent.KyAi();
12833
- }
13375
+ value: function () {
13376
+ var _setInLineContent2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
13377
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13378
+ while (1) switch (_context2.prev = _context2.next) {
13379
+ case 0:
13380
+ _context2.prev = 0;
13381
+ _context2.next = 3;
13382
+ return this.templateContent.NszW();
13383
+ case 3:
13384
+ this.inLineContainer = _context2.sent;
13385
+ _context2.next = 9;
13386
+ break;
13387
+ case 6:
13388
+ _context2.prev = 6;
13389
+ _context2.t0 = _context2["catch"](0);
13390
+ console.log("failed at creating template content with error ".concat(_context2.t0));
13391
+ case 9:
13392
+ case "end":
13393
+ return _context2.stop();
13394
+ }
13395
+ }, _callee2, this, [[0, 6]]);
13396
+ }));
13397
+ function _setInLineContent() {
13398
+ return _setInLineContent2.apply(this, arguments);
13399
+ }
13400
+ return _setInLineContent;
13401
+ }()
12834
13402
  }, {
12835
13403
  key: "_setObservors",
12836
13404
  value: function _setObservors() {
@@ -13115,6 +13683,12 @@
13115
13683
  console.error("Could not remove the tooltip styles:" + e);
13116
13684
  }
13117
13685
  }
13686
+ }, {
13687
+ key: "closeInlineCallback",
13688
+ value: function closeInlineCallback(action) {
13689
+ clearTimeout(this.terminationTimeoutId);
13690
+ this.closeCallback(action === "cancel" || action === "redirect" ? true : false);
13691
+ }
13118
13692
  }]);
13119
13693
  return NewInLineTooltip;
13120
13694
  }();
@@ -14368,6 +14942,8 @@
14368
14942
  function InLineTooltip(config, uis, walkthroughConfigs, terminationConfig, messageConfig, rtmInstance, showCallback, hideCallback, stepperCallBack) {
14369
14943
  var _this = this,
14370
14944
  _config$set_font_to_s,
14945
+ _this$uiConfig,
14946
+ _this$uiConfig2,
14371
14947
  _config$wait_scroll_i,
14372
14948
  _config$wait_scroll_i2;
14373
14949
  var isWalkthrough = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
@@ -14379,7 +14955,7 @@
14379
14955
  * @description Creates the styles for Marketing message.
14380
14956
  * @returns {string} css styles
14381
14957
  */
14382
- _defineProperty(this, "VrCy", function () {
14958
+ _defineProperty(this, "Rpwa", function () {
14383
14959
  if (!_this.enable_marketing) {
14384
14960
  return "";
14385
14961
  }
@@ -14398,7 +14974,7 @@
14398
14974
  * @private
14399
14975
  * @description Sets the marketing content at the end of the Inline
14400
14976
  */
14401
- _defineProperty(this, "wQRV", function () {
14977
+ _defineProperty(this, "EWkc", function () {
14402
14978
  if (_this.enable_marketing) {
14403
14979
  var marketingContainer = document.createElement("div");
14404
14980
  marketingContainer.classList.add("apx-inline-marketing".concat(_this.cssPostFix));
@@ -14503,6 +15079,7 @@
14503
15079
  this.initial_data_placement = this.position.position;
14504
15080
  this.recent_placement = this.position.position;
14505
15081
  this.tippy_box_position = 0;
15082
+ this.step = (_this$uiConfig = this.uiConfig) !== null && _this$uiConfig !== void 0 && (_this$uiConfig = _this$uiConfig.additional_info) !== null && _this$uiConfig !== void 0 && _this$uiConfig.apx_step ? (_this$uiConfig2 = this.uiConfig) === null || _this$uiConfig2 === void 0 || (_this$uiConfig2 = _this$uiConfig2.additional_info) === null || _this$uiConfig2 === void 0 ? void 0 : _this$uiConfig2.apx_step : -1;
14506
15083
 
14507
15084
  //badge related config
14508
15085
  this.flag = true;
@@ -14985,7 +15562,12 @@
14985
15562
  this.tooltip.setProps({
14986
15563
  onClickOutside: function onClickOutside() {
14987
15564
  if (_this6.enable_dismiss_actions && _this6.dismiss_actions.outside_touch) {
15565
+ var _this6$uiConfig;
14988
15566
  _this6._destroyTooltip();
15567
+ if ((_this6$uiConfig = _this6.uiConfig) !== null && _this6$uiConfig !== void 0 && (_this6$uiConfig = _this6$uiConfig.additional_info) !== null && _this6$uiConfig !== void 0 && _this6$uiConfig.apx_step) {
15568
+ var _window2, _this6$uiConfig2;
15569
+ (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || _window2.triggerNextStep(_this6.configId, ((_this6$uiConfig2 = _this6.uiConfig) === null || _this6$uiConfig2 === void 0 || (_this6$uiConfig2 = _this6$uiConfig2.additional_info) === null || _this6$uiConfig2 === void 0 ? void 0 : _this6$uiConfig2.apx_step) + 1);
15570
+ }
14989
15571
  }
14990
15572
  }
14991
15573
  });
@@ -15004,7 +15586,7 @@
15004
15586
  if (apxor_tooltip_styles) {
15005
15587
  return;
15006
15588
  }
15007
- var styles = "\n ".concat(this._getCustomFonts(), " \n ").concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInLineContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInLineMediaContainerStyles(), "\n ").concat(this._getInLineNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getInLineButtonContainerStyles(), " \n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.VrCy(), "\n ").concat(this._getTippyStyles(), "\n ").concat(this._getFooterStyles(), "\n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
15589
+ var styles = "\n ".concat(this._getCustomFonts(), " \n ").concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInLineContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInLineMediaContainerStyles(), "\n ").concat(this._getInLineNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getInLineButtonContainerStyles(), " \n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.Rpwa(), "\n ").concat(this._getTippyStyles(), "\n ").concat(this._getFooterStyles(), "\n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
15008
15590
  var styleNode = document.createElement("style");
15009
15591
  styleNode.setAttribute("apx-tooltip-styles", "");
15010
15592
  styleNode.innerHTML = styles;
@@ -15814,7 +16396,7 @@
15814
16396
  this._setCloseButton();
15815
16397
 
15816
16398
  //Set the Marketing content
15817
- this.wQRV();
16399
+ this.EWkc();
15818
16400
  }
15819
16401
 
15820
16402
  /**
@@ -16148,7 +16730,7 @@
16148
16730
  } else {
16149
16731
  buttons_config = this.buttons.bottom;
16150
16732
  }
16151
- var _Buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INLINE, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index, this.fontMultiplier);
16733
+ var _Buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INLINE, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index, "center", this.fontMultiplier, this.step);
16152
16734
  if (position === BUTTON_CONTAINER_POSITION.TOP) {
16153
16735
  this.topButtonContainer.appendChild(_Buttons);
16154
16736
  } else if (position === BUTTON_CONTAINER_POSITION.CENTER) {
@@ -16633,8 +17215,13 @@
16633
17215
  key: "_targetClickCallback",
16634
17216
  value: function _targetClickCallback() {
16635
17217
  if (this.enable_dismiss_actions && this.dismiss_actions.target_touch) {
17218
+ var _this$uiConfig3;
16636
17219
  this._destroyTooltip();
16637
17220
  window.Apxor.logActionEvent("InlineTargetViewClicked", this.configId, this.name);
17221
+ if ((_this$uiConfig3 = this.uiConfig) !== null && _this$uiConfig3 !== void 0 && (_this$uiConfig3 = _this$uiConfig3.additional_info) !== null && _this$uiConfig3 !== void 0 && _this$uiConfig3.apx_step) {
17222
+ var _window3, _this$uiConfig4;
17223
+ (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.Apxor) === null || _window3 === void 0 || _window3.triggerNextStep(this.configId, ((_this$uiConfig4 = this.uiConfig) === null || _this$uiConfig4 === void 0 || (_this$uiConfig4 = _this$uiConfig4.additional_info) === null || _this$uiConfig4 === void 0 ? void 0 : _this$uiConfig4.apx_step) + 1);
17224
+ }
16638
17225
  }
16639
17226
  }
16640
17227
 
@@ -16647,7 +17234,12 @@
16647
17234
  }, {
16648
17235
  key: "_dimbackgroundClickCallback",
16649
17236
  value: function _dimbackgroundClickCallback() {
17237
+ var _this$uiConfig5;
16650
17238
  this._destroyTooltip(false);
17239
+ if ((_this$uiConfig5 = this.uiConfig) !== null && _this$uiConfig5 !== void 0 && (_this$uiConfig5 = _this$uiConfig5.additional_info) !== null && _this$uiConfig5 !== void 0 && _this$uiConfig5.apx_step) {
17240
+ var _window4, _this$uiConfig6;
17241
+ (_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.Apxor) === null || _window4 === void 0 || _window4.triggerNextStep(this.configId, ((_this$uiConfig6 = this.uiConfig) === null || _this$uiConfig6 === void 0 || (_this$uiConfig6 = _this$uiConfig6.additional_info) === null || _this$uiConfig6 === void 0 ? void 0 : _this$uiConfig6.apx_step) + 1);
17242
+ }
16651
17243
  }
16652
17244
 
16653
17245
  /**
@@ -17046,7 +17638,7 @@
17046
17638
  var DEFAULT_PADDING$1 = 5;
17047
17639
  var InLineCoachMark = /*#__PURE__*/function () {
17048
17640
  function InLineCoachMark(config, uis, walkthroughConfigs, terminationConfig, messageConfig, rtmInstance, showCallback, hideCallback, stepperCallBack) {
17049
- var _config$content, _config$content2;
17641
+ var _config$content, _config$content2, _this$uiConfig, _this$uiConfig2;
17050
17642
  var isWalkthrough = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
17051
17643
  var index = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : 0;
17052
17644
  _classCallCheck(this, InLineCoachMark);
@@ -17091,6 +17683,7 @@
17091
17683
  }
17092
17684
  this.content_enable_buttons = (_config$content = config.content) === null || _config$content === void 0 ? void 0 : _config$content.enable_buttons;
17093
17685
  if (this.content_enable_buttons) this.buttons = new CoachmarkButtons((_config$content2 = config.content) === null || _config$content2 === void 0 ? void 0 : _config$content2.coachmark_buttons);
17686
+ this.step = (_this$uiConfig = this.uiConfig) !== null && _this$uiConfig !== void 0 && (_this$uiConfig = _this$uiConfig.additional_info) !== null && _this$uiConfig !== void 0 && _this$uiConfig.apx_step ? (_this$uiConfig2 = this.uiConfig) === null || _this$uiConfig2 === void 0 || (_this$uiConfig2 = _this$uiConfig2.additional_info) === null || _this$uiConfig2 === void 0 ? void 0 : _this$uiConfig2.apx_step : -1;
17094
17687
  this.targetElement = null;
17095
17688
  this.inline_width = "auto";
17096
17689
  this.inline_height = "auto";
@@ -17313,8 +17906,13 @@
17313
17906
  key: "_targetClickCallback",
17314
17907
  value: function _targetClickCallback() {
17315
17908
  if (this.enable_dismiss_actions && this.dismiss_actions.target_touch) {
17909
+ var _this$uiConfig3;
17316
17910
  this.rtmInstance.logActionEvent("InlineTargetViewClicked", this.configId, this.name);
17317
17911
  this._destroyCoachMark();
17912
+ if ((_this$uiConfig3 = this.uiConfig) !== null && _this$uiConfig3 !== void 0 && (_this$uiConfig3 = _this$uiConfig3.additional_info) !== null && _this$uiConfig3 !== void 0 && _this$uiConfig3.apx_step) {
17913
+ var _window, _this$uiConfig4;
17914
+ (_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || _window.triggerNextStep(this.configId, ((_this$uiConfig4 = this.uiConfig) === null || _this$uiConfig4 === void 0 || (_this$uiConfig4 = _this$uiConfig4.additional_info) === null || _this$uiConfig4 === void 0 ? void 0 : _this$uiConfig4.apx_step) + 1);
17915
+ }
17318
17916
  }
17319
17917
  }
17320
17918
  }, {
@@ -18007,7 +18605,7 @@
18007
18605
  }
18008
18606
  }
18009
18607
  }
18010
- var Buttons = generateButtonsBlock(this.configId, this.name, {}, EVENT_PREFIX.INLINE, buttons_config, this.buttons.direction, "bottom", actionHandler, this.isWalkthrough, this.uis, this.index, this.buttons.alignment, this.fontMultiplier);
18608
+ var Buttons = generateButtonsBlock(this.configId, this.name, {}, EVENT_PREFIX.INLINE, buttons_config, this.buttons.direction, "bottom", actionHandler, this.isWalkthrough, this.uis, this.index, this.buttons.alignment, this.fontMultiplier, this.step);
18011
18609
  this.buttonContainer.appendChild(Buttons);
18012
18610
  }
18013
18611
 
@@ -18558,13 +19156,16 @@
18558
19156
  _classCallCheck(this, NewModalInApp);
18559
19157
  _defineProperty(this, "closeListener", function () {
18560
19158
  clearTimeout(_this.terminationTimeoutId);
18561
- _this.closeCallback(_this.overlayElement, "dismiss", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
19159
+ _this.closeCallback(_this.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
18562
19160
  });
18563
19161
  _defineProperty(this, "redirectionListener", function () {
18564
19162
  if (window.location.href !== _this.launchPageUrl) {
18565
- _this.closeCallback(_this.overlayElement, "dismiss", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
19163
+ _this.closeCallback(_this.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
18566
19164
  }
18567
19165
  });
19166
+ this.configId = configId;
19167
+ this.config = config;
19168
+ this.name = name;
18568
19169
  this.terminationConfig = terminationConfig;
18569
19170
  this.terminationTimeoutId = null;
18570
19171
  this.cssPostFix = "-".concat(configId, "-").concat(name).replaceAll(" ", "").replace(/[^\w\s]/gi, "");
@@ -18577,31 +19178,53 @@
18577
19178
  if (this.enable_dismiss_actions) this.dismiss_actions = new DismissActions(config.dismiss_actions);
18578
19179
  this.enable_dimbackground = config.enable_dimbackground;
18579
19180
  if (this.enable_dimbackground) this.dimbackground = new DimBackground(config.dimbackground);
18580
- this.templateContent = new TemplateContent(config, this.configId, this.name, "inapp");
18581
- this.configId = configId;
18582
- this.name = name;
18583
19181
  this.showCallback = showCallback;
18584
19182
  this.closeCallback = closeCallback;
18585
19183
  this.dimBackgroundElement = null;
18586
19184
  this.overlayElement = null;
18587
19185
  this.inAppContainer = null;
18588
19186
  this.launchPageUrl = "";
19187
+ this.templateContent = new TemplateContent(config, this.configId, this.name, "inapp", this.closeInappCallback.bind(this));
18589
19188
  }
18590
19189
  _createClass(NewModalInApp, [{
18591
19190
  key: "createInAppModal",
18592
- value: function createInAppModal() {
18593
- //Set the background overlays
18594
- this._setBackgroundOverlays();
18595
- //Set the InApp styles
18596
- this._setStyles();
18597
- //Set the content
18598
- this._setInAppModalContent();
18599
- this._setPosition();
18600
- //Set the auto termination
18601
- this._setAutoTerminate();
18602
- //Show the InApp
18603
- this._showInApp();
18604
- }
19191
+ value: function () {
19192
+ var _createInAppModal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
19193
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
19194
+ while (1) switch (_context.prev = _context.next) {
19195
+ case 0:
19196
+ _context.prev = 0;
19197
+ //Set the background overlays
19198
+ this._setBackgroundOverlays();
19199
+ //Set the InApp styles
19200
+ this._setStyles();
19201
+ //Set the content
19202
+ _context.next = 5;
19203
+ return this._setInAppModalContent();
19204
+ case 5:
19205
+ //set the position
19206
+ this._setPosition();
19207
+ //Set the auto termination
19208
+ this._setAutoTerminate();
19209
+ //Show the InApp
19210
+ this._showInApp();
19211
+ _context.next = 13;
19212
+ break;
19213
+ case 10:
19214
+ _context.prev = 10;
19215
+ _context.t0 = _context["catch"](0);
19216
+ console.log("creating Modal Template failed with error ".concat(_context.t0));
19217
+ case 13:
19218
+ case "end":
19219
+ return _context.stop();
19220
+ }
19221
+ }, _callee, this, [[0, 10]]);
19222
+ }));
19223
+ function createInAppModal() {
19224
+ return _createInAppModal.apply(this, arguments);
19225
+ }
19226
+ return createInAppModal;
19227
+ }()
18605
19228
  }, {
18606
19229
  key: "_setBackgroundOverlays",
18607
19230
  value: function _setBackgroundOverlays() {
@@ -18624,9 +19247,14 @@
18624
19247
  this.overlayElement.appendChild(this.dimBackgroundElement);
18625
19248
  if (this.enable_dismiss_actions && this.dismiss_actions.outside_touch) {
18626
19249
  dismissableElement.onclick = function () {
19250
+ var _this2$config;
18627
19251
  clearTimeout(_this2.terminationTimeoutId);
18628
19252
  dismissableElement.onclick = null;
18629
- _this2.closeCallback(_this2.overlayElement, "dismiss", ".apx-inapp-container".concat(_this2.cssPostFix), _this2.closeListener, _this2.redirectionListener);
19253
+ if ((_this2$config = _this2.config) !== null && _this2$config !== void 0 && (_this2$config = _this2$config.additional_info) !== null && _this2$config !== void 0 && _this2$config.apx_step) {
19254
+ var _window, _this2$config2;
19255
+ (_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || _window.triggerNextStep(_this2.configId, ((_this2$config2 = _this2.config) === null || _this2$config2 === void 0 || (_this2$config2 = _this2$config2.additional_info) === null || _this2$config2 === void 0 ? void 0 : _this2$config2.apx_step) + 1);
19256
+ }
19257
+ _this2.closeCallback(_this2.overlayElement, "dismiss", "outside-touch", ".apx-inapp-container".concat(_this2.cssPostFix), _this2.closeListener, _this2.redirectionListener);
18630
19258
  };
18631
19259
  }
18632
19260
  } else {
@@ -18637,8 +19265,6 @@
18637
19265
  if (!this.enable_dimbackground) {
18638
19266
  document.body.addEventListener("click", this.redirectionListener);
18639
19267
  }
18640
- // Append the overlay to the body. All the element of the InApp are children of this overlay.
18641
- document.body.appendChild(this.overlayElement);
18642
19268
  }
18643
19269
  }, {
18644
19270
  key: "_setStyles",
@@ -18653,16 +19279,45 @@
18653
19279
  key: "_getBackgroundContainerStyles",
18654
19280
  value: function _getBackgroundContainerStyles() {
18655
19281
  // Set the dim background color and opacity only if dim background is enabled.
18656
- var backgroundContainerStyle = "\n .apx-inapp-overlay".concat(this.cssPostFix, " {\n width:100%;\n height:100%;\n }\n .apx-inapp-dimbackground-overlay").concat(this.cssPostFix, " {\n width:100%;\n height:100%;\n position:fixed;\n top:0;\n left:0;\n z-index:999;\n background-color:").concat(this.enable_dimbackground ? this.dimbackground.color : "transparent", ";\n ").concat(this.enable_dimbackground ? "opacity: ".concat(this.dimbackground.opacity, ";") : "", "\n overflow: auto;\n }\n ");
19282
+ var backgroundContainerStyle = "\n .apx-inapp-overlay".concat(this.cssPostFix, " {\n width:100%;\n height:100%;\n }\n .apx-inapp-dimbackground-overlay").concat(this.cssPostFix, " {\n width:100%;\n height:100%;\n position:fixed;\n top:0;\n left:0;\n z-index:999;\n background-color:").concat(this.enable_dimbackground ? this.dimbackground.color : "transparent", ";\n overflow: auto;\n }\n ");
18657
19283
  return backgroundContainerStyle;
18658
19284
  }
18659
19285
  }, {
18660
19286
  key: "_setInAppModalContent",
18661
- value: function _setInAppModalContent() {
18662
- this.inAppContainer = this.templateContent.KyAi();
18663
- this.inAppContainer.style.zIndex = 99999;
18664
- this.overlayElement.appendChild(this.inAppContainer);
18665
- }
19287
+ value: function () {
19288
+ var _setInAppModalContent2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
19289
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
19290
+ while (1) switch (_context2.prev = _context2.next) {
19291
+ case 0:
19292
+ _context2.prev = 0;
19293
+ _context2.next = 3;
19294
+ return this.templateContent.NszW();
19295
+ case 3:
19296
+ this.inAppContainer = _context2.sent;
19297
+ this.inAppContainer.style.zIndex = 99999;
19298
+ this.overlayElement.appendChild(this.inAppContainer);
19299
+ if (this.enable_dismiss_actions && this.dismiss_actions.outside_touch) {
19300
+ this.inAppContainer.onclick = function (event) {
19301
+ event.stopPropagation();
19302
+ };
19303
+ }
19304
+ _context2.next = 12;
19305
+ break;
19306
+ case 9:
19307
+ _context2.prev = 9;
19308
+ _context2.t0 = _context2["catch"](0);
19309
+ console.log("failed at creating template content with error ".concat(_context2.t0));
19310
+ case 12:
19311
+ case "end":
19312
+ return _context2.stop();
19313
+ }
19314
+ }, _callee2, this, [[0, 9]]);
19315
+ }));
19316
+ function _setInAppModalContent() {
19317
+ return _setInAppModalContent2.apply(this, arguments);
19318
+ }
19319
+ return _setInAppModalContent;
19320
+ }()
18666
19321
  }, {
18667
19322
  key: "_setPosition",
18668
19323
  value: function _setPosition() {
@@ -18702,6 +19357,18 @@
18702
19357
  this.inAppContainer.style.webkitTransform = "translate(-50%, -50%)";
18703
19358
  this.inAppContainer.style.MozTransform = "translate(-50%, -50%);";
18704
19359
  break;
19360
+ case INAPP_POSITION.LEFT:
19361
+ this.inAppContainer.style.top = "50%";
19362
+ this.inAppContainer.style.left = "0px";
19363
+ this.inAppContainer.style.webkitTransform = "translate(0px, -50%)";
19364
+ this.inAppContainer.style.MozTransform = "translate(0px, -50%)";
19365
+ break;
19366
+ case INAPP_POSITION.RIGHT:
19367
+ this.inAppContainer.style.top = "50%";
19368
+ this.inAppContainer.style.right = "0px";
19369
+ this.inAppContainer.style.webkitTransform = "translate(0px, -50%)";
19370
+ this.inAppContainer.style.MozTransform = "translate(0px, -50%)";
19371
+ break;
18705
19372
  default:
18706
19373
  this.inAppContainer.style.top = "50%";
18707
19374
  this.inAppContainer.style.left = "50%";
@@ -18716,14 +19383,28 @@
18716
19383
  var _this3 = this;
18717
19384
  if (this.terminationConfig.auto_dismiss === true) {
18718
19385
  this.terminationTimeoutId = window.setTimeout(function () {
18719
- _this3.closeCallback(_this3.overlayElement, "dismiss", ".apx-inapp-container".concat(_this3.cssPostFix), _this3.closeListener, _this3.redirectionListener);
19386
+ var _this3$config;
19387
+ if ((_this3$config = _this3.config) !== null && _this3$config !== void 0 && (_this3$config = _this3$config.additional_info) !== null && _this3$config !== void 0 && _this3$config.apx_step) {
19388
+ var _window2, _this3$config2;
19389
+ (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || _window2.triggerNextStep(_this3.configId, ((_this3$config2 = _this3.config) === null || _this3$config2 === void 0 || (_this3$config2 = _this3$config2.additional_info) === null || _this3$config2 === void 0 ? void 0 : _this3$config2.apx_step) + 1);
19390
+ }
19391
+ _this3.closeCallback(_this3.overlayElement, "dismiss", "auto-dismiss", ".apx-inapp-container".concat(_this3.cssPostFix), _this3.closeListener, _this3.redirectionListener);
18720
19392
  }, this.terminationConfig.duration);
18721
19393
  }
18722
19394
  }
19395
+ }, {
19396
+ key: "closeInappCallback",
19397
+ value: function closeInappCallback(action) {
19398
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
19399
+ clearTimeout(this.terminationTimeoutId);
19400
+ this.closeCallback(this.overlayElement, action, type, ".apx-inapp-container".concat(this.cssPostFix), this.closeListener, this.redirectionListener);
19401
+ }
18723
19402
  }, {
18724
19403
  key: "_showInApp",
18725
19404
  value: function _showInApp() {
18726
19405
  this.inAppContainer.classList.toggle("open");
19406
+ // Append the overlay to the body. All the element of the InApp are children of this overlay.
19407
+ document.body.appendChild(this.overlayElement);
18727
19408
  this.showCallback();
18728
19409
  }
18729
19410
  }]);
@@ -18788,17 +19469,19 @@
18788
19469
  * @param {function} closeCallback
18789
19470
  */
18790
19471
  function ModalInApp(config, terminationConfig, configId, name, showCallback, closeCallback, stepperCallBack, isWalkthrough) {
18791
- var _this = this;
19472
+ var _this = this,
19473
+ _this$config,
19474
+ _this$config2;
18792
19475
  var uis = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
18793
19476
  var index = arguments.length > 9 ? arguments[9] : undefined;
18794
19477
  _classCallCheck(this, ModalInApp);
18795
19478
  _defineProperty(this, "closeListener", function () {
18796
19479
  clearTimeout(_this.terminationTimeoutId);
18797
- _this.closeCallback(_this.overlayElement, "dismiss", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
19480
+ _this.closeCallback(_this.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
18798
19481
  });
18799
19482
  _defineProperty(this, "redirectionListener", function () {
18800
19483
  if (window.location.href !== _this.launchPageUrl) {
18801
- _this.closeCallback(_this.overlayElement, "dismiss", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
19484
+ _this.closeCallback(_this.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this.cssPostFix), _this.closeListener, _this.redirectionListener);
18802
19485
  }
18803
19486
  });
18804
19487
  /**
@@ -18807,7 +19490,7 @@
18807
19490
  * @description Creates the styles for Marketing message.
18808
19491
  * @returns {string} css styles
18809
19492
  */
18810
- _defineProperty(this, "VrCy", function () {
19493
+ _defineProperty(this, "Rpwa", function () {
18811
19494
  if (!_this.enable_marketing) {
18812
19495
  return "";
18813
19496
  }
@@ -18853,7 +19536,7 @@
18853
19536
  * @private
18854
19537
  * @description Get the response for Form content in the InApp modal.
18855
19538
  */
18856
- _defineProperty(this, "UrBX", function (form_elements) {
19539
+ _defineProperty(this, "mJrR", function (form_elements) {
18857
19540
  var obj = {};
18858
19541
  var callback = "";
18859
19542
  form_elements.forEach(function (element) {
@@ -18893,7 +19576,7 @@
18893
19576
  * @private
18894
19577
  * @description Sets the marketing content at the end of the InApp
18895
19578
  */
18896
- _defineProperty(this, "wQRV", function () {
19579
+ _defineProperty(this, "EWkc", function () {
18897
19580
  if (_this.enable_marketing) {
18898
19581
  var marketingContainer = document.createElement("div");
18899
19582
  marketingContainer.classList.add("apx-inapp-marketing".concat(_this.cssPostFix));
@@ -18907,6 +19590,7 @@
18907
19590
  this.terminationConfig = terminationConfig;
18908
19591
  this.terminationTimeoutId = null;
18909
19592
  this.isWalkthrough = isWalkthrough;
19593
+ this.config = config;
18910
19594
  this.cssPostFix = "-".concat(configId, "-").concat(name).replaceAll(" ", "").replace(/[^\w\s]/gi, "");
18911
19595
  this.delay = config.delay || 0;
18912
19596
  this.background_color = config.bg_color || COLORS.WHITE;
@@ -18926,6 +19610,10 @@
18926
19610
  if (this.enable_margin) this.margin = new Margin(config.margin);
18927
19611
  this.enable_border = config.enable_border;
18928
19612
  if (this.enable_border) this.border = new Border(config.border);
19613
+ this.enable_download_files = (config === null || config === void 0 ? void 0 : config.enable_download_files) || false;
19614
+ if (this.enable_download_files) {
19615
+ this.download_files = config === null || config === void 0 ? void 0 : config.download_files;
19616
+ }
18929
19617
  this.enable_close_button = config.enable_close_button;
18930
19618
  if (this.enable_close_button) this.close_button = new CloseButton(config.close_button);
18931
19619
  this.enable_scroll = config.enable_scroll;
@@ -18952,6 +19640,7 @@
18952
19640
  if (this.enable_gradient) this.gradient = new Gradient(config.gradient);
18953
19641
  this.enable_marketing = config.enable_marketing;
18954
19642
  if (this.enable_marketing) this.marketing = new Marketing(config.marketing);
19643
+ this.step = (_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.additional_info) !== null && _this$config !== void 0 && _this$config.apx_step ? (_this$config2 = this.config) === null || _this$config2 === void 0 || (_this$config2 = _this$config2.additional_info) === null || _this$config2 === void 0 ? void 0 : _this$config2.apx_step : -1;
18955
19644
  this.min_width = "";
18956
19645
  this.max_width = "";
18957
19646
  this.inapp_width = "auto";
@@ -19123,7 +19812,7 @@
19123
19812
  dismissableElement.onclick = function () {
19124
19813
  clearTimeout(_this2.terminationTimeoutId);
19125
19814
  dismissableElement.onclick = null;
19126
- _this2.closeCallback(_this2.overlayElement, "dismiss", ".apx-inapp-container".concat(_this2.cssPostFix), _this2.closeListener, _this2.redirectionListener);
19815
+ _this2.closeCallback(_this2.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this2.cssPostFix), _this2.closeListener, _this2.redirectionListener);
19127
19816
  };
19128
19817
  }
19129
19818
  } else {
@@ -19146,7 +19835,7 @@
19146
19835
  }, {
19147
19836
  key: "_setStyles",
19148
19837
  value: function _setStyles() {
19149
- var styles = "\n ".concat(this._getCustomFonts(), " \n ").concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.VrCy(), " \n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
19838
+ var styles = "\n ".concat(this._getCustomFonts(), " \n ").concat(this._getBackgroundContainerStyles(), " \n ").concat(this._getInAppContainerStyles(), " \n ").concat(this._getScrollStyles(), " \n ").concat(this._getControlsStyles(), " \n ").concat(this._getInAppMediaContainerStyles(), "\n ").concat(this._getInAppNonMediaContainerStyles(), "\n ").concat(this._getTextConatinerStyles(), "\n ").concat(this._getTitleStyles(), " \n ").concat(this._getDescriptionStyles(), " \n ").concat(this._getFormStyles(), "\n ").concat(this._getInAppButtonContainerStyles(), "\n ").concat(this._getIconStyles(), " \n ").concat(this._getImageStyles(), " \n ").concat(this._getVideoStyles(), " \n ").concat(this.Rpwa(), " \n ").concat(this._getProgressBarStyles(), "\n ").concat(this._getBootstrapiconsStyles(), " \n ").replaceAll("\n", "").replace(/[\s]{2,999}/g, "");
19150
19839
  var styleNode = document.createElement("style");
19151
19840
  styleNode.setAttribute("id", "apxor-style-" + this.configId);
19152
19841
  styleNode.innerHTML = styles;
@@ -19500,16 +20189,35 @@
19500
20189
  }, {
19501
20190
  key: "_getImageStyles",
19502
20191
  value: function _getImageStyles() {
20192
+ var _this4 = this;
19503
20193
  var imageStyles = "";
19504
20194
 
19505
20195
  // height: ${this.media_height};
19506
20196
  // width: ${this.media_width};
19507
20197
  // background:url('${this.image.path}') no-repeat 50% 50%;
19508
20198
  //Create the css for images only if image_config is sent.
20199
+ var imagePath;
19509
20200
  if (this.enable_image) {
20201
+ if (this.enable_download_files) {
20202
+ var _this$download_files;
20203
+ var format = "";
20204
+ (_this$download_files = this.download_files) === null || _this$download_files === void 0 || _this$download_files.forEach(function (file) {
20205
+ if ((file === null || file === void 0 ? void 0 : file.url) === _this4.image.path) {
20206
+ format = file.format;
20207
+ }
20208
+ });
20209
+ if (format != "") {
20210
+ var _window, _window$getFilePath;
20211
+ imagePath = this.image.path && format ? ((_window = window) === null || _window === void 0 || (_window = _window.Apxor) === null || _window === void 0 || (_window$getFilePath = _window.getFilePath) === null || _window$getFilePath === void 0 ? void 0 : _window$getFilePath.call(_window, this.configId, this.image.path, format)) || this.image.path : this.image.path;
20212
+ } else {
20213
+ imagePath = this.image.path;
20214
+ }
20215
+ } else {
20216
+ imagePath = this.image.path;
20217
+ }
19510
20218
  //Image can be used as a background image. Styles are different in that case.
19511
20219
  if (this.image.enable_background_image) {
19512
- imageStyles = "\n .apx-inapp-image".concat(this.cssPostFix, "{\n background-image: url('").concat(this.image.path, "');\n background-repeat: no-repeat;\n background-attachment: fixed; \n background-size: 100% 100%;\n height: ").concat(this.media_height, ";\n width: ").concat(this.media_width, ";\n box-shadow: inset ").concat(this.media_width, " ").concat(this.media_height, " 0px 0px ").concat(hexToRGB(this.image.background_image.mask_color, this.image.background_image.mask_opacity), ",inset -").concat(this.media_width, " -").concat(this.media_height, " 0px 0px ").concat(hexToRGB(this.image.background_image.mask_color, this.image.background_image.mask_opacity), "\n }\n ");
20220
+ imageStyles = "\n .apx-inapp-image".concat(this.cssPostFix, "{\n background-image: url('").concat(imagePath, "');\n background-repeat: no-repeat;\n background-attachment: fixed; \n background-size: 100% 100%;\n height: ").concat(this.media_height, ";\n width: ").concat(this.media_width, ";\n box-shadow: inset ").concat(this.media_width, " ").concat(this.media_height, " 0px 0px ").concat(hexToRGB(this.image.background_image.mask_color, this.image.background_image.mask_opacity), ",inset -").concat(this.media_width, " -").concat(this.media_height, " 0px 0px ").concat(hexToRGB(this.image.background_image.mask_color, this.image.background_image.mask_opacity), "\n }\n ");
19513
20221
  } else {
19514
20222
  var imageBorderStyles = "";
19515
20223
  if (this.image.enable_border) {
@@ -19626,7 +20334,7 @@
19626
20334
  this._setCloseButton();
19627
20335
 
19628
20336
  //Set the Marketing content
19629
- this.wQRV();
20337
+ this.EWkc();
19630
20338
  }
19631
20339
 
19632
20340
  /**
@@ -19669,22 +20377,22 @@
19669
20377
  }, {
19670
20378
  key: "_setImageOptions",
19671
20379
  value: function _setImageOptions() {
19672
- var _this4 = this;
20380
+ var _this5 = this;
19673
20381
  if (this.enable_image) {
19674
20382
  var action;
19675
20383
  if (this.image.enable_action) {
19676
20384
  var overlay = this.overlayElement;
19677
20385
  var actionCallback = function actionCallback(isCancelled, action) {
19678
- clearTimeout(_this4.terminationTimeoutId);
19679
- _this4.closeCallback(overlay, action, "new-inline".concat(_this4.cssPostFix), _this4.closeListener, _this4.redirectionListener);
20386
+ clearTimeout(_this5.terminationTimeoutId);
20387
+ _this5.closeCallback(overlay, action, "new-inline".concat(_this5.cssPostFix), _this5.closeListener, _this5.redirectionListener);
19680
20388
  };
19681
20389
  var next_Callback = function next_Callback(id, action) {
19682
20390
  actionCallback(false, "next");
19683
- _this4.stepperCallBack(id, action);
20391
+ _this5.stepperCallBack(id, action);
19684
20392
  };
19685
20393
  var prev_Callback = function prev_Callback(id, action) {
19686
20394
  actionCallback(false, "prev");
19687
- _this4.stepperCallBack(id, action);
20395
+ _this5.stepperCallBack(id, action);
19688
20396
  };
19689
20397
  var actionHandler = {
19690
20398
  next: next_Callback,
@@ -19700,7 +20408,23 @@
19700
20408
  this.inAppContainer.classList.add("apx-inapp-image".concat(this.cssPostFix));
19701
20409
  } else {
19702
20410
  var imgElement = document.createElement("img");
19703
- imgElement.src = this.image.path;
20411
+ if (this.enable_download_files) {
20412
+ var _this$download_files2;
20413
+ var format = "";
20414
+ (_this$download_files2 = this.download_files) === null || _this$download_files2 === void 0 || _this$download_files2.forEach(function (file) {
20415
+ if ((file === null || file === void 0 ? void 0 : file.url) === _this5.image.path) {
20416
+ format = file.format;
20417
+ }
20418
+ });
20419
+ if (format != "") {
20420
+ var _window2, _window2$getFilePath;
20421
+ imgElement.src.src = this.image.path && format ? ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.Apxor) === null || _window2 === void 0 || (_window2$getFilePath = _window2.getFilePath) === null || _window2$getFilePath === void 0 ? void 0 : _window2$getFilePath.call(_window2, this.configId, this.image.path, format)) || this.image.path : this.image.path;
20422
+ } else {
20423
+ imgElement.src = this.image.path;
20424
+ }
20425
+ } else {
20426
+ imgElement.src = this.image.path;
20427
+ }
19704
20428
  imgElement.classList.add("apx-inapp-image".concat(this.cssPostFix));
19705
20429
  if (this.image.enable_action) imgElement.onclick = function () {
19706
20430
  return action();
@@ -19754,11 +20478,28 @@
19754
20478
  }, {
19755
20479
  key: "_setIconOptions",
19756
20480
  value: function _setIconOptions() {
20481
+ var _this6 = this;
19757
20482
  if (this.enable_icon) {
19758
20483
  var iconDiv = document.createElement("div");
19759
20484
  iconDiv.classList.add("apx-inapp-icon-container".concat(this.cssPostFix));
19760
20485
  var iconElement = document.createElement("img");
19761
- iconElement.src = this.icon.path;
20486
+ if (this.enable_download_files) {
20487
+ var _this$download_files3;
20488
+ var format = "";
20489
+ (_this$download_files3 = this.download_files) === null || _this$download_files3 === void 0 || _this$download_files3.forEach(function (file) {
20490
+ if ((file === null || file === void 0 ? void 0 : file.url) === _this6.icon.path) {
20491
+ format = file.format;
20492
+ }
20493
+ });
20494
+ if (format != "") {
20495
+ var _window3, _window3$getFilePath;
20496
+ iconElement.src = this.icon.path && format ? ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.Apxor) === null || _window3 === void 0 || (_window3$getFilePath = _window3.getFilePath) === null || _window3$getFilePath === void 0 ? void 0 : _window3$getFilePath.call(_window3, this.configId, iconElement.src, format)) || this.icon.path : this.icon.path;
20497
+ } else {
20498
+ iconElement.src = this.icon.path;
20499
+ }
20500
+ } else {
20501
+ iconElement.src = this.icon.path;
20502
+ }
19762
20503
  iconElement.classList.add("apx-inapp-icon-content".concat(this.cssPostFix));
19763
20504
  iconDiv.appendChild(iconElement);
19764
20505
  this.mediaContainer.appendChild(iconDiv);
@@ -19799,13 +20540,30 @@
19799
20540
  }, {
19800
20541
  key: "_setTitleContent",
19801
20542
  value: function _setTitleContent() {
20543
+ var _this7 = this;
19802
20544
  // Create an element for the title and append it to the container.
19803
20545
  if (this.enable_title) {
19804
20546
  var titleElement = document.createElement("div");
19805
20547
  titleElement.classList.add("apx-inapp-title-div".concat(this.cssPostFix));
19806
20548
  if (this.title.enable_icon) {
19807
20549
  var titleIconElement = document.createElement("img");
19808
- titleIconElement.src = this.title.icon.path;
20550
+ if (this.enable_download_files) {
20551
+ var _this$download_files4;
20552
+ var format = "";
20553
+ (_this$download_files4 = this.download_files) === null || _this$download_files4 === void 0 || _this$download_files4.forEach(function (file) {
20554
+ if ((file === null || file === void 0 ? void 0 : file.url) === _this7.title.icon.path) {
20555
+ format = file.format;
20556
+ }
20557
+ });
20558
+ if (format != "") {
20559
+ var _window4, _window4$getFilePath;
20560
+ titleIconElement.src = this.title.icon.path && format ? ((_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.Apxor) === null || _window4 === void 0 || (_window4$getFilePath = _window4.getFilePath) === null || _window4$getFilePath === void 0 ? void 0 : _window4$getFilePath.call(_window4, this.configId, this.title.icon.path, format)) || this.title.icon.path : this.title.icon.path;
20561
+ } else {
20562
+ titleIconElement.src = this.title.icon.path;
20563
+ }
20564
+ } else {
20565
+ titleIconElement.src = this.title.icon.path;
20566
+ }
19809
20567
  titleIconElement.classList.add("apx-inapp-title-icon".concat(this.cssPostFix));
19810
20568
  titleElement.appendChild(titleIconElement);
19811
20569
  }
@@ -19844,7 +20602,7 @@
19844
20602
  * @description Sets the form content in the InApp modal.
19845
20603
  */
19846
20604
  function _setFormContent() {
19847
- var _this5 = this;
20605
+ var _this8 = this;
19848
20606
  if (this.enable_form) {
19849
20607
  var _this$form$elements;
19850
20608
  var formContainer = document.createElement("form");
@@ -19858,14 +20616,14 @@
19858
20616
  var form = document.querySelector(".apx-inapp-form-container".concat(this.cssPostFix));
19859
20617
  form.addEventListener("submit", function (e) {
19860
20618
  e.preventDefault();
19861
- var _this5$generateRespon = _this5.UrBX(_this5.form.elements),
19862
- obj = _this5$generateRespon.obj,
19863
- callback = _this5$generateRespon.callback;
20619
+ var _this8$generateRespon = _this8.mJrR(_this8.form.elements),
20620
+ obj = _this8$generateRespon.obj,
20621
+ callback = _this8$generateRespon.callback;
19864
20622
  var evalString = "(obj)=>" + callback + "(obj)";
19865
20623
  var evalFunction = eval(evalString);
19866
20624
  evalFunction(obj);
19867
- clearTimeout(_this5.terminationTimeoutId);
19868
- _this5.closeCallback(_this5.overlayElement, "dismiss", ".apx-inapp-container".concat(_this5.cssPostFix), _this5.closeListener, _this5.redirectionListener);
20625
+ clearTimeout(_this8.terminationTimeoutId);
20626
+ _this8.closeCallback(_this8.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this8.cssPostFix), _this8.closeListener, _this8.redirectionListener);
19869
20627
  });
19870
20628
  }
19871
20629
  }
@@ -19965,23 +20723,23 @@
19965
20723
  }, {
19966
20724
  key: "_setButtons",
19967
20725
  value: function _setButtons(position) {
19968
- var _this6 = this;
20726
+ var _this9 = this;
19969
20727
  if (!this.enable_buttons) {
19970
20728
  return;
19971
20729
  }
19972
20730
  if (position === BUTTON_CONTAINER_POSITION.TOP && this.buttons.enable_top || position === BUTTON_CONTAINER_POSITION.CENTER && this.buttons.enable_center || position === BUTTON_CONTAINER_POSITION.BOTTOM && this.buttons.enable_bottom) {
19973
20731
  var overlay = this.overlayElement;
19974
20732
  var actionCallback = function actionCallback(isCancelled, action) {
19975
- clearTimeout(_this6.terminationTimeoutId);
19976
- _this6.closeCallback(overlay, action, "new-inline".concat(_this6.cssPostFix), _this6.closeListener, _this6.redirectionListener);
20733
+ clearTimeout(_this9.terminationTimeoutId);
20734
+ _this9.closeCallback(overlay, action, "", "new-inline".concat(_this9.cssPostFix), _this9.closeListener, _this9.redirectionListener);
19977
20735
  };
19978
20736
  var next_Callback = function next_Callback(id, action) {
19979
20737
  actionCallback(false, "next");
19980
- _this6.stepperCallBack(id, action);
20738
+ _this9.stepperCallBack(id, action);
19981
20739
  };
19982
20740
  var prev_Callback = function prev_Callback(id, action) {
19983
20741
  actionCallback(false, "prev");
19984
- _this6.stepperCallBack(id, action);
20742
+ _this9.stepperCallBack(id, action);
19985
20743
  };
19986
20744
  var actionHandler = {
19987
20745
  next: next_Callback,
@@ -20004,7 +20762,7 @@
20004
20762
  // button_config.text.font.family = this._setFontFaceAtRule(button_config.text.font);
20005
20763
  // return button_config;
20006
20764
  // })
20007
- var _Buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INAPP, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index);
20765
+ var _Buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INAPP, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index, "center", 1, this.step);
20008
20766
  if (position === BUTTON_CONTAINER_POSITION.TOP) {
20009
20767
  this.topButtonContainer.appendChild(_Buttons);
20010
20768
  } else if (position === BUTTON_CONTAINER_POSITION.CENTER) {
@@ -20023,7 +20781,7 @@
20023
20781
  }, {
20024
20782
  key: "_setCloseButton",
20025
20783
  value: function _setCloseButton() {
20026
- var _this7 = this;
20784
+ var _this10 = this;
20027
20785
  if (this.enable_close_button) {
20028
20786
  var closeButton = document.createElement("span");
20029
20787
  // Close button SVG is decided based on the type of the button in the config.
@@ -20040,13 +20798,13 @@
20040
20798
  }
20041
20799
  closeButton.classList.add("apx-inapp-close".concat(this.cssPostFix));
20042
20800
  closeButton.addEventListener("click", function () {
20043
- if (_this7.close_button.action === "dismiss") {
20044
- window.Apxor.logActionEvent(EVENT_PREFIX.INAPP + "InAppXIconClicked" + "_Clicked", _this7.configId, _this7.name);
20045
- } else if (_this7.close_button.action === "cancel") {
20046
- window.Apxor.logActionEvent("walk_through_cancelled", _this7.configId, _this7.name);
20801
+ if (_this10.close_button.action === "dismiss") {
20802
+ window.Apxor.logActionEvent(EVENT_PREFIX.INAPP + "InAppXIconClicked" + "_Clicked", _this10.configId, _this10.name);
20803
+ } else if (_this10.close_button.action === "cancel") {
20804
+ window.Apxor.logActionEvent("walk_through_cancelled", _this10.configId, _this10.name);
20047
20805
  }
20048
- clearTimeout(_this7.terminationTimeoutId);
20049
- _this7.closeCallback(_this7.overlayElement, _this7.close_button.action, ".apx-inapp-container".concat(_this7.cssPostFix), _this7.closeListener, _this7.redirectionListener);
20806
+ clearTimeout(_this10.terminationTimeoutId);
20807
+ _this10.closeCallback(_this10.overlayElement, _this10.close_button.action, "", ".apx-inapp-container".concat(_this10.cssPostFix), _this10.closeListener, _this10.redirectionListener);
20050
20808
  });
20051
20809
  this.direction.non_media === DIRECTION.VERTICAL || this.direction.nudge === DIRECTION.VERTICAL ? this.inAppContainer.appendChild(closeButton) : this.buttonContainer.appendChild(closeButton);
20052
20810
  }
@@ -20060,10 +20818,10 @@
20060
20818
  * @description If the auto dismiss is enabled, sets the timeout to call the InApp close.
20061
20819
  */
20062
20820
  function _setAutoTerminate() {
20063
- var _this8 = this;
20821
+ var _this11 = this;
20064
20822
  if (this.terminationConfig.auto_dismiss === true) {
20065
20823
  this.terminationTimeoutId = window.setTimeout(function () {
20066
- _this8.closeCallback(_this8.overlayElement, "dismiss", ".apx-inapp-container".concat(_this8.cssPostFix), _this8.closeListener, _this8.redirectionListener);
20824
+ _this11.closeCallback(_this11.overlayElement, "dismiss", "", ".apx-inapp-container".concat(_this11.cssPostFix), _this11.closeListener, _this11.redirectionListener);
20067
20825
  }, this.terminationConfig.duration);
20068
20826
  }
20069
20827
  }
@@ -20165,7 +20923,9 @@
20165
20923
  * @param {function} hideCallback
20166
20924
  */
20167
20925
  function VideoInApp(config, terminationConfig, configId, name, showCallback, _hideCallback) {
20168
- var _this = this;
20926
+ var _this = this,
20927
+ _this$config,
20928
+ _this$config2;
20169
20929
  _classCallCheck(this, VideoInApp);
20170
20930
  /**
20171
20931
  * @function showVideoInApp
@@ -20216,7 +20976,7 @@
20216
20976
  };
20217
20977
  } else {
20218
20978
  // As the video player is hidden by default, unhide if the mode is not PIP.
20219
- _this.lZpS();
20979
+ _this.FivR();
20220
20980
  }
20221
20981
  _this.showCallback();
20222
20982
  } catch (e) {
@@ -20237,7 +20997,7 @@
20237
20997
  * For portrait - width is set to 50% of the screen and height is auto adjusted based on resolution.
20238
20998
  * For landscape - height is set to 50% of the screen and width is auto adjusted based on resolution.
20239
20999
  */
20240
- _defineProperty(this, "Bntg", function () {
21000
+ _defineProperty(this, "SXHT", function () {
20241
21001
  var _getHeightWidthFromRe = getHeightWidthFromResolution(_this.video, 1),
20242
21002
  width = _getHeightWidthFromRe.width,
20243
21003
  height = _getHeightWidthFromRe.height;
@@ -20249,7 +21009,7 @@
20249
21009
  * @private
20250
21010
  * @description Removes the video player style element.
20251
21011
  */
20252
- _defineProperty(this, "mCTB", function () {
21012
+ _defineProperty(this, "ejyO", function () {
20253
21013
  var playerStyles = document.getElementById("apx-mpl-styles");
20254
21014
  if (playerStyles) {
20255
21015
  playerStyles.remove();
@@ -20260,7 +21020,7 @@
20260
21020
  * @private
20261
21021
  * @description Attach listeners on the video controls
20262
21022
  */
20263
- _defineProperty(this, "vJMI", function () {
21023
+ _defineProperty(this, "WNJK", function () {
20264
21024
  // Listener for the video end. Display the CTA's when the video ends.
20265
21025
  _this.videoElement.addEventListener("ended", function () {
20266
21026
  var ctaButtons = document.getElementById("apx-cta-btn");
@@ -20375,7 +21135,7 @@
20375
21135
  * @private
20376
21136
  * @description Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
20377
21137
  */
20378
- _defineProperty(this, "sHYh", function () {
21138
+ _defineProperty(this, "QBel", function () {
20379
21139
  var _this$terminationConf;
20380
21140
  if (_this.mode === "PIP" && !((_this$terminationConf = _this.terminationConfig) !== null && _this$terminationConf !== void 0 && _this$terminationConf.auto_dismiss)) {
20381
21141
  // On Exit of the PIP,
@@ -20415,7 +21175,7 @@
20415
21175
  * @private Sets the custom controls on the video player.
20416
21176
  * PIP and close are the custom controls that are created and positions on the video.
20417
21177
  */
20418
- _defineProperty(this, "WaDM", function () {
21178
+ _defineProperty(this, "stqw", function () {
20419
21179
  _this.enable_close_button;
20420
21180
  if (_this.enable_close_button) {
20421
21181
  var closeButton = document.createElement("span");
@@ -20462,21 +21222,21 @@
20462
21222
  * @function hideVideoPlayer
20463
21223
  * @description Sets the visibility of the video player to hidden.
20464
21224
  */
20465
- _defineProperty(this, "TNFE", function () {
21225
+ _defineProperty(this, "XcAB", function () {
20466
21226
  _this.videoPlayer.classList.add("apx-video-hide-elmt".concat(_this.cssPostFix));
20467
21227
  });
20468
21228
  /**
20469
21229
  * @function unhideVideoPlayer
20470
21230
  * @description Unhides video player.
20471
21231
  */
20472
- _defineProperty(this, "lZpS", function () {
21232
+ _defineProperty(this, "FivR", function () {
20473
21233
  _this.videoPlayer.classList.remove("apx-video-hide-elmt".concat(_this.cssPostFix));
20474
21234
  });
20475
21235
  /**
20476
21236
  * @function getVideoElement
20477
21237
  * @returns {HTMLElement} Video ekement
20478
21238
  */
20479
- _defineProperty(this, "FXhx", function () {
21239
+ _defineProperty(this, "MbVl", function () {
20480
21240
  return _this.videoElement;
20481
21241
  });
20482
21242
  this.videoPlayer = null;
@@ -20487,6 +21247,7 @@
20487
21247
  this.height = 320;
20488
21248
  this.width = 320;
20489
21249
  this.configId = configId;
21250
+ this.config = config;
20490
21251
  this.name = name || "VideoPlayer";
20491
21252
  this.cssPostFix = "-".concat(this.configId, "-").concat(this.name).replaceAll(" ", "").replace(/[^\w\s]/gi, "");
20492
21253
  this.replayCount = 0;
@@ -20506,6 +21267,7 @@
20506
21267
  if (this.enable_pip_button) this.pip_button = new PIPButton(config.pip_button);
20507
21268
  this.video = new Video(config.video);
20508
21269
  this.pip = new PIP(config.pip);
21270
+ this.step = (_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.additional_info) !== null && _this$config !== void 0 && _this$config.apx_step ? (_this$config2 = this.config) === null || _this$config2 === void 0 || (_this$config2 = _this$config2.additional_info) === null || _this$config2 === void 0 ? void 0 : _this$config2.apx_step : -1;
20509
21271
  }
20510
21272
 
20511
21273
  /**
@@ -20528,7 +21290,7 @@
20528
21290
  this.videoPlayer.style.backgroundColor = this.bg_color;
20529
21291
 
20530
21292
  // Video has a resolution, not deviating from the resolution set the height and width.
20531
- this.Bntg();
21293
+ this.SXHT();
20532
21294
  //Generate the styles and add them to the document head.
20533
21295
  this._setVideoPlayerStyles();
20534
21296
  //Set the position of the video player with in the 5 possible positions.
@@ -20536,16 +21298,16 @@
20536
21298
  //Create a video element,set the source and add to the container.
20537
21299
  this._setPlayerContent();
20538
21300
  //Set the listeners on the video control buttons.
20539
- this.vJMI();
21301
+ this.WNJK();
20540
21302
  //Attach listeners for the PIP toggle. i.e. for the PIP enter and PIP exit
20541
- this.sHYh();
21303
+ this.QBel();
20542
21304
  //Set the custom close and PIP controls. Not using the defaults from the html video element.
20543
21305
  //Reason - We want to position them at the top right and left positions.
20544
- this.WaDM();
21306
+ this.stqw();
20545
21307
  //Generate and postion the CTA buttons on the video. By default hidden, visible only when video is completed
20546
21308
  this._setButtons(BUTTON_CONTAINER_POSITION.CENTER);
20547
21309
  //Hide the video player. Display it based on the video mode. Videoplayer for "video" mode and a direct PIP for "PIP" mode.
20548
- this.TNFE();
21310
+ this.XcAB();
20549
21311
  //If the auto dismiss is enabled, sets the timeout to call the InApp close.
20550
21312
  this._setAutoTerminate();
20551
21313
  document.body.appendChild(this.videoPlayer);
@@ -20660,7 +21422,7 @@
20660
21422
  }
20661
21423
  }
20662
21424
  this.videoPlayer.remove();
20663
- this.mCTB();
21425
+ this.ejyO();
20664
21426
  if (closeButtonName !== "auto_dismiss") {
20665
21427
  var _window$ApxorRTM9;
20666
21428
  (_window$ApxorRTM9 = window.ApxorRTM) === null || _window$ApxorRTM9 === void 0 || _window$ApxorRTM9.logEvent("apx_video_inapp_close_button_clicked", {
@@ -20730,7 +21492,7 @@
20730
21492
  replayCount: _this3.replayCount
20731
21493
  });
20732
21494
  _this3.videoPlayer.remove();
20733
- _this3.mCTB();
21495
+ _this3.ejyO();
20734
21496
  _this3.hideCallback();
20735
21497
  } catch (e) {
20736
21498
  console.log("Can't close the video player\n".concat(e));
@@ -20752,7 +21514,7 @@
20752
21514
  } else {
20753
21515
  buttons_config = this.buttons.bottom;
20754
21516
  }
20755
- var buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INAPP, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index);
21517
+ var buttons = generateButtonsBlock(this.configId, this.name, this.stepper, EVENT_PREFIX.INAPP, buttons_config, this.direction.buttons, position, actionHandler, this.isWalkthrough, this.uis, this.index, "center", 1, this.step);
20756
21518
  buttons.setAttribute("id", "apx-cta-btn");
20757
21519
  buttons.classList.add("apx-video-cta".concat(this.cssPostFix));
20758
21520
  buttons.classList.add("apx-video-hide-elmt".concat(this.cssPostFix));
@@ -20824,14 +21586,14 @@
20824
21586
  try {
20825
21587
  var _window;
20826
21588
  (_window = window) === null || _window === void 0 || (_window = _window.ApxorLogger) === null || _window === void 0 || _window.debug("called showEmbedCards");
20827
- var element = _this.VvNT(_this.layout);
20828
- _this.XCRi();
21589
+ var element = _this.CiXs(_this.layout);
21590
+ _this.cxsH();
20829
21591
  window.onresize = function () {
20830
- _this.NiOI();
21592
+ _this.ahtj();
20831
21593
  };
20832
21594
  _this.imageElements.forEach(function (img) {
20833
21595
  img.addEventListener("error", function () {
20834
- _this.YaYk("provided image doesn't exists");
21596
+ _this.JmOW("provided image doesn't exists");
20835
21597
  });
20836
21598
  });
20837
21599
  var rootContainer = document.createElement("div");
@@ -20842,7 +21604,7 @@
20842
21604
  var styleElement = document.createElement("style");
20843
21605
  styleElement.innerHTML = _this.styleContent;
20844
21606
  document.head.appendChild(styleElement);
20845
- _this.SafO(_this.termination);
21607
+ _this.hQng(_this.termination);
20846
21608
  try {
20847
21609
  eval(_this.script);
20848
21610
  } catch (e) {
@@ -20853,10 +21615,10 @@
20853
21615
  _this.intervalToCheckMediaLoadingStatus = setInterval(function () {
20854
21616
  _this.wait_interval -= 1;
20855
21617
  if (_this.wait_interval <= 0) {
20856
- _this.YaYk("provided media doesn't exists");
21618
+ _this.JmOW("provided media doesn't exists");
20857
21619
  } else {
20858
- if (_this.PXQj() && _this.DZYh()) {
20859
- _this.NiOI();
21620
+ if (_this.uDuu() && _this.FgHb() && _this.IJFb()) {
21621
+ _this.ahtj();
20860
21622
  clearInterval(_this.intervalToCheckMediaLoadingStatus);
20861
21623
  }
20862
21624
  }
@@ -20867,12 +21629,12 @@
20867
21629
  (_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.ApxorLogger) === null || _window3 === void 0 || _window3.error("failed while creating embed card with error: ".concat(e === null || e === void 0 ? void 0 : e.name, " ").concat(e === null || e === void 0 ? void 0 : e.message));
20868
21630
  }
20869
21631
  });
20870
- _defineProperty(this, "YaYk", function (reason) {
21632
+ _defineProperty(this, "JmOW", function (reason) {
20871
21633
  var _window$ApxorRTM, _window4;
20872
21634
  !_this.loggedNudgeNotShownEvent && ((_window$ApxorRTM = window.ApxorRTM) === null || _window$ApxorRTM === void 0 ? void 0 : _window$ApxorRTM.logEvent("apx_nudge_not_shown", {
20873
- campaignName: _this.name,
20874
- id: _this.configId,
20875
- apx_nudge_type: "sticky_card",
21635
+ apx_nudge_name: _this.name,
21636
+ apx_nudge_id: _this.configId,
21637
+ apx_template_time: "embed-card",
20876
21638
  apx_notshown_type: "error",
20877
21639
  apx_reason: reason
20878
21640
  }));
@@ -20881,19 +21643,20 @@
20881
21643
  clearInterval(_this.intervalToCheckMediaLoadingStatus);
20882
21644
  (_window4 = window) === null || _window4 === void 0 || (_window4 = _window4.ApxorWidget) === null || _window4 === void 0 || _window4.removeEmbedCard(_this.configId);
20883
21645
  });
20884
- _defineProperty(this, "XCRi", function () {
21646
+ _defineProperty(this, "cxsH", function () {
20885
21647
  var EmbeddedCardsStyles = document.createElement("style");
20886
21648
  EmbeddedCardsStyles.innerHTML = _this.initialStyles;
20887
- EmbeddedCardsStyles.setAttribute("apx-tooltip-styles", "");
21649
+ EmbeddedCardsStyles.setAttribute("apx-embedded-card-styles", "");
20888
21650
  document.head.appendChild(EmbeddedCardsStyles);
20889
21651
  });
20890
- _defineProperty(this, "VvNT", function (config) {
21652
+ _defineProperty(this, "CiXs", function (config) {
20891
21653
  var _window$Apxor;
20892
21654
  var element;
20893
21655
  switch (config.type) {
20894
21656
  case "cell":
20895
21657
  case "img":
20896
21658
  case "text":
21659
+ case "cta_button":
20897
21660
  case "button":
20898
21661
  element = document.createElement(EMBED_CARD_TYPE[config.type]);
20899
21662
  break;
@@ -20907,28 +21670,14 @@
20907
21670
  if (((_window$Apxor = window.Apxor) === null || _window$Apxor === void 0 ? void 0 : _window$Apxor.platform) === "ios") {
20908
21671
  element.playsInline = true;
20909
21672
  }
20910
- // if (config.source) {
20911
- // let sourceElement = document.createElement("source");
20912
- // for (let prop in config.source) {
20913
- // sourceElement[prop] = config.source[prop];
20914
- // }
20915
- // element.appendChild(sourceElement);
20916
- // }
20917
- // if (config.track) {
20918
- // let trackElement = document.createElement("track");
20919
- // for (let prop in config.track) {
20920
- // trackElement[prop] = config.track[prop];
20921
- // }
20922
- // element.appendChild(trackElement);
20923
- // }
21673
+ break;
21674
+ case "cross_button":
21675
+ element = document.createElement("div");
21676
+ element.innerHTML = CROSS_ICON_SVG;
20924
21677
  break;
20925
21678
  default:
20926
21679
  element = document.createElement(config.type);
20927
21680
  }
20928
- // const element = document.createElement(
20929
- // EMBED_CARD_TYPE[config.type] ?? config.type
20930
- // );
20931
-
20932
21681
  if (config.properties) {
20933
21682
  for (var prop in config.properties) {
20934
21683
  if (config.type === "img" && prop === "src" || config.type === "img" && prop === "format") continue;
@@ -20952,6 +21701,14 @@
20952
21701
  var styleObject = parseCSS(config.css);
20953
21702
  var imgStyleObject = removeKeys(styleObject, Object.keys(imgWrapperStyles));
20954
21703
  styles = ".".concat(config._id, " {\n ").concat(objectToCSS(imgStyleObject), "\n }\n ");
21704
+ } else if (config._id === _this.layout._id) {
21705
+ var layoutStyleObject = parseCSS(config.css);
21706
+ if (layoutStyleObject["background-image"]) {
21707
+ var backgroundImageUrl = extractBgImageUrl(layoutStyleObject);
21708
+ layoutStyleObject["background-image"] = "url(".concat(decodeURIComponent(backgroundImageUrl), ")");
21709
+ _this.bgImageUrl = decodeURIComponent(backgroundImageUrl);
21710
+ }
21711
+ styles = ".".concat(config._id, " {\n ").concat(objectToCSS(layoutStyleObject), "\n }\n ");
20955
21712
  } else {
20956
21713
  styles = ".".concat(config._id, " {\n ").concat(config.css, "\n }\n ");
20957
21714
  }
@@ -20964,56 +21721,29 @@
20964
21721
  case "activity":
20965
21722
  case "ir":
20966
21723
  element.onclick = function (e) {
20967
- var _e$target$getAttribut, _e$target, _e$target$getAttribut2;
20968
21724
  e.stopPropagation();
20969
21725
  window.Apxor.redirect(JSON.stringify(action));
20970
- var additional_info = {
20971
- campaignName: _this.name,
20972
- id: _this.configId,
20973
- apx_nudge_type: "sticky_card",
20974
- apx_card_name: (_e$target$getAttribut = (_e$target = e.target) === null || _e$target === void 0 || (_e$target$getAttribut2 = _e$target.getAttribute) === null || _e$target$getAttribut2 === void 0 ? void 0 : _e$target$getAttribut2.call(_e$target, "card_name")) !== null && _e$target$getAttribut !== void 0 ? _e$target$getAttribut : ""
20975
- };
20976
- if (e.target.tagName === "BUTTON") {
20977
- var _window$ApxorRTM2;
20978
- additional_info["apx_cta_text"] = e.target.innerHTML;
20979
- (_window$ApxorRTM2 = window.ApxorRTM) === null || _window$ApxorRTM2 === void 0 || _window$ApxorRTM2.logEvent("apx_card_CTA_clicked", additional_info);
20980
- } else {
20981
- var _window$ApxorRTM3;
20982
- (_window$ApxorRTM3 = window.ApxorRTM) === null || _window$ApxorRTM3 === void 0 || _window$ApxorRTM3.logEvent("apx_card_interaction", additional_info);
20983
- }
21726
+ _this.STbC(e);
20984
21727
  };
20985
21728
  break;
20986
21729
  case "show-video":
20987
21730
  element.onclick = function (e) {
20988
- var _e$target$getAttribut3, _e$target2, _e$target2$getAttribu;
20989
21731
  e.stopPropagation();
20990
21732
  window.Apxor.showVideoInApp(_this.configId, _this.name, action.url);
20991
- var additional_info = {
20992
- campaignName: _this.name,
20993
- id: _this.configId,
20994
- apx_nudge_type: "sticky_card",
20995
- apx_card_name: (_e$target$getAttribut3 = (_e$target2 = e.target) === null || _e$target2 === void 0 || (_e$target2$getAttribu = _e$target2.getAttribute) === null || _e$target2$getAttribu === void 0 ? void 0 : _e$target2$getAttribu.call(_e$target2, "card_name")) !== null && _e$target$getAttribut3 !== void 0 ? _e$target$getAttribut3 : ""
20996
- };
20997
- if (e.target.tagName === "BUTTON") {
20998
- var _window$ApxorRTM4;
20999
- additional_info["apx_cta_text"] = e.target.innerHTML;
21000
- (_window$ApxorRTM4 = window.ApxorRTM) === null || _window$ApxorRTM4 === void 0 || _window$ApxorRTM4.logEvent("apx_card_CTA_clicked", additional_info);
21001
- } else {
21002
- var _window$ApxorRTM5;
21003
- (_window$ApxorRTM5 = window.ApxorRTM) === null || _window$ApxorRTM5 === void 0 || _window$ApxorRTM5.logEvent("apx_card_interaction", additional_info);
21004
- }
21733
+ _this.STbC(e);
21005
21734
  };
21006
21735
  break;
21007
21736
  case "cancel":
21008
21737
  element.onclick = function (e) {
21009
21738
  e.stopPropagation();
21739
+ _this.STbC(e);
21010
21740
  window.Apxor.logActionEvent("walk_through_cancelled", _this.configId, _this.name);
21011
21741
  };
21012
21742
  break;
21013
21743
  case "dismiss":
21014
21744
  element.onclick = function (e) {
21015
21745
  e.stopPropagation();
21016
- window.Apxor.logActionEvent("".concat(_this.type, "_dismissed"), _this.configId, _this.name);
21746
+ _this.STbC(e);
21017
21747
  };
21018
21748
  break;
21019
21749
  case "never":
@@ -21021,6 +21751,7 @@
21021
21751
  e.stopPropagation();
21022
21752
  window.Apxor.neverShow(_this.configId, _this.name, "IN_APP");
21023
21753
  window.Apxor.logActionEvent("never_show_clicked", _this.configId, _this.name);
21754
+ _this.STbC(e);
21024
21755
  };
21025
21756
  break;
21026
21757
  case "toggle-class":
@@ -21037,7 +21768,6 @@
21037
21768
  break;
21038
21769
  case "copy-content":
21039
21770
  element.onclick = function (e) {
21040
- var _e$target$getAttribut4, _e$target3, _e$target3$getAttribu;
21041
21771
  e.stopPropagation();
21042
21772
  var textToCopy = action === null || action === void 0 ? void 0 : action.content;
21043
21773
  var tempInput = document.createElement("input");
@@ -21046,20 +21776,7 @@
21046
21776
  tempInput.select();
21047
21777
  document.execCommand("copy");
21048
21778
  document.body.removeChild(tempInput);
21049
- var additional_info = {
21050
- campaignName: _this.name,
21051
- id: _this.configId,
21052
- apx_nudge_type: "sticky_card",
21053
- apx_card_name: (_e$target$getAttribut4 = (_e$target3 = e.target) === null || _e$target3 === void 0 || (_e$target3$getAttribu = _e$target3.getAttribute) === null || _e$target3$getAttribu === void 0 ? void 0 : _e$target3$getAttribu.call(_e$target3, "card_name")) !== null && _e$target$getAttribut4 !== void 0 ? _e$target$getAttribut4 : ""
21054
- };
21055
- if (e.target.tagName === "BUTTON") {
21056
- var _window$ApxorRTM6;
21057
- additional_info["apx_cta_text"] = e.target.innerHTML;
21058
- (_window$ApxorRTM6 = window.ApxorRTM) === null || _window$ApxorRTM6 === void 0 || _window$ApxorRTM6.logEvent("apx_card_CTA_clicked", additional_info);
21059
- } else {
21060
- var _window$ApxorRTM7;
21061
- (_window$ApxorRTM7 = window.ApxorRTM) === null || _window$ApxorRTM7 === void 0 || _window$ApxorRTM7.logEvent("apx_card_interaction", additional_info);
21062
- }
21779
+ _this.STbC(e);
21063
21780
  };
21064
21781
  break;
21065
21782
  case "log-app-event":
@@ -21077,27 +21794,16 @@
21077
21794
  });
21078
21795
  }
21079
21796
  if (config.absolute_position_children && config.absolute_position_children.length > 0) {
21080
- element.style.position = "relative";
21081
21797
  config.absolute_position_children.forEach(function (childConfig) {
21082
- var childElement = _this.HjRo(childConfig);
21083
- childElement.style.position = "absolute";
21084
- for (var _prop in childConfig.offset) {
21085
- childElement.style[_prop] = childConfig.offset[_prop];
21086
- }
21798
+ var childElement = _this.xyYY(childConfig);
21087
21799
  element.appendChild(childElement);
21088
21800
  });
21089
21801
  }
21090
21802
 
21091
21803
  // Process children
21092
21804
  if (config.children && config.children.length > 0) {
21093
- //element.style.display = "flex";
21094
-
21095
- // if (config.direction) {
21096
- // element.style.flexDirection = config.direction;
21097
- // }
21098
-
21099
21805
  config.children.forEach(function (childConfig) {
21100
- var childElement = _this.VvNT(childConfig);
21806
+ var childElement = _this.CiXs(childConfig);
21101
21807
  element.appendChild(childElement);
21102
21808
  });
21103
21809
  }
@@ -21123,7 +21829,24 @@
21123
21829
  }
21124
21830
  return element;
21125
21831
  });
21126
- _defineProperty(this, "SafO", function (config) {
21832
+ _defineProperty(this, "STbC", function (e) {
21833
+ var _e$target$getAttribut, _e$target, _e$target$getAttribut2;
21834
+ var additional_info = {
21835
+ apx_nudge_name: _this.name,
21836
+ apx_nudge_id: _this.configId,
21837
+ apx_card_name: (_e$target$getAttribut = e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 || (_e$target$getAttribut2 = _e$target.getAttribute) === null || _e$target$getAttribut2 === void 0 ? void 0 : _e$target$getAttribut2.call(_e$target, "card_name")) !== null && _e$target$getAttribut !== void 0 ? _e$target$getAttribut : "",
21838
+ apx_template_name: "embed-card"
21839
+ };
21840
+ if (e.target.tagName === "BUTTON") {
21841
+ var _e$target$innerHTML, _e$target2, _window$ApxorRTM2;
21842
+ additional_info["apx_cta_text"] = (_e$target$innerHTML = e === null || e === void 0 || (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.innerHTML) !== null && _e$target$innerHTML !== void 0 ? _e$target$innerHTML : "";
21843
+ (_window$ApxorRTM2 = window.ApxorRTM) === null || _window$ApxorRTM2 === void 0 || _window$ApxorRTM2.logEvent("apx_card_CTA_clicked", additional_info);
21844
+ } else {
21845
+ var _window$ApxorRTM3;
21846
+ (_window$ApxorRTM3 = window.ApxorRTM) === null || _window$ApxorRTM3 === void 0 || _window$ApxorRTM3.logEvent("apx_card_interaction", additional_info);
21847
+ }
21848
+ });
21849
+ _defineProperty(this, "hQng", function (config) {
21127
21850
  config.forEach(function (id) {
21128
21851
  var element = document.getElementById(id);
21129
21852
  if (element) {
@@ -21131,7 +21854,7 @@
21131
21854
  }
21132
21855
  });
21133
21856
  });
21134
- _defineProperty(this, "DZYh", function () {
21857
+ _defineProperty(this, "FgHb", function () {
21135
21858
  //This logic is to make sure that image has loaded, it doesn't check whether image is broken
21136
21859
  //refer: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/complete#value
21137
21860
  if (_this.imageElements.length === 0) return true;
@@ -21139,13 +21862,19 @@
21139
21862
  return img.complete;
21140
21863
  });
21141
21864
  });
21142
- _defineProperty(this, "PXQj", function () {
21865
+ _defineProperty(this, "uDuu", function () {
21143
21866
  if (_this.videoElements.length === 0) return true;
21144
21867
  return _this.videoElements.every(function (video) {
21145
21868
  return video.readyState >= 3;
21146
21869
  });
21147
21870
  });
21148
- _defineProperty(this, "NiOI", function () {
21871
+ _defineProperty(this, "IJFb", function () {
21872
+ if (!_this.bgImageUrl) return true;
21873
+ var img = new Image();
21874
+ img.src = _this.bgImageUrl;
21875
+ return img.complete;
21876
+ });
21877
+ _defineProperty(this, "ahtj", function () {
21149
21878
  var _window6, _window7;
21150
21879
  var width = window.document.querySelector("html").offsetWidth;
21151
21880
  var height = window.document.querySelector("html").offsetHeight;
@@ -21168,6 +21897,7 @@
21168
21897
  this.initialStyles = "";
21169
21898
  this.imageElements = [];
21170
21899
  this.videoElements = [];
21900
+ this.bgImageUrl = "";
21171
21901
  this.intervalToCheckMediaLoadingStatus = null;
21172
21902
  this.loggedNudgeShownEvent = false;
21173
21903
  this.loggedNudgeNotShownEvent = false;
@@ -21233,8 +21963,8 @@
21233
21963
  _this.storyContainer.appendChild(currentElement);
21234
21964
  _this.storyContainer.appendChild(slideDetails);
21235
21965
  document.body.appendChild(_this.storyContainer);
21236
- _this.UhcC();
21237
- _this.yUQd();
21966
+ _this.eceU();
21967
+ _this.LYqv();
21238
21968
  _this.progress = Array.from(document.querySelectorAll(".progress"));
21239
21969
  var current_slide = document.querySelector(".slide-details");
21240
21970
  var playNext = function playNext(e) {
@@ -21280,7 +22010,7 @@
21280
22010
  _existingAbsoluteElements2.forEach(function (element) {
21281
22011
  element.remove();
21282
22012
  });
21283
- // this.Voll();
22013
+ // this.sAkH();
21284
22014
  var _currentSlideDetails = document.querySelector(".slide-details");
21285
22015
  _currentSlideDetails.innerHTML = "";
21286
22016
  _this.position = _this.position + 1;
@@ -21376,7 +22106,7 @@
21376
22106
  absolute_header = document.createElement("div");
21377
22107
  current_slide_from_config.layout.absolute_position_children.forEach(function (current_element) {
21378
22108
  var current_absolute_element;
21379
- current_absolute_element = _this.HjRo(current_element);
22109
+ current_absolute_element = _this.xyYY(current_element);
21380
22110
  absolute_header.appendChild(current_absolute_element);
21381
22111
  });
21382
22112
  (_absolute_header = absolute_header) === null || _absolute_header === void 0 || _absolute_header.classList.add("apx-slide-header");
@@ -21437,7 +22167,7 @@
21437
22167
  document.body.style.backgroundRepeat = "";
21438
22168
  var updated_layout_without_absolute_elements = JSON.parse(JSON.stringify(current_slide_from_config.layout));
21439
22169
  delete updated_layout_without_absolute_elements["absolute_position_children"];
21440
- element = _this.HjRo(updated_layout_without_absolute_elements);
22170
+ element = _this.xyYY(updated_layout_without_absolute_elements);
21441
22171
  document.body.style.backgroundColor = current_slide_from_config.media_background_color;
21442
22172
  document.body.style.margin = "0px";
21443
22173
  }
@@ -21445,9 +22175,9 @@
21445
22175
  current_slide.removeChild(current_slide.children[0]);
21446
22176
  }
21447
22177
  current_slide.appendChild(element);
21448
- _this.Jwju();
22178
+ _this.nJlx();
21449
22179
  window.intervalToCheckImgStatus = setInterval(function () {
21450
- if (_this.rnGL()) {
22180
+ if (_this.ZjRm()) {
21451
22181
  clearInterval(window.intervalToCheckImgStatus);
21452
22182
  }
21453
22183
  }, 500);
@@ -21475,7 +22205,7 @@
21475
22205
  });
21476
22206
  playNext();
21477
22207
  });
21478
- _defineProperty(this, "Voll", function () {
22208
+ _defineProperty(this, "sAkH", function () {
21479
22209
  document.body.classList.add("slide-right");
21480
22210
  var animationEndCounter = 0;
21481
22211
  var onAnimationEnd = function onAnimationEnd() {
@@ -21487,7 +22217,7 @@
21487
22217
  };
21488
22218
  document.body.addEventListener("animationend", onAnimationEnd);
21489
22219
  });
21490
- _defineProperty(this, "HjRo", function (config) {
22220
+ _defineProperty(this, "xyYY", function (config) {
21491
22221
  var _window$Apxor3;
21492
22222
  var element;
21493
22223
  var startY;
@@ -21543,7 +22273,7 @@
21543
22273
  element.innerHTML = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 25 25\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12.375 4L10.1979 6.17708L7.92708 9.20833H3V15.4583H7.16667L12.375 20.6667V4Z\" fill=\"currentColor\" />\n <path d=\"M14.4905 20.2167C18.9193 20.2167 22.5095 16.6265 22.5095 12.1977C22.5095 7.76894 18.9193 4.17871 14.4905 4.17871\" stroke=\"currentColor\" fill =\"transparent\" stroke-width=\"1.782\"/>\n <path d=\"M14.4905 15.7618C16.4588 15.7618 18.0545 14.1661 18.0545 12.1978C18.0545 10.2294 16.4588 8.63379 14.4905 8.63379\" stroke=\"currentColor\" fill=\"transparent\" stroke-width=\"1.782\"/>\n </svg>";
21544
22274
  element.id = "apx-mute-icon";
21545
22275
  element.addEventListener("touchstart", function (event) {
21546
- _this.CfIa(event);
22276
+ _this.FgHM(event);
21547
22277
  });
21548
22278
  break;
21549
22279
  case "copy_icon":
@@ -21737,7 +22467,7 @@
21737
22467
  }
21738
22468
  if (config.absolute_position_children && config.absolute_position_children.length > 0) {
21739
22469
  config.absolute_position_children.forEach(function (childConfig) {
21740
- var childElement = _this.HjRo(childConfig);
22470
+ var childElement = _this.xyYY(childConfig);
21741
22471
  element.appendChild(childElement);
21742
22472
  });
21743
22473
  }
@@ -21745,7 +22475,7 @@
21745
22475
  // Process children
21746
22476
  if (config.children && config.children.length > 0) {
21747
22477
  config.children.forEach(function (childConfig) {
21748
- var childElement = _this.HjRo(childConfig);
22478
+ var childElement = _this.xyYY(childConfig);
21749
22479
  element.appendChild(childElement);
21750
22480
  });
21751
22481
  }
@@ -21772,7 +22502,7 @@
21772
22502
  }
21773
22503
  return element;
21774
22504
  });
21775
- _defineProperty(this, "CfIa", function (event) {
22505
+ _defineProperty(this, "FgHM", function (event) {
21776
22506
  var slide_details_to_be_deleted;
21777
22507
  var mute_child_elements;
21778
22508
  var unmute_child_elements;
@@ -21802,11 +22532,11 @@
21802
22532
  }
21803
22533
  // this.muteElement.addEventListener("touchstart", (event) => {
21804
22534
  // event.stopPropagation();
21805
- // this.CfIa(event);
22535
+ // this.FgHM(event);
21806
22536
  // });
21807
22537
  }
21808
22538
  });
21809
- _defineProperty(this, "yUQd", function () {
22539
+ _defineProperty(this, "LYqv", function () {
21810
22540
  var tapTimeout;
21811
22541
  var tapThreshold = 0.5; // Assuming 0.5 is the center of the WebView
21812
22542
  var longPressDuration = 200;
@@ -21930,7 +22660,7 @@
21930
22660
  event.target.dataset.touchStartTime = event.timeStamp;
21931
22661
  });
21932
22662
  });
21933
- _defineProperty(this, "UhcC", function () {
22663
+ _defineProperty(this, "eceU", function () {
21934
22664
  var startY, startX;
21935
22665
  _this.storyContainer.addEventListener("touchstart", function (event) {
21936
22666
  _this.swipeTouch = true;
@@ -22137,7 +22867,7 @@
22137
22867
  }, 50);
22138
22868
  });
22139
22869
  });
22140
- _defineProperty(this, "Jwju", function () {
22870
+ _defineProperty(this, "nJlx", function () {
22141
22871
  _this.loader.style.display = "block";
22142
22872
  var progress = Array.from(document.querySelectorAll(".progress"));
22143
22873
  var activeIndex = progress.findIndex(function (el) {
@@ -22153,7 +22883,7 @@
22153
22883
  }
22154
22884
  }
22155
22885
  });
22156
- _defineProperty(this, "vCTl", function () {
22886
+ _defineProperty(this, "XedP", function () {
22157
22887
  if (!_this.continueLoading) {
22158
22888
  var slide_details_to_be_deleted = document.querySelector(".slide-details");
22159
22889
  var childElements = slide_details_to_be_deleted.querySelectorAll("video");
@@ -22173,19 +22903,19 @@
22173
22903
  _this.loader.style.display = "none";
22174
22904
  }
22175
22905
  });
22176
- _defineProperty(this, "DZYh", function () {
22906
+ _defineProperty(this, "FgHb", function () {
22177
22907
  if (_this.imageElements.length === 0) return true;
22178
22908
  return _this.imageElements.every(function (img) {
22179
22909
  return img.complete;
22180
22910
  });
22181
22911
  });
22182
- _defineProperty(this, "PXQj", function () {
22912
+ _defineProperty(this, "uDuu", function () {
22183
22913
  if (_this.videoElements.length === 0) return true;
22184
22914
  return _this.videoElements.every(function (video) {
22185
22915
  return video.readyState >= 3;
22186
22916
  });
22187
22917
  });
22188
- _defineProperty(this, "rnGL", function () {
22918
+ _defineProperty(this, "ZjRm", function () {
22189
22919
  var bodyStyles = window.getComputedStyle(document.body);
22190
22920
  var backgroundImage = bodyStyles.backgroundImage;
22191
22921
  if (backgroundImage && backgroundImage !== "none" && _this.current_slide_config.media_type === "image") {
@@ -22195,7 +22925,7 @@
22195
22925
  var img = new Image();
22196
22926
  img.src = imageUrl;
22197
22927
  if (img.complete) {
22198
- _this.vCTl();
22928
+ _this.XedP();
22199
22929
  return true;
22200
22930
  }
22201
22931
  return false;
@@ -22203,21 +22933,21 @@
22203
22933
  var slide_details_to_be_deleted = document.querySelector(".slide-details");
22204
22934
  var childElements = slide_details_to_be_deleted.querySelectorAll("video");
22205
22935
  if (childElements[0].readyState >= 3) {
22206
- _this.vCTl();
22936
+ _this.XedP();
22207
22937
  return true;
22208
22938
  }
22209
22939
  return false;
22210
22940
  } else {
22211
22941
  if (_this.videoElements.length == 0 && _this.imageElements.length == 0) {
22212
- _this.vCTl();
22942
+ _this.XedP();
22213
22943
  return true;
22214
- } else if (_this.DZYh() && _this.PXQj()) {
22215
- _this.vCTl();
22944
+ } else if (_this.FgHb() && _this.uDuu()) {
22945
+ _this.XedP();
22216
22946
  return true;
22217
22947
  }
22218
22948
  }
22219
22949
  });
22220
- _defineProperty(this, "tBkX", function (event, startY, action) {
22950
+ _defineProperty(this, "Bosj", function (event, startY, action) {
22221
22951
  event.stopPropagation();
22222
22952
  var endY = event.changedTouches[0].clientY;
22223
22953
  var deltaY = startY - endY;
@@ -22305,7 +23035,7 @@
22305
23035
  this.swipe_action;
22306
23036
  this.continueLoading = false;
22307
23037
  this.boundSwipeUpHandling = function (event) {
22308
- return _this.tBkX(event, _this.startY, _this.swipe_action);
23038
+ return _this.Bosj(event, _this.startY, _this.swipe_action);
22309
23039
  };
22310
23040
  }
22311
23041
  _createClass(Stories, [{
@@ -22368,7 +23098,7 @@
22368
23098
  } else {
22369
23099
  var _progress$activeIndex5, _progress$activeIndex6, _progress$, _window12, _window12$logInternal, _window$ApxorRTM16, _window$ApxorRTM17, _window$ApxorRTM18;
22370
23100
  // Move to the first slide of the next group
22371
- // this.Voll();
23101
+ // this.sAkH();
22372
23102
  this.position++;
22373
23103
  this.progress_bar = new ProgressBar$1(this.config[this.position].progress_bar);
22374
23104
  this.slides = this.config[this.position].slides;
@@ -22494,7 +23224,7 @@
22494
23224
  if (activeIndex === 0) {
22495
23225
  var _progress$activeIndex9, _progress$activeIndex10, _progress$lastSlideIn, _window14, _window14$logInternal, _window$ApxorRTM22, _window$ApxorRTM23, _window$ApxorRTM24;
22496
23226
  // If at the first slide of the current group, move to the last slide of the previous group
22497
- // this.Voll();
23227
+ // this.sAkH();
22498
23228
  this.position--;
22499
23229
  this.progress_bar = new ProgressBar$1(this.config[this.position].progress_bar);
22500
23230
  this.slides = this.config[this.position].slides;
@@ -22683,25 +23413,25 @@
22683
23413
  // Create custom content
22684
23414
  var updated_layout_without_absolute_elements = JSON.parse(JSON.stringify(current_slide_from_config.layout));
22685
23415
  delete updated_layout_without_absolute_elements["absolute_position_children"];
22686
- element = this.HjRo(updated_layout_without_absolute_elements);
23416
+ element = this.xyYY(updated_layout_without_absolute_elements);
22687
23417
  }
22688
23418
  // Append slide content to slide details container
22689
23419
 
22690
23420
  document.body.style.backgroundColor = current_slide_from_config.media_background_color;
22691
23421
  document.body.style.margin = "0px";
22692
23422
  currentSlideDetails.appendChild(element);
22693
- this.Jwju();
23423
+ this.nJlx();
22694
23424
 
22695
23425
  // Handle absolute position children
22696
23426
  if (current_slide_from_config.layout.absolute_position_children && current_slide_from_config.layout.absolute_position_children.length > 0) {
22697
23427
  current_slide_from_config.layout.absolute_position_children.forEach(function (childConfig) {
22698
- var childElement = _this2.HjRo(childConfig);
23428
+ var childElement = _this2.xyYY(childConfig);
22699
23429
  // Append absolute position children to slide details container
22700
23430
  currentSlideDetails.appendChild(childElement);
22701
23431
  });
22702
23432
  }
22703
23433
  window.intervalToCheckImgStatus2 = setInterval(function () {
22704
- if (_this2.rnGL()) {
23434
+ if (_this2.ZjRm()) {
22705
23435
  clearInterval(window.intervalToCheckImgStatus2);
22706
23436
  }
22707
23437
  }, 500);
@@ -22748,16 +23478,16 @@
22748
23478
  var RTM = /*#__PURE__*/_createClass(function RTM() {
22749
23479
  var _this = this;
22750
23480
  _classCallCheck(this, RTM);
22751
- _defineProperty(this, "RxKq", {});
23481
+ _defineProperty(this, "oVRS", {});
22752
23482
  _defineProperty(this, "isShowingAction", false);
22753
23483
  _defineProperty(this, "currentAction", null);
22754
- _defineProperty(this, "sOOz", null);
22755
- _defineProperty(this, "version", 71);
23484
+ _defineProperty(this, "veMk", null);
23485
+ _defineProperty(this, "version", 81);
22756
23486
  _defineProperty(this, "isInitialised", false);
22757
- _defineProperty(this, "jkaK", {});
22758
- _defineProperty(this, "pNeK", false);
23487
+ _defineProperty(this, "rnKR", {});
23488
+ _defineProperty(this, "AYSV", false);
22759
23489
  _defineProperty(this, "_isShownECCalled", false);
22760
- _defineProperty(this, "BYKy", function () {
23490
+ _defineProperty(this, "qqxH", function () {
22761
23491
  _this.isInitialised = true;
22762
23492
  var oldPushState = history.pushState;
22763
23493
  history.pushState = function pushState() {
@@ -22782,7 +23512,7 @@
22782
23512
  });
22783
23513
  _defineProperty(this, "show", function (uiJson, duration, uuid, name) {
22784
23514
  if (!_this.isInitialised) {
22785
- _this.BYKy();
23515
+ _this.qqxH();
22786
23516
  }
22787
23517
  window.addEventListener("pagehide", function () {
22788
23518
  var _window$Apxor, _window$Apxor$pageUnl;
@@ -22809,7 +23539,7 @@
22809
23539
  } else if (ui_config.display_type === "new-inline" || ui_config.action_class === "tooltip_builder") {
22810
23540
  _this.createInLineToolTip(ui_config, duration, uuid, name, ui_config.action_class === "tooltip_builder" ? "tooltip_builder" : "new-inline");
22811
23541
  } else if (ui_config.display_type === "coach_mark_v2") {
22812
- _this.iGMR(ui_config, duration, uuid, name);
23542
+ _this.rJlm(ui_config, duration, uuid, name);
22813
23543
  } else {
22814
23544
  showCoachmarkWithDelay(_this, ui_config, {
22815
23545
  configId: uuid,
@@ -22882,7 +23612,7 @@
22882
23612
  (_window$ApxorRTM = window.ApxorRTM) === null || _window$ApxorRTM === void 0 || _window$ApxorRTM.logEvent("apx_nudge_not_shown", {
22883
23613
  campaignName: name,
22884
23614
  id: configId,
22885
- apx_nudge_type: "sticky_card",
23615
+ apx_template_name: "embed-card",
22886
23616
  apx_notshown_type: "error",
22887
23617
  apx_reason: "".concat(e === null || e === void 0 ? void 0 : e.name, " ").concat(e === null || e === void 0 ? void 0 : e.message)
22888
23618
  });
@@ -22897,7 +23627,7 @@
22897
23627
  (config === null || config === void 0 ? void 0 : config.initialRender) && ((_window$ApxorRTM2 = window.ApxorRTM) === null || _window$ApxorRTM2 === void 0 ? void 0 : _window$ApxorRTM2.logEvent("apx_nudge_shown", {
22898
23628
  campaignName: name,
22899
23629
  id: configId,
22900
- apx_nudge_type: "sticky_card"
23630
+ apx_template_name: "embed-card"
22901
23631
  }));
22902
23632
  _this._isShownECCalled = true;
22903
23633
  }, function () {
@@ -22910,7 +23640,7 @@
22910
23640
  try {
22911
23641
  config = config.split("\n").join("\\n");
22912
23642
  var ui_config = JSON.parse(config);
22913
- _this.jQXU(ui_config, configId, name, position, slidesSeenCount, view_id);
23643
+ _this.pkOH(ui_config, configId, name, position, slidesSeenCount, view_id);
22914
23644
  } catch (e) {
22915
23645
  var _window$Apxor3;
22916
23646
  if (((_window$Apxor3 = window.Apxor) === null || _window$Apxor3 === void 0 ? void 0 : _window$Apxor3.platform) === "ios") {
@@ -22924,12 +23654,12 @@
22924
23654
  console.error(e);
22925
23655
  }
22926
23656
  });
22927
- _defineProperty(this, "jQXU", function (config, configId, name, position, slidesSeenCount, view_id) {
23657
+ _defineProperty(this, "pkOH", function (config, configId, name, position, slidesSeenCount, view_id) {
22928
23658
  var cardsContainer = new Stories(config, configId, name, position, slidesSeenCount, view_id, function () {
22929
23659
  window.Apxor.logAppEvent("apx_nudge_shown", {
22930
23660
  campaignName: name,
22931
23661
  id: configId,
22932
- apx_nudge_type: "stories"
23662
+ apx_template_name: "stories"
22933
23663
  });
22934
23664
  }, function () {});
22935
23665
  cardsContainer.showStories();
@@ -22972,7 +23702,7 @@
22972
23702
  var _window22, _window22$updateFlag, _window23;
22973
23703
  _this.isShowingAction = false;
22974
23704
  _this.currentAction = null;
22975
- _this.sOOz = null;
23705
+ _this.veMk = null;
22976
23706
  (_window22 = window) === null || _window22 === void 0 || (_window22 = _window22.Apxor) === null || _window22 === void 0 || (_window22$updateFlag = _window22.updateFlag) === null || _window22$updateFlag === void 0 || _window22$updateFlag.call(_window22, false);
22977
23707
  if (window.Apxor && window.Apxor.logActionEvent && !isCancelled) {
22978
23708
  window.Apxor.logActionEvent("inline_dismissed", uuid, name);
@@ -22983,21 +23713,21 @@
22983
23713
  }
22984
23714
  };
22985
23715
  if (action_class === "new-inline") {
22986
- _this.sOOz = new InLineTooltip(ui_config, [], [], terminationConfig, {
23716
+ _this.veMk = new InLineTooltip(ui_config, [], [], terminationConfig, {
22987
23717
  configId: uuid,
22988
23718
  configName: name
22989
23719
  }, _this, onShow, onHide, function () {}, false, 0);
22990
23720
  } else if (action_class === "tooltip_builder") {
22991
- _this.sOOz = new NewInLineTooltip(ui_config, terminationConfig, {
23721
+ _this.veMk = new NewInLineTooltip(ui_config, terminationConfig, {
22992
23722
  configId: uuid,
22993
23723
  configName: name
22994
23724
  }, _this, onShow, onHide);
22995
23725
  }
22996
23726
  setTimeout(function () {
22997
- _this.sOOz.createNewTooltip();
23727
+ _this.veMk.createNewTooltip();
22998
23728
  }, ui_config.delay);
22999
23729
  });
23000
- _defineProperty(this, "iGMR", function (ui_config, duration, uuid, name) {
23730
+ _defineProperty(this, "rJlm", function (ui_config, duration, uuid, name) {
23001
23731
  var terminationConfig = {};
23002
23732
  terminationConfig["auto_dismiss"] = duration > 0;
23003
23733
  terminationConfig["duration"] = duration;
@@ -23021,7 +23751,7 @@
23021
23751
  var _window27, _window27$updateFlag, _window28;
23022
23752
  _this.isShowingAction = false;
23023
23753
  _this.currentAction = null;
23024
- _this.sOOz = null;
23754
+ _this.veMk = null;
23025
23755
  (_window27 = window) === null || _window27 === void 0 || (_window27 = _window27.Apxor) === null || _window27 === void 0 || (_window27$updateFlag = _window27.updateFlag) === null || _window27$updateFlag === void 0 || _window27$updateFlag.call(_window27, false);
23026
23756
  if (window.Apxor && window.Apxor.logActionEvent && !isCancelled) {
23027
23757
  window.Apxor.logActionEvent("inline_dismissed", uuid, name);
@@ -23034,8 +23764,8 @@
23034
23764
  _this._currentCoachmark.createNewCoachMark();
23035
23765
  });
23036
23766
  _defineProperty(this, "updateElementPositionOnScroll", function (top, left, height, width) {
23037
- if (_this.sOOz) {
23038
- _this.sOOz.updateElementPositionOnScroll(top, left, height, width);
23767
+ if (_this.veMk) {
23768
+ _this.veMk.updateElementPositionOnScroll(top, left, height, width);
23039
23769
  }
23040
23770
  });
23041
23771
  _defineProperty(this, "createInAppVideo", function (config, duration, configId, name) {
@@ -23084,24 +23814,35 @@
23084
23814
  terminationConfig["duration"] = duration;
23085
23815
  var inappModal = null;
23086
23816
  var onShow = function onShow() {
23817
+ var _window$Apxor4;
23087
23818
  _this.isShowingAction = true;
23088
- if (window.Apxor && window.Apxor.logActionEvent) {
23089
- var _window$Apxor4;
23090
- if (((_window$Apxor4 = window.Apxor) === null || _window$Apxor4 === void 0 ? void 0 : _window$Apxor4.platform) === "ios") {
23091
- var _window32, _window32$updateFlag;
23092
- (_window32 = window) === null || _window32 === void 0 || (_window32 = _window32.Apxor) === null || _window32 === void 0 || (_window32$updateFlag = _window32.updateFlag) === null || _window32$updateFlag === void 0 || _window32$updateFlag.call(_window32, true, "IN_APP");
23093
- } else {
23094
- var _window33, _window33$updateFlag;
23095
- (_window33 = window) === null || _window33 === void 0 || (_window33 = _window33.Apxor) === null || _window33 === void 0 || (_window33$updateFlag = _window33.updateFlag) === null || _window33$updateFlag === void 0 || _window33$updateFlag.call(_window33, "IN_APP", true);
23096
- }
23819
+ if (((_window$Apxor4 = window.Apxor) === null || _window$Apxor4 === void 0 ? void 0 : _window$Apxor4.platform) === "ios") {
23820
+ var _window32, _window32$updateFlag;
23821
+ (_window32 = window) === null || _window32 === void 0 || (_window32 = _window32.Apxor) === null || _window32 === void 0 || (_window32$updateFlag = _window32.updateFlag) === null || _window32$updateFlag === void 0 || _window32$updateFlag.call(_window32, true, "IN_APP");
23822
+ } else {
23823
+ var _window33, _window33$updateFlag;
23824
+ (_window33 = window) === null || _window33 === void 0 || (_window33 = _window33.Apxor) === null || _window33 === void 0 || (_window33$updateFlag = _window33.updateFlag) === null || _window33$updateFlag === void 0 || _window33$updateFlag.call(_window33, "IN_APP", true);
23825
+ }
23826
+ if (action_class === "modal" && window.Apxor && window.Apxor.logActionEvent) {
23097
23827
  window.Apxor.logActionEvent("inapp_shown", configId, name);
23828
+ } else if (action_class === "inapp_builder") {
23829
+ var _window$ApxorRTM3, _window$Apxor5, _config$additional_in, _window$Apxor6, _config$additional_in2, _config$additional_in3, _config$additional_in4, _config$additional_in5, _config$additional_in6, _config$additional_in7;
23830
+ (_window$ApxorRTM3 = window.ApxorRTM) === null || _window$ApxorRTM3 === void 0 || _window$ApxorRTM3.logEvent("apx_nudge_shown", {
23831
+ apx_nudge_name: name,
23832
+ apx_nudge_id: ((_window$Apxor5 = window.Apxor) === null || _window$Apxor5 === void 0 ? void 0 : _window$Apxor5.platform) === "ios" ? config === null || config === void 0 || (_config$additional_in = config.additional_info) === null || _config$additional_in === void 0 ? void 0 : _config$additional_in.id : configId,
23833
+ apx_template_name: "inapp",
23834
+ apx_step: ((_window$Apxor6 = window.Apxor) === null || _window$Apxor6 === void 0 ? void 0 : _window$Apxor6.platform) === "ios" ? config !== null && config !== void 0 && (_config$additional_in2 = config.additional_info) !== null && _config$additional_in2 !== void 0 && _config$additional_in2.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in3 = config.additional_info) === null || _config$additional_in3 === void 0 ? void 0 : _config$additional_in3.apx_step : config !== null && config !== void 0 && (_config$additional_in4 = config.additional_info) !== null && _config$additional_in4 !== void 0 && _config$additional_in4.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in5 = config.additional_info) === null || _config$additional_in5 === void 0 ? void 0 : _config$additional_in5.apx_step,
23835
+ apx_screen_name: config === null || config === void 0 || (_config$additional_in6 = config.additional_info) === null || _config$additional_in6 === void 0 ? void 0 : _config$additional_in6.apx_screen_name,
23836
+ apx_variant_code: config === null || config === void 0 || (_config$additional_in7 = config.additional_info) === null || _config$additional_in7 === void 0 ? void 0 : _config$additional_in7.apx_variant_code
23837
+ });
23098
23838
  }
23099
23839
  };
23100
23840
  var onHide = function onHide(backgroundDiv, action) {
23101
- var _dialogContent$classL, _window$Apxor5;
23102
- var cssClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ".apx-dlg-c";
23103
- var closeListener = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
23104
- var redirectionListener = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
23841
+ var _dialogContent$classL, _window$Apxor7;
23842
+ var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
23843
+ var cssClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ".apx-dlg-c";
23844
+ var closeListener = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
23845
+ var redirectionListener = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
23105
23846
  document.body.removeEventListener("click", closeListener);
23106
23847
  document.body.removeEventListener("click", redirectionListener);
23107
23848
  var dialogContent = document.querySelector(cssClass);
@@ -23109,7 +23850,7 @@
23109
23850
  // setTimeout(() => {
23110
23851
  backgroundDiv.remove();
23111
23852
  _this.isShowingAction = false;
23112
- if (((_window$Apxor5 = window.Apxor) === null || _window$Apxor5 === void 0 ? void 0 : _window$Apxor5.platform) === "ios") {
23853
+ if (((_window$Apxor7 = window.Apxor) === null || _window$Apxor7 === void 0 ? void 0 : _window$Apxor7.platform) === "ios") {
23113
23854
  var _window34, _window34$updateFlag;
23114
23855
  (_window34 = window) === null || _window34 === void 0 || (_window34 = _window34.Apxor) === null || _window34 === void 0 || (_window34$updateFlag = _window34.updateFlag) === null || _window34$updateFlag === void 0 || _window34$updateFlag.call(_window34, false, "IN_APP");
23115
23856
  } else {
@@ -23117,23 +23858,54 @@
23117
23858
  (_window35 = window) === null || _window35 === void 0 || (_window35 = _window35.Apxor) === null || _window35 === void 0 || (_window35$updateFlag = _window35.updateFlag) === null || _window35$updateFlag === void 0 || _window35$updateFlag.call(_window35, "IN_APP", false);
23118
23859
  }
23119
23860
  _this.currentAction = null;
23120
- if (window.Apxor && window.Apxor.logActionEvent && !(action == "cancel" || action == "redirect")) {
23861
+ if (action_class === "modal" && window.Apxor && window.Apxor.logActionEvent && !(action == "cancel" || action == "redirect")) {
23121
23862
  window.Apxor.logActionEvent("inapp_dismissed", configId, name);
23863
+ } else if (action_class === "inapp_builder") {
23864
+ var _window36;
23865
+ if (!(action == "cancel" || action == "never")) {
23866
+ var _window$Apxor8, _config$additional_in8, _config$additional_in9, _window$Apxor9, _config$additional_in10, _config$additional_in11, _config$additional_in12, _config$additional_in13, _window$ApxorRTM4;
23867
+ var additional_info = {
23868
+ apx_nudge_name: name,
23869
+ apx_nudge_id: ((_window$Apxor8 = window.Apxor) === null || _window$Apxor8 === void 0 ? void 0 : _window$Apxor8.platform) === "ios" ? config === null || config === void 0 || (_config$additional_in8 = config.additional_info) === null || _config$additional_in8 === void 0 ? void 0 : _config$additional_in8.id : configId,
23870
+ apx_template_name: "inapp",
23871
+ apx_variant_code: config === null || config === void 0 || (_config$additional_in9 = config.additional_info) === null || _config$additional_in9 === void 0 ? void 0 : _config$additional_in9.apx_variant_code,
23872
+ apx_step: ((_window$Apxor9 = window.Apxor) === null || _window$Apxor9 === void 0 ? void 0 : _window$Apxor9.platform) === "ios" ? config !== null && config !== void 0 && (_config$additional_in10 = config.additional_info) !== null && _config$additional_in10 !== void 0 && _config$additional_in10.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in11 = config.additional_info) === null || _config$additional_in11 === void 0 ? void 0 : _config$additional_in11.apx_step : config !== null && config !== void 0 && (_config$additional_in12 = config.additional_info) !== null && _config$additional_in12 !== void 0 && _config$additional_in12.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in13 = config.additional_info) === null || _config$additional_in13 === void 0 ? void 0 : _config$additional_in13.apx_step
23873
+ };
23874
+ if (type != "") {
23875
+ additional_info["apx_dismiss_type"] = type;
23876
+ }
23877
+ (_window$ApxorRTM4 = window.ApxorRTM) === null || _window$ApxorRTM4 === void 0 || _window$ApxorRTM4.logEvent("apx_nudge_dismissed", additional_info);
23878
+ }
23879
+ if (action === "cancel") {
23880
+ var _window$Apxor10, _config$additional_in14, _config$additional_in15, _window$Apxor11, _config$additional_in16, _config$additional_in17, _config$additional_in18, _config$additional_in19, _window$ApxorRTM5;
23881
+ var _additional_info = {
23882
+ apx_nudge_name: name,
23883
+ apx_nudge_id: ((_window$Apxor10 = window.Apxor) === null || _window$Apxor10 === void 0 ? void 0 : _window$Apxor10.platform) === "ios" ? config === null || config === void 0 || (_config$additional_in14 = config.additional_info) === null || _config$additional_in14 === void 0 ? void 0 : _config$additional_in14.id : configId,
23884
+ apx_template_name: "inapp",
23885
+ apx_variant_code: config === null || config === void 0 || (_config$additional_in15 = config.additional_info) === null || _config$additional_in15 === void 0 ? void 0 : _config$additional_in15.apx_variant_code,
23886
+ apx_step: ((_window$Apxor11 = window.Apxor) === null || _window$Apxor11 === void 0 ? void 0 : _window$Apxor11.platform) === "ios" ? config !== null && config !== void 0 && (_config$additional_in16 = config.additional_info) !== null && _config$additional_in16 !== void 0 && _config$additional_in16.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in17 = config.additional_info) === null || _config$additional_in17 === void 0 ? void 0 : _config$additional_in17.apx_step : config !== null && config !== void 0 && (_config$additional_in18 = config.additional_info) !== null && _config$additional_in18 !== void 0 && _config$additional_in18.is_preview ? 1 : config === null || config === void 0 || (_config$additional_in19 = config.additional_info) === null || _config$additional_in19 === void 0 ? void 0 : _config$additional_in19.apx_step
23887
+ };
23888
+ (_window$ApxorRTM5 = window.ApxorRTM) === null || _window$ApxorRTM5 === void 0 || _window$ApxorRTM5.logEvent("apx_nudge_cancelled", _additional_info);
23889
+ }
23890
+ (_window36 = window) === null || _window36 === void 0 || (_window36 = _window36.ApxorInternals) === null || _window36 === void 0 || _window36.removeBuilderTemplate(configId);
23122
23891
  }
23123
23892
  };
23124
23893
  if (action_class === "modal") {
23125
23894
  inappModal = new ModalInApp(config, terminationConfig, configId, name, onShow, onHide, function () {}, false, [], 0);
23895
+ inappModal.createInAppModal();
23126
23896
  } else if (action_class === "inapp_builder") {
23127
23897
  inappModal = new NewModalInApp(config, terminationConfig, configId, name, onShow, onHide);
23898
+ setTimeout(function () {
23899
+ inappModal.createInAppModal();
23900
+ }, config === null || config === void 0 ? void 0 : config.delay);
23128
23901
  }
23129
- inappModal.createInAppModal();
23130
23902
  });
23131
23903
  _defineProperty(this, "showPlaceHolder", function () {
23132
- var _window36;
23133
- if (_this.pNeK) {
23904
+ var _window37;
23905
+ if (_this.AYSV) {
23134
23906
  return;
23135
23907
  }
23136
- _this.pNeK = true;
23908
+ _this.AYSV = true;
23137
23909
  var ele = document.createElement("div");
23138
23910
  ele.innerHTML = "place your immersive card here";
23139
23911
  ele.style.backgroundColor = "#f5f5f5";
@@ -23143,7 +23915,7 @@
23143
23915
  ele.style.padding = "12px";
23144
23916
  ele.style.fontSize = "14px";
23145
23917
  document.body.appendChild(ele);
23146
- (_window36 = window) === null || _window36 === void 0 || (_window36 = _window36.ApxorWidget) === null || _window36 === void 0 || _window36.setDimensions(window.document.querySelector("html").offsetWidth, window.document.querySelector("html").offsetHeight);
23918
+ (_window37 = window) === null || _window37 === void 0 || (_window37 = _window37.ApxorWidget) === null || _window37 === void 0 || _window37.setDimensions(window.document.querySelector("html").offsetWidth, window.document.querySelector("html").offsetHeight);
23147
23919
  });
23148
23920
  _defineProperty(this, "pauseStories", function () {
23149
23921
  var progress = Array.from(document.querySelectorAll(".progress"));
@@ -23182,8 +23954,8 @@
23182
23954
  // survey_obj.createSurvey();
23183
23955
  // };
23184
23956
  _defineProperty(this, "logEvent", function (name, additional_info) {
23185
- var _window$Apxor6;
23186
- if (((_window$Apxor6 = window.Apxor) === null || _window$Apxor6 === void 0 ? void 0 : _window$Apxor6.platform) === "ios") {
23957
+ var _window$Apxor12;
23958
+ if (((_window$Apxor12 = window.Apxor) === null || _window$Apxor12 === void 0 ? void 0 : _window$Apxor12.platform) === "ios") {
23187
23959
  window.Apxor.logAppEvent(name, additional_info);
23188
23960
  } else {
23189
23961
  window.Apxor.logAppEvent(name, JSON.stringify(additional_info));