@searchcraft/javascript-sdk 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/components/bundled.types.d.ts +38 -2
  2. package/dist/components/index.js +6 -6
  3. package/dist/components/{p-fee8c484.js → p-19fe91f1.js} +2 -2
  4. package/dist/components/{p-fee8c484.js.map → p-19fe91f1.js.map} +1 -1
  5. package/dist/components/{p-c3cc2fc3.js → p-4df578e4.js} +2 -2
  6. package/dist/components/{p-c3cc2fc3.js.map → p-4df578e4.js.map} +1 -1
  7. package/dist/components/{p-39be2b10.js → p-580c09dc.js} +264 -237
  8. package/dist/components/p-580c09dc.js.map +1 -0
  9. package/dist/components/{p-70f5d28f.js → p-5fdaf1e6.js} +60 -15
  10. package/dist/components/p-5fdaf1e6.js.map +1 -0
  11. package/dist/components/{p-52edbc31.js → p-60f05735.js} +11 -11
  12. package/dist/components/p-60f05735.js.map +1 -0
  13. package/dist/components/{p-8a4f8203.js → p-8f854dec.js} +2 -2
  14. package/dist/components/{p-8a4f8203.js.map → p-8f854dec.js.map} +1 -1
  15. package/dist/components/{p-ffb05b5b.js → p-e27a0dab.js} +2 -2
  16. package/dist/components/{p-ffb05b5b.js.map → p-e27a0dab.js.map} +1 -1
  17. package/dist/components/{p-d3351811.js → p-e41b0f43.js} +2 -2
  18. package/dist/components/{p-d3351811.js.map → p-e41b0f43.js.map} +1 -1
  19. package/dist/components/searchcraft-ad.js +1 -1
  20. package/dist/components/searchcraft-base-search-result.js +1 -1
  21. package/dist/components/searchcraft-base-search-results.js +12 -12
  22. package/dist/components/searchcraft-base-search-results.js.map +1 -1
  23. package/dist/components/searchcraft-facet-list.js +1 -1
  24. package/dist/components/searchcraft-filter-panel.js +3 -3
  25. package/dist/components/searchcraft-input-form.js +1 -1
  26. package/dist/components/searchcraft-pagination.js +3 -3
  27. package/dist/components/searchcraft-pagination.js.map +1 -1
  28. package/dist/components/searchcraft-popover-button.js +1 -1
  29. package/dist/components/searchcraft-popover-form.js +5 -5
  30. package/dist/components/searchcraft-popover-list-item.js +1 -1
  31. package/dist/components/searchcraft-popover-list-view.js +1 -1
  32. package/dist/components/searchcraft-results-info.js +1 -1
  33. package/dist/components/searchcraft-search-results-per-page.js +1 -1
  34. package/dist/components/searchcraft-theme.js +1 -1
  35. package/dist/components/searchcraft-theme.js.map +1 -1
  36. package/dist/components/searchcraft-toggle-button.js +1 -1
  37. package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +9 -3
  38. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +1 -1
  39. package/dist/types/components.d.ts +2 -0
  40. package/package.json +4 -4
  41. package/dist/components/p-39be2b10.js.map +0 -1
  42. package/dist/components/p-52edbc31.js.map +0 -1
  43. package/dist/components/p-70f5d28f.js.map +0 -1
@@ -1,15 +1,15 @@
1
- var L = Object.defineProperty;
2
- var q = (n, e, r) => e in n ? L(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r;
3
- var h = (n, e, r) => q(n, typeof e != "symbol" ? e + "" : e, r);
4
- var P = /* @__PURE__ */ ((n) => (n[n.DEBUG = 0] = "DEBUG", n[n.INFO = 1] = "INFO", n[n.WARN = 2] = "WARN", n[n.ERROR = 3] = "ERROR", n))(P || {});
5
- class pe {
1
+ var B = Object.defineProperty;
2
+ var q = (r, e, n) => e in r ? B(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var h = (r, e, n) => q(r, typeof e != "symbol" ? e + "" : e, n);
4
+ var P = /* @__PURE__ */ ((r) => (r[r.DEBUG = 0] = "DEBUG", r[r.INFO = 1] = "INFO", r[r.WARN = 2] = "WARN", r[r.ERROR = 3] = "ERROR", r))(P || {});
5
+ class ge {
6
6
  constructor(e) {
7
7
  h(this, "logLevel");
8
8
  h(this, "logFormatter");
9
9
  this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
10
10
  }
11
- defaultFormatter(e, r) {
12
- return `[${P[e]}] ${( new Date()).toISOString()}: ${r}`;
11
+ defaultFormatter(e, n) {
12
+ return `[${P[e]}] ${( new Date()).toISOString()}: ${n}`;
13
13
  }
14
14
  debug(e) {
15
15
  this.logLevel <= 0 && console.log(this.logFormatter(0, e));
@@ -23,25 +23,25 @@ class pe {
23
23
  error(e) {
24
24
  this.logLevel <= 3 && console.error(this.logFormatter(3, e));
25
25
  }
26
- log(e, r) {
26
+ log(e, n) {
27
27
  switch (e) {
28
28
  case 0:
29
- this.debug(r);
29
+ this.debug(n);
30
30
  break;
31
31
  case 1:
32
- this.info(r);
32
+ this.info(n);
33
33
  break;
34
34
  case 2:
35
- this.warn(r);
35
+ this.warn(n);
36
36
  break;
37
37
  case 3:
38
- this.error(r);
38
+ this.error(n);
39
39
  break;
40
40
  }
41
41
  }
42
42
  }
43
- function w(n, e, r, o) {
44
- return new (r || (r = Promise))(function(i, a) {
43
+ function w(r, e, n, o) {
44
+ return new (n || (n = Promise))(function(i, a) {
45
45
  function t(c) {
46
46
  try {
47
47
  l(o.next(c));
@@ -58,15 +58,15 @@ function w(n, e, r, o) {
58
58
  }
59
59
  function l(c) {
60
60
  var s;
61
- c.done ? i(c.value) : (s = c.value, s instanceof r ? s : new r(function(f) {
61
+ c.done ? i(c.value) : (s = c.value, s instanceof n ? s : new n(function(f) {
62
62
  f(s);
63
63
  })).then(t, u);
64
64
  }
65
- l((o = o.apply(n, [])).next());
65
+ l((o = o.apply(r, [])).next());
66
66
  });
67
67
  }
68
- function y(n, e) {
69
- var r, o, i, a, t = { label: 0, sent: function() {
68
+ function y(r, e) {
69
+ var n, o, i, a, t = { label: 0, sent: function() {
70
70
  if (1 & i[0]) throw i[1];
71
71
  return i[1];
72
72
  }, trys: [], ops: [] };
@@ -76,9 +76,9 @@ function y(n, e) {
76
76
  function u(l) {
77
77
  return function(c) {
78
78
  return function(s) {
79
- if (r) throw new TypeError("Generator is already executing.");
79
+ if (n) throw new TypeError("Generator is already executing.");
80
80
  for (; a && (a = 0, s[0] && (t = 0)), t; ) try {
81
- if (r = 1, o && (i = 2 & s[0] ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
81
+ if (n = 1, o && (i = 2 & s[0] ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
82
82
  switch (o = 0, i && (s = [2 & s[0], i.value]), s[0]) {
83
83
  case 0:
84
84
  case 1:
@@ -112,11 +112,11 @@ function y(n, e) {
112
112
  i[2] && t.ops.pop(), t.trys.pop();
113
113
  continue;
114
114
  }
115
- s = e.call(n, t);
115
+ s = e.call(r, t);
116
116
  } catch (f) {
117
117
  s = [6, f], o = 0;
118
118
  } finally {
119
- r = i = 0;
119
+ n = i = 0;
120
120
  }
121
121
  if (5 & s[0]) throw s[1];
122
122
  return { value: s[0] ? s[1] : void 0, done: !0 };
@@ -124,33 +124,33 @@ function y(n, e) {
124
124
  };
125
125
  }
126
126
  }
127
- var b = { exclude: [] }, D = {}, N = { timeout: "true" }, v = function(n, e) {
128
- typeof window < "u" && (D[n] = e);
127
+ var b = { exclude: [] }, D = {}, N = { timeout: "true" }, v = function(r, e) {
128
+ typeof window < "u" && (D[r] = e);
129
129
  }, j = function() {
130
- return Object.fromEntries(Object.entries(D).filter(function(n) {
131
- var e, r = n[0];
132
- return !(!((e = b == null ? void 0 : b.exclude) === null || e === void 0) && e.includes(r));
133
- }).map(function(n) {
134
- return [n[0], (0, n[1])()];
130
+ return Object.fromEntries(Object.entries(D).filter(function(r) {
131
+ var e, n = r[0];
132
+ return !(!((e = b == null ? void 0 : b.exclude) === null || e === void 0) && e.includes(n));
133
+ }).map(function(r) {
134
+ return [r[0], (0, r[1])()];
135
135
  }));
136
136
  };
137
- function C(n) {
138
- return n ^= n >>> 16, n = Math.imul(n, 2246822507), n ^= n >>> 13, n = Math.imul(n, 3266489909), (n ^= n >>> 16) >>> 0;
137
+ function C(r) {
138
+ return r ^= r >>> 16, r = Math.imul(r, 2246822507), r ^= r >>> 13, r = Math.imul(r, 3266489909), (r ^= r >>> 16) >>> 0;
139
139
  }
140
140
  var m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
141
- function g(n, e) {
142
- return n << e | n >>> 32 - e;
141
+ function g(r, e) {
142
+ return r << e | r >>> 32 - e;
143
143
  }
144
- function T(n, e) {
145
- var r;
146
- if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof n == "string" && (r = n, n = new TextEncoder().encode(r).buffer), !(n instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
144
+ function M(r, e) {
145
+ var n;
146
+ if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof r == "string" && (n = r, r = new TextEncoder().encode(n).buffer), !(r instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
147
147
  var o = new Uint32Array([e, e, e, e]);
148
148
  ((function(a, t) {
149
149
  for (var u = a.byteLength / 16 | 0, l = new Uint32Array(a, 0, 4 * u), c = 0; c < u; c++) {
150
150
  var s = l.subarray(4 * c, 4 * (c + 1));
151
151
  s[0] = Math.imul(s[0], m[0]), s[0] = g(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0], t[0] = g(t[0], 19), t[0] = t[0] + t[1], t[0] = Math.imul(t[0], 5) + 1444728091, s[1] = Math.imul(s[1], m[1]), s[1] = g(s[1], 16), s[1] = Math.imul(s[1], m[2]), t[1] = t[1] ^ s[1], t[1] = g(t[1], 17), t[1] = t[1] + t[2], t[1] = Math.imul(t[1], 5) + 197830471, s[2] = Math.imul(s[2], m[2]), s[2] = g(s[2], 17), s[2] = Math.imul(s[2], m[3]), t[2] = t[2] ^ s[2], t[2] = g(t[2], 15), t[2] = t[2] + t[3], t[2] = Math.imul(t[2], 5) + 2530024501, s[3] = Math.imul(s[3], m[3]), s[3] = g(s[3], 18), s[3] = Math.imul(s[3], m[0]), t[3] = t[3] ^ s[3], t[3] = g(t[3], 13), t[3] = t[3] + t[0], t[3] = Math.imul(t[3], 5) + 850148119;
152
152
  }
153
- }))(n, o), function(a, t) {
153
+ }))(r, o), function(a, t) {
154
154
  var u = a.byteLength / 16 | 0, l = a.byteLength % 16, c = new Uint32Array(4), s = new Uint8Array(a, 16 * u, l);
155
155
  switch (l) {
156
156
  case 15:
@@ -184,35 +184,35 @@ function T(n, e) {
184
184
  case 1:
185
185
  c[0] = c[0] ^ s[0] << 0, c[0] = Math.imul(c[0], m[0]), c[0] = g(c[0], 15), c[0] = Math.imul(c[0], m[1]), t[0] = t[0] ^ c[0];
186
186
  }
187
- }(n, o), function(a, t) {
187
+ }(r, o), function(a, t) {
188
188
  t[0] = t[0] ^ a.byteLength, t[1] = t[1] ^ a.byteLength, t[2] = t[2] ^ a.byteLength, t[3] = t[3] ^ a.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = C(t[0]), t[1] = C(t[1]), t[2] = C(t[2]), t[3] = C(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
189
- }(n, o);
189
+ }(r, o);
190
190
  var i = new Uint8Array(o.buffer);
191
191
  return Array.from(i).map(function(a) {
192
192
  return a.toString(16).padStart(2, "0");
193
193
  }).join("");
194
194
  }
195
- function G(n, e) {
196
- return new Promise(function(r) {
195
+ function G(r, e) {
196
+ return new Promise(function(n) {
197
197
  setTimeout(function() {
198
- return r(e);
199
- }, n);
198
+ return n(e);
199
+ }, r);
200
200
  });
201
201
  }
202
- function W(n, e, r) {
203
- return Promise.all(n.map(function(o) {
204
- return Promise.race([o, G(e, r)]);
202
+ function V(r, e, n) {
203
+ return Promise.all(r.map(function(o) {
204
+ return Promise.race([o, G(e, n)]);
205
205
  }));
206
206
  }
207
- function V() {
207
+ function W() {
208
208
  return w(this, void 0, void 0, function() {
209
- var n, e, r, o, i;
209
+ var r, e, n, o, i;
210
210
  return y(this, function(a) {
211
211
  switch (a.label) {
212
212
  case 0:
213
- return a.trys.push([0, 2, , 3]), n = j(), e = Object.keys(n), [4, W(Object.values(n), (b == null ? void 0 : b.timeout) || 1e3, N)];
213
+ return a.trys.push([0, 2, , 3]), r = j(), e = Object.keys(r), [4, V(Object.values(r), (b == null ? void 0 : b.timeout) || 1e3, N)];
214
214
  case 1:
215
- return r = a.sent(), o = r.filter(function(t) {
215
+ return n = a.sent(), o = n.filter(function(t) {
216
216
  return t !== void 0;
217
217
  }), i = {}, o.forEach(function(t, u) {
218
218
  i[e[u]] = t;
@@ -225,31 +225,31 @@ function V() {
225
225
  });
226
226
  });
227
227
  }
228
- function O(n, e) {
229
- var r = {}, o = function(a) {
230
- if (n.hasOwnProperty(a)) {
231
- var t = n[a];
232
- if (typeof t != "object" || Array.isArray(t)) e.includes(a) || (r[a] = t);
228
+ function O(r, e) {
229
+ var n = {}, o = function(a) {
230
+ if (r.hasOwnProperty(a)) {
231
+ var t = r[a];
232
+ if (typeof t != "object" || Array.isArray(t)) e.includes(a) || (n[a] = t);
233
233
  else {
234
234
  var u = O(t, e.map(function(l) {
235
235
  return l.startsWith(a + ".") ? l.slice(a.length + 1) : l;
236
236
  }));
237
- Object.keys(u).length > 0 && (r[a] = u);
237
+ Object.keys(u).length > 0 && (n[a] = u);
238
238
  }
239
239
  }
240
240
  };
241
- for (var i in n) o(i);
242
- return r;
241
+ for (var i in r) o(i);
242
+ return n;
243
243
  }
244
- function $(n) {
244
+ function $(r) {
245
245
  return w(this, void 0, void 0, function() {
246
- var e, r;
246
+ var e, n;
247
247
  return y(this, function(o) {
248
248
  switch (o.label) {
249
249
  case 0:
250
- return o.trys.push([0, 2, , 3]), [4, V()];
250
+ return o.trys.push([0, 2, , 3]), [4, W()];
251
251
  case 1:
252
- return e = o.sent(), r = T(JSON.stringify(e)), [2, r.toString()];
252
+ return e = o.sent(), n = M(JSON.stringify(e)), [2, n.toString()];
253
253
  case 2:
254
254
  throw o.sent();
255
255
  case 3:
@@ -258,38 +258,38 @@ function $(n) {
258
258
  });
259
259
  });
260
260
  }
261
- function H(n) {
262
- for (var e = 0, r = 0; r < n.length; ++r) e += Math.abs(n[r]);
261
+ function H(r) {
262
+ for (var e = 0, n = 0; n < r.length; ++n) e += Math.abs(r[n]);
263
263
  return e;
264
264
  }
265
- function U(n, e, r) {
266
- for (var o = [], i = 0; i < n[0].data.length; i++) {
267
- for (var a = [], t = 0; t < n.length; t++) a.push(n[t].data[i]);
265
+ function U(r, e, n) {
266
+ for (var o = [], i = 0; i < r[0].data.length; i++) {
267
+ for (var a = [], t = 0; t < r.length; t++) a.push(r[t].data[i]);
268
268
  o.push(Q(a));
269
269
  }
270
270
  var u = new Uint8ClampedArray(o);
271
- return new ImageData(u, e, r);
271
+ return new ImageData(u, e, n);
272
272
  }
273
- function Q(n) {
274
- if (n.length === 0) return 0;
275
- for (var e = {}, r = 0, o = n; r < o.length; r++)
276
- e[a = o[r]] = (e[a] || 0) + 1;
277
- var i = n[0];
273
+ function Q(r) {
274
+ if (r.length === 0) return 0;
275
+ for (var e = {}, n = 0, o = r; n < o.length; n++)
276
+ e[a = o[n]] = (e[a] || 0) + 1;
277
+ var i = r[0];
278
278
  for (var a in e) e[a] > e[i] && (i = parseInt(a, 10));
279
279
  return i;
280
280
  }
281
281
  function E() {
282
282
  if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
283
- for (var n = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, r = 0, o = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; r < o.length; r++) {
284
- var i = o[r], a = n.match(i);
283
+ for (var r = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, n = 0, o = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; n < o.length; n++) {
284
+ var i = o[n], a = r.match(i);
285
285
  if (a && a.groups) return { name: e[a.groups.name] || a.groups.name, version: a.groups.version };
286
286
  }
287
287
  return { name: "unknown", version: "unknown" };
288
288
  }
289
289
  v("audio", function() {
290
290
  return w(this, void 0, void 0, function() {
291
- return y(this, function(n) {
292
- return [2, new Promise(function(e, r) {
291
+ return y(this, function(r) {
292
+ return [2, new Promise(function(e, n) {
293
293
  try {
294
294
  var o = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), i = o.createBufferSource(), a = o.createOscillator();
295
295
  a.frequency.value = 1e3;
@@ -298,44 +298,44 @@ v("audio", function() {
298
298
  t = l.renderedBuffer.getChannelData(0), e({ sampleHash: H(t), oscillator: a.type, maxChannels: o.destination.maxChannelCount, channelCountMode: i.channelCountMode });
299
299
  }, o.startRendering();
300
300
  } catch (l) {
301
- console.error("Error creating audio fingerprint:", l), r(l);
301
+ console.error("Error creating audio fingerprint:", l), n(l);
302
302
  }
303
303
  })];
304
304
  });
305
305
  });
306
306
  });
307
- var z = E().name !== "SamsungBrowser" ? 1 : 3, x = 280, k = 20;
307
+ var z = E().name !== "SamsungBrowser" ? 1 : 3, x = 280, F = 20;
308
308
  E().name != "Firefox" && v("canvas", function() {
309
- return document.createElement("canvas").getContext("2d"), new Promise(function(n) {
309
+ return document.createElement("canvas").getContext("2d"), new Promise(function(r) {
310
310
  var e = Array.from({ length: z }, function() {
311
311
  return function() {
312
- var r = document.createElement("canvas"), o = r.getContext("2d");
312
+ var n = document.createElement("canvas"), o = n.getContext("2d");
313
313
  if (!o) return new ImageData(1, 1);
314
- r.width = x, r.height = k;
315
- var i = o.createLinearGradient(0, 0, r.width, r.height);
316
- i.addColorStop(0, "red"), i.addColorStop(0.16666666666666666, "orange"), i.addColorStop(0.3333333333333333, "yellow"), i.addColorStop(0.5, "green"), i.addColorStop(0.6666666666666666, "blue"), i.addColorStop(0.8333333333333334, "indigo"), i.addColorStop(1, "violet"), o.fillStyle = i, o.fillRect(0, 0, r.width, r.height);
314
+ n.width = x, n.height = F;
315
+ var i = o.createLinearGradient(0, 0, n.width, n.height);
316
+ i.addColorStop(0, "red"), i.addColorStop(0.16666666666666666, "orange"), i.addColorStop(0.3333333333333333, "yellow"), i.addColorStop(0.5, "green"), i.addColorStop(0.6666666666666666, "blue"), i.addColorStop(0.8333333333333334, "indigo"), i.addColorStop(1, "violet"), o.fillStyle = i, o.fillRect(0, 0, n.width, n.height);
317
317
  var a = "Random Text WMwmil10Oo";
318
- o.font = "23.123px Arial", o.fillStyle = "black", o.fillText(a, -5, 15), o.fillStyle = "rgba(0, 0, 255, 0.5)", o.fillText(a, -3.3, 17.7), o.beginPath(), o.moveTo(0, 0), o.lineTo(2 * r.width / 7, r.height), o.strokeStyle = "white", o.lineWidth = 2, o.stroke();
319
- var t = o.getImageData(0, 0, r.width, r.height);
318
+ o.font = "23.123px Arial", o.fillStyle = "black", o.fillText(a, -5, 15), o.fillStyle = "rgba(0, 0, 255, 0.5)", o.fillText(a, -3.3, 17.7), o.beginPath(), o.moveTo(0, 0), o.lineTo(2 * n.width / 7, n.height), o.strokeStyle = "white", o.lineWidth = 2, o.stroke();
319
+ var t = o.getImageData(0, 0, n.width, n.height);
320
320
  return t;
321
321
  }();
322
322
  });
323
- n({ commonImageDataHash: T(U(e, x, k).data.toString()).toString() });
323
+ r({ commonImageDataHash: M(U(e, x, F).data.toString()).toString() });
324
324
  });
325
325
  });
326
- var A, K = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], J = ["monospace", "sans-serif", "serif"];
327
- function F(n, e) {
328
- if (!n) throw new Error("Canvas context not supported");
329
- return n.font = "72px ".concat(e), n.measureText("WwMmLli0Oo").width;
326
+ var T, K = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], Y = ["monospace", "sans-serif", "serif"];
327
+ function k(r, e) {
328
+ if (!r) throw new Error("Canvas context not supported");
329
+ return r.font = "72px ".concat(e), r.measureText("WwMmLli0Oo").width;
330
330
  }
331
- function Y() {
332
- var n, e = document.createElement("canvas"), r = (n = e.getContext("webgl")) !== null && n !== void 0 ? n : e.getContext("experimental-webgl");
333
- if (r && "getParameter" in r) try {
334
- var o = (r.getParameter(r.VENDOR) || "").toString(), i = (r.getParameter(r.RENDERER) || "").toString(), a = { vendor: o, renderer: i, version: (r.getParameter(r.VERSION) || "").toString(), shadingLanguageVersion: (r.getParameter(r.SHADING_LANGUAGE_VERSION) || "").toString() };
331
+ function J() {
332
+ var r, e = document.createElement("canvas"), n = (r = e.getContext("webgl")) !== null && r !== void 0 ? r : e.getContext("experimental-webgl");
333
+ if (n && "getParameter" in n) try {
334
+ var o = (n.getParameter(n.VENDOR) || "").toString(), i = (n.getParameter(n.RENDERER) || "").toString(), a = { vendor: o, renderer: i, version: (n.getParameter(n.VERSION) || "").toString(), shadingLanguageVersion: (n.getParameter(n.SHADING_LANGUAGE_VERSION) || "").toString() };
335
335
  if (!i.length || !o.length) {
336
- var t = r.getExtension("WEBGL_debug_renderer_info");
336
+ var t = n.getExtension("WEBGL_debug_renderer_info");
337
337
  if (t) {
338
- var u = (r.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (r.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
338
+ var u = (n.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (n.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
339
339
  u && (a.vendorUnmasked = u), l && (a.rendererUnmasked = l);
340
340
  }
341
341
  }
@@ -345,11 +345,11 @@ function Y() {
345
345
  return "undefined";
346
346
  }
347
347
  function X() {
348
- var n = new Float32Array(1), e = new Uint8Array(n.buffer);
349
- return n[0] = 1 / 0, n[0] = n[0] - n[0], e[3];
348
+ var r = new Float32Array(1), e = new Uint8Array(r.buffer);
349
+ return r[0] = 1 / 0, r[0] = r[0] - r[0], e[3];
350
350
  }
351
- function Z(n, e) {
352
- var r = {};
351
+ function Z(r, e) {
352
+ var n = {};
353
353
  return e.forEach(function(o) {
354
354
  var i = function(a) {
355
355
  if (a.length === 0) return null;
@@ -362,33 +362,33 @@ function Z(n, e) {
362
362
  return Object.keys(t).forEach(function(c) {
363
363
  t[c] > l && (u = c, l = t[c]);
364
364
  }), u;
365
- }(n.map(function(a) {
365
+ }(r.map(function(a) {
366
366
  return o in a ? a[o] : void 0;
367
367
  }).filter(function(a) {
368
368
  return a !== void 0;
369
369
  }));
370
- i && (r[o] = i);
371
- }), r;
370
+ i && (n[o] = i);
371
+ }), n;
372
372
  }
373
373
  function ee() {
374
- var n = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
375
- return Object.keys(e).forEach(function(r) {
376
- e[r].forEach(function(o) {
377
- matchMedia("(".concat(r, ": ").concat(o, ")")).matches && n.push("".concat(r, ": ").concat(o));
374
+ var r = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
375
+ return Object.keys(e).forEach(function(n) {
376
+ e[n].forEach(function(o) {
377
+ matchMedia("(".concat(n, ": ").concat(o, ")")).matches && r.push("".concat(n, ": ").concat(o));
378
378
  });
379
- }), n;
379
+ }), r;
380
380
  }
381
381
  function te() {
382
382
  if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
383
- for (var n = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (n(e)) return e;
383
+ for (var r = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (r(e)) return e;
384
384
  } catch {
385
385
  return 0;
386
386
  }
387
387
  return 0;
388
388
  }
389
389
  E().name != "Firefox" && v("fonts", function() {
390
- var n = this;
391
- return new Promise(function(e, r) {
390
+ var r = this;
391
+ return new Promise(function(e, n) {
392
392
  try {
393
393
  (function(o) {
394
394
  var i;
@@ -413,97 +413,97 @@ E().name != "Firefox" && v("fonts", function() {
413
413
  });
414
414
  })(function(o) {
415
415
  var i = o.iframe;
416
- return w(n, void 0, void 0, function() {
416
+ return w(r, void 0, void 0, function() {
417
417
  var a, t, u, l;
418
418
  return y(this, function(c) {
419
- return a = i.createElement("canvas"), t = a.getContext("2d"), u = J.map(function(s) {
420
- return F(t, s);
419
+ return a = i.createElement("canvas"), t = a.getContext("2d"), u = Y.map(function(s) {
420
+ return k(t, s);
421
421
  }), l = {}, K.forEach(function(s) {
422
- var f = F(t, s);
422
+ var f = k(t, s);
423
423
  u.includes(f) || (l[s] = f);
424
424
  }), e(l), [2];
425
425
  });
426
426
  });
427
427
  });
428
428
  } catch {
429
- r({ error: "unsupported" });
429
+ n({ error: "unsupported" });
430
430
  }
431
431
  });
432
432
  }), v("hardware", function() {
433
- return new Promise(function(n, e) {
434
- var r = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, o = window.performance && window.performance.memory ? window.performance.memory : 0;
435
- n({ videocard: Y(), architecture: X(), deviceMemory: r.toString() || "undefined", jsHeapSizeLimit: o.jsHeapSizeLimit || 0 });
433
+ return new Promise(function(r, e) {
434
+ var n = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, o = window.performance && window.performance.memory ? window.performance.memory : 0;
435
+ r({ videocard: J(), architecture: X(), deviceMemory: n.toString() || "undefined", jsHeapSizeLimit: o.jsHeapSizeLimit || 0 });
436
436
  });
437
437
  }), v("locales", function() {
438
- return new Promise(function(n) {
439
- n({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
438
+ return new Promise(function(r) {
439
+ r({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
440
440
  });
441
441
  }), v("permissions", function() {
442
442
  return w(this, void 0, void 0, function() {
443
- var n;
443
+ var r;
444
444
  return y(this, function(e) {
445
- return A = (b == null ? void 0 : b.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], n = Array.from({ length: (b == null ? void 0 : b.retries) || 3 }, function() {
445
+ return T = (b == null ? void 0 : b.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], r = Array.from({ length: (b == null ? void 0 : b.retries) || 3 }, function() {
446
446
  return function() {
447
447
  return w(this, void 0, void 0, function() {
448
- var r, o, i, a, t;
448
+ var n, o, i, a, t;
449
449
  return y(this, function(u) {
450
450
  switch (u.label) {
451
451
  case 0:
452
- r = {}, o = 0, i = A, u.label = 1;
452
+ n = {}, o = 0, i = T, u.label = 1;
453
453
  case 1:
454
454
  if (!(o < i.length)) return [3, 6];
455
455
  a = i[o], u.label = 2;
456
456
  case 2:
457
457
  return u.trys.push([2, 4, , 5]), [4, navigator.permissions.query({ name: a })];
458
458
  case 3:
459
- return t = u.sent(), r[a] = t.state.toString(), [3, 5];
459
+ return t = u.sent(), n[a] = t.state.toString(), [3, 5];
460
460
  case 4:
461
461
  return u.sent(), [3, 5];
462
462
  case 5:
463
463
  return o++, [3, 1];
464
464
  case 6:
465
- return [2, r];
465
+ return [2, n];
466
466
  }
467
467
  });
468
468
  });
469
469
  }();
470
- }), [2, Promise.all(n).then(function(r) {
471
- return Z(r, A);
470
+ }), [2, Promise.all(r).then(function(n) {
471
+ return Z(n, T);
472
472
  })];
473
473
  });
474
474
  });
475
475
  }), v("plugins", function() {
476
- var n = [];
476
+ var r = [];
477
477
  if (navigator.plugins) for (var e = 0; e < navigator.plugins.length; e++) {
478
- var r = navigator.plugins[e];
479
- n.push([r.name, r.filename, r.description].join("|"));
478
+ var n = navigator.plugins[e];
479
+ r.push([n.name, n.filename, n.description].join("|"));
480
480
  }
481
481
  return new Promise(function(o) {
482
- o({ plugins: n });
482
+ o({ plugins: r });
483
483
  });
484
484
  }), v("screen", function() {
485
- return new Promise(function(n) {
486
- n({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
485
+ return new Promise(function(r) {
486
+ r({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
487
487
  });
488
488
  }), v("system", function() {
489
- return new Promise(function(n) {
489
+ return new Promise(function(r) {
490
490
  var e = E();
491
- n({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: te() });
491
+ r({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: te() });
492
492
  });
493
493
  });
494
494
  var p, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
495
495
  v("webgl", function() {
496
496
  return w(this, void 0, void 0, function() {
497
- var n;
497
+ var r;
498
498
  return y(this, function(e) {
499
499
  typeof document < "u" && ((p = document.createElement("canvas")).width = 200, p.height = 100, d = p.getContext("webgl"));
500
500
  try {
501
501
  if (!d) throw new Error("WebGL not supported");
502
- return n = Array.from({ length: ne }, function() {
502
+ return r = Array.from({ length: ne }, function() {
503
503
  return function() {
504
504
  try {
505
505
  if (!d) throw new Error("WebGL not supported");
506
- var r = `
506
+ var n = `
507
507
  attribute vec2 position;
508
508
  void main() {
509
509
  gl_Position = vec4(position, 0.0, 1.0);
@@ -515,7 +515,7 @@ v("webgl", function() {
515
515
  }
516
516
  `, i = d.createShader(d.VERTEX_SHADER), a = d.createShader(d.FRAGMENT_SHADER);
517
517
  if (!i || !a) throw new Error("Failed to create shaders");
518
- if (d.shaderSource(i, r), d.shaderSource(a, o), d.compileShader(i), !d.getShaderParameter(i, d.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + d.getShaderInfoLog(i));
518
+ if (d.shaderSource(i, n), d.shaderSource(a, o), d.compileShader(i), !d.getShaderParameter(i, d.COMPILE_STATUS)) throw new Error("Vertex shader compilation failed: " + d.getShaderInfoLog(i));
519
519
  if (d.compileShader(a), !d.getShaderParameter(a, d.COMPILE_STATUS)) throw new Error("Fragment shader compilation failed: " + d.getShaderInfoLog(a));
520
520
  var t = d.createProgram();
521
521
  if (!t) throw new Error("Failed to create shader program");
@@ -525,19 +525,19 @@ v("webgl", function() {
525
525
  var f = s * c;
526
526
  l[4 * s] = 0, l[4 * s + 1] = 0, l[4 * s + 2] = Math.cos(f) * (p.width / 2), l[4 * s + 3] = Math.sin(f) * (p.height / 2);
527
527
  }
528
- var B = d.createBuffer();
529
- d.bindBuffer(d.ARRAY_BUFFER, B), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
530
- var R = d.getAttribLocation(t, "position");
531
- d.enableVertexAttribArray(R), d.vertexAttribPointer(R, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, p.width, p.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
- var _ = new Uint8ClampedArray(p.width * p.height * 4);
533
- return d.readPixels(0, 0, p.width, p.height, d.RGBA, d.UNSIGNED_BYTE, _), new ImageData(_, p.width, p.height);
528
+ var L = d.createBuffer();
529
+ d.bindBuffer(d.ARRAY_BUFFER, L), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
530
+ var _ = d.getAttribLocation(t, "position");
531
+ d.enableVertexAttribArray(_), d.vertexAttribPointer(_, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, p.width, p.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
+ var R = new Uint8ClampedArray(p.width * p.height * 4);
533
+ return d.readPixels(0, 0, p.width, p.height, d.RGBA, d.UNSIGNED_BYTE, R), new ImageData(R, p.width, p.height);
534
534
  } catch {
535
535
  return new ImageData(1, 1);
536
536
  } finally {
537
537
  d && (d.bindBuffer(d.ARRAY_BUFFER, null), d.useProgram(null), d.viewport(0, 0, d.drawingBufferWidth, d.drawingBufferHeight), d.clearColor(0, 0, 0, 0));
538
538
  }
539
539
  }();
540
- }), [2, { commonImageHash: T(U(n, p.width, p.height).data.toString()).toString() }];
540
+ }), [2, { commonImageHash: M(U(r, p.width, p.height).data.toString()).toString() }];
541
541
  } catch {
542
542
  return [2, { webgl: "unsupported" }];
543
543
  }
@@ -545,23 +545,23 @@ v("webgl", function() {
545
545
  });
546
546
  });
547
547
  });
548
- var S = function(n, e, r, o) {
549
- for (var i = (r - e) / o, a = 0, t = 0; t < o; t++)
550
- a += n(e + (t + 0.5) * i);
548
+ var S = function(r, e, n, o) {
549
+ for (var i = (n - e) / o, a = 0, t = 0; t < o; t++)
550
+ a += r(e + (t + 0.5) * i);
551
551
  return a * i;
552
552
  };
553
553
  v("math", function() {
554
554
  return w(void 0, void 0, void 0, function() {
555
- return y(this, function(n) {
555
+ return y(this, function(r) {
556
556
  return [2, { acos: Math.acos(0.5), asin: S(Math.asin, -1, 1, 97), atan: S(Math.atan, -1, 1, 97), cos: S(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: S(Math.sin, -Math.PI, Math.PI, 97), sinh: S(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: S(Math.tan, 0, 2 * Math.PI, 97), tanh: S(Math.tanh, -9 / 7, 7 / 9, 97) }];
557
557
  });
558
558
  });
559
559
  });
560
560
  const re = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
561
- let M = (n = 21) => {
562
- let e = "", r = crypto.getRandomValues(new Uint8Array(n |= 0));
563
- for (; n--; )
564
- e += re[r[n] & 63];
561
+ let A = (r = 21) => {
562
+ let e = "", n = crypto.getRandomValues(new Uint8Array(r |= 0));
563
+ for (; r--; )
564
+ e += re[n[r] & 63];
565
565
  return e;
566
566
  };
567
567
  class I {
@@ -574,10 +574,14 @@ class I {
574
574
  }
575
575
  async onQuerySubmitted(e) {
576
576
  }
577
- async onQueryFetched(e, r) {
577
+ async onQueryFetched(e, n) {
578
578
  }
579
579
  async onInputCleared() {
580
580
  }
581
+ async onAdContainerRendered(e) {
582
+ }
583
+ async onAdContainerViewed(e) {
584
+ }
581
585
  }
582
586
  class oe extends I {
583
587
  /**
@@ -596,65 +600,78 @@ class oe extends I {
596
600
  "results-pa": `${this.config.admProductAdQuantity || 0}`
597
601
  }).toString()}`, a = await (await fetch(o, { method: "GET" })).json(), t = a.product_ads.map(
598
602
  (c) => ({
599
- id: M(),
603
+ id: A(),
600
604
  adSource: "adMarketplace",
601
605
  admAdType: "adm-product-ad",
602
606
  admAd: c
603
607
  })
604
608
  ), u = a.text_ads.map((c) => ({
605
- id: M(),
609
+ id: A(),
606
610
  adSource: "adMarketplace",
607
611
  admAdType: "adm-text-ad",
608
612
  admAd: c
609
613
  }));
610
614
  return t.concat(u);
611
615
  }
616
+ async onAdContainerViewed(e) {
617
+ var o;
618
+ const n = e.adClientResponseItem;
619
+ (o = n.admAd) != null && o.impression_url && fetch(n.admAd.impression_url);
620
+ }
612
621
  }
613
622
  class ae extends I {
614
623
  async getAdsForSearchParams(e) {
615
624
  return [];
616
625
  }
617
626
  }
618
- class ie extends I {
619
- constructor(e) {
620
- super(e), this.addScriptTagToDocument();
627
+ const ie = 1e3;
628
+ class se extends I {
629
+ constructor(n) {
630
+ super(n);
631
+ h(this, "adCallTimeout");
632
+ this.addScriptTagToDocument();
621
633
  }
622
- async onQuerySubmitted(e) {
634
+ async onQuerySubmitted(n) {
623
635
  this.addScriptTagToDocument();
624
636
  }
625
- async onQueryFetched(e, r) {
626
- var o;
627
- if ((((o = r.data.hits) == null ? void 0 : o.length) || 0) === 0) {
637
+ async onQueryFetched(n, o) {
638
+ var i;
639
+ if ((((i = o.data.hits) == null ? void 0 : i.length) || 0) === 0) {
628
640
  this.removeScriptTagFromDocument();
629
641
  return;
630
642
  }
631
- this.addScriptTagToDocument();
632
- try {
633
- PostRelease == null || PostRelease.Start({ ptd: [this.config.nativoPlacementId] });
634
- } catch (i) {
635
- console.error(i);
636
- }
643
+ this.performAdCall(ie);
637
644
  }
638
645
  async onInputCleared() {
639
646
  this.removeScriptTagFromDocument();
640
647
  }
641
- async getAdsForSearchParams(e) {
648
+ performAdCall(n) {
649
+ this.adCallTimeout && clearTimeout(this.adCallTimeout), this.adCallTimeout = setTimeout(() => {
650
+ this.addScriptTagToDocument();
651
+ try {
652
+ PostRelease == null || PostRelease.Start({ ptd: [this.config.nativoPlacementId] });
653
+ } catch (o) {
654
+ console.error(o);
655
+ }
656
+ }, n);
657
+ }
658
+ async getAdsForSearchParams(n) {
642
659
  return [];
643
660
  }
644
661
  addScriptTagToDocument() {
645
662
  if (!document.head.querySelector("#nativo-tag")) {
646
- const e = document.createElement("script");
647
- e.type = "text/javascript", e.src = "https://s.ntv.io/serve/load.js", e.id = "nativo-tag", e.setAttribute("data-ntv-set-no-auto-start", "true"), document.head.appendChild(e);
663
+ const n = document.createElement("script");
664
+ n.type = "text/javascript", n.src = "https://s.ntv.io/serve/load.js", n.id = "nativo-tag", n.setAttribute("data-ntv-set-no-auto-start", "true"), document.head.appendChild(n);
648
665
  }
649
666
  }
650
667
  removeScriptTagFromDocument() {
651
- const e = document.head.querySelector("#nativo-tag");
652
- e && document.head.removeChild(e);
668
+ const n = document.head.querySelector("#nativo-tag");
669
+ n && document.head.removeChild(n);
653
670
  }
654
671
  }
655
- const se = 500;
656
- class ce {
657
- constructor(e, r, o) {
672
+ const ce = 500;
673
+ class ue {
674
+ constructor(e, n, o) {
658
675
  h(this, "measureRequestTimeout");
659
676
  h(this, "measureRequestsBatched", []);
660
677
  h(this, "config");
@@ -668,13 +685,13 @@ class ce {
668
685
  * @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
669
686
  * @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
670
687
  */
671
- h(this, "sendMeasureEvent", (e, r = {}, o = {}) => {
688
+ h(this, "sendMeasureEvent", (e, n = {}, o = {}) => {
672
689
  const i = {
673
690
  event_name: e,
674
691
  properties: {
675
692
  searchcraft_index_names: this.config.index,
676
693
  session_id: this.sessionId,
677
- ...r
694
+ ...n
678
695
  },
679
696
  user: {
680
697
  ...this.measureRequestUser,
@@ -703,9 +720,9 @@ class ce {
703
720
  } catch (u) {
704
721
  throw console.error("Error sending MeasureRequest:", u), u;
705
722
  }
706
- }, se);
723
+ }, ce);
707
724
  });
708
- this.config = e, this.sdkInfo = r, this.userId = o, this.sessionId = M(), this.sendMeasureEvent("sdk_initialized");
725
+ this.config = e, this.sdkInfo = n, this.userId = o, this.sessionId = A(), this.sendMeasureEvent("sdk_initialized");
709
726
  }
710
727
  /**
711
728
  * Getter for the base url used by the /measure endpoints.
@@ -728,37 +745,37 @@ class ce {
728
745
  };
729
746
  }
730
747
  }
731
- function ue(n) {
748
+ function de(r) {
732
749
  const e = [];
733
- let r = "should";
734
- return n.facetPathsForIndexFields && Object.keys(n.facetPathsForIndexFields).forEach((o) => {
750
+ let n = "should";
751
+ return r.facetPathsForIndexFields && Object.keys(r.facetPathsForIndexFields).forEach((o) => {
735
752
  var a;
736
- const i = (a = n.facetPathsForIndexFields) == null ? void 0 : a[o];
737
- i && (r = "must", e.push({
738
- occur: r,
753
+ const i = (a = r.facetPathsForIndexFields) == null ? void 0 : a[o];
754
+ i && (n = "must", e.push({
755
+ occur: n,
739
756
  exact: {
740
757
  ctx: i.value
741
758
  }
742
759
  }));
743
- }), n.rangeValueForIndexFields && Object.keys(n.rangeValueForIndexFields).forEach((o) => {
760
+ }), r.rangeValueForIndexFields && Object.keys(r.rangeValueForIndexFields).forEach((o) => {
744
761
  var a;
745
- const i = (a = n.rangeValueForIndexFields) == null ? void 0 : a[o];
746
- i && (r = "must", e.push({
747
- occur: r,
762
+ const i = (a = r.rangeValueForIndexFields) == null ? void 0 : a[o];
763
+ i && (n = "must", e.push({
764
+ occur: n,
748
765
  exact: {
749
766
  ctx: i.value
750
767
  }
751
768
  }));
752
- }), n.sort === "desc" ? n.order_by = "date_published" : n.order_by = "", e.push({
753
- occur: r,
769
+ }), r.sort === "desc" ? r.order_by = "date_published" : r.order_by = "", e.push({
770
+ occur: n,
754
771
  // Valid, as 'occur' is a required property in QueryItem
755
- [n.mode]: { ctx: n.searchTerm }
772
+ [r.mode]: { ctx: r.searchTerm }
756
773
  // Ensure dynamic mode is inside queryType
757
774
  }), e;
758
775
  }
759
- const de = (n) => n.endsWith("/") ? n.slice(0, -1) : n, le = (n) => {
776
+ const le = (r) => r.endsWith("/") ? r.slice(0, -1) : r, he = (r) => {
760
777
  let e = "";
761
- if (e = n.trim(), e = e.replace(/[‘’“”]/g, (o) => ({
778
+ if (e = r.trim(), e = e.replace(/[‘’“”]/g, (o) => ({
762
779
  "‘": "'",
763
780
  "’": "'",
764
781
  "“": '"',
@@ -769,8 +786,8 @@ const de = (n) => n.endsWith("/") ? n.slice(0, -1) : n, le = (n) => {
769
786
  );
770
787
  return e;
771
788
  };
772
- class he {
773
- constructor(e, r, o) {
789
+ class fe {
790
+ constructor(e, n, o) {
774
791
  h(this, "config");
775
792
  h(this, "userId");
776
793
  h(this, "parent");
@@ -780,18 +797,18 @@ class he {
780
797
  */
781
798
  h(this, "getSearchResponse", async (e) => {
782
799
  var o, i, a, t, u;
783
- const r = le(e.searchTerm);
800
+ const n = he(e.searchTerm);
784
801
  (o = this.parent.measureClient) == null || o.sendMeasureEvent("search_requested", {
785
- search_term: r
802
+ search_term: n
786
803
  }), this.parent.emitEvent("query_submitted", {
787
804
  name: "query_submitted",
788
805
  data: {
789
- searchTerm: r
806
+ searchTerm: n
790
807
  }
791
808
  }), (i = this.parent.adClient) == null || i.onQuerySubmitted(e);
792
809
  try {
793
810
  const l = {
794
- query: ue(e),
811
+ query: de(e),
795
812
  offset: e.offset || 0,
796
813
  // Default to 0 (first page) if not provided
797
814
  limit: e.limit || this.config.searchResultsPerPage || 20
@@ -813,12 +830,12 @@ class he {
813
830
  );
814
831
  const f = await s.json();
815
832
  return (a = this.parent.measureClient) == null || a.sendMeasureEvent("search_response_received", {
816
- search_term: r,
833
+ search_term: n,
817
834
  number_of_documents: f.data.count
818
835
  }), this.parent.emitEvent("query_fetched", {
819
836
  name: "query_fetched",
820
837
  data: {
821
- searchTerm: r
838
+ searchTerm: n
822
839
  }
823
840
  }), (((t = f.data.hits) == null ? void 0 : t.length) || 0) === 0 && this.parent.emitEvent("no_results_returned", {
824
841
  name: "no_results_returned"
@@ -827,7 +844,7 @@ class he {
827
844
  throw console.error("Error parsing response:", l), l;
828
845
  }
829
846
  });
830
- this.parent = e, this.config = r, this.userId = o;
847
+ this.parent = e, this.config = n, this.userId = o;
831
848
  }
832
849
  /**
833
850
  * Getter for the base url used by the /search endpoint.
@@ -836,8 +853,8 @@ class he {
836
853
  return `${this.config.endpointURL}/index/${this.config.index.join(",")}/search`;
837
854
  }
838
855
  }
839
- class ge {
840
- constructor(e, r) {
856
+ class ve {
857
+ constructor(e, n) {
841
858
  h(this, "config");
842
859
  h(this, "measureClient");
843
860
  h(this, "searchClient");
@@ -848,7 +865,7 @@ class ge {
848
865
  /**
849
866
  * Gets items from the SearchClient and the AdClient.
850
867
  */
851
- h(this, "getItems", (e, r, o) => {
868
+ h(this, "getItems", (e, n, o) => {
852
869
  const i = async () => {
853
870
  (async () => {
854
871
  var u, l;
@@ -857,10 +874,10 @@ class ge {
857
874
  throw new Error("Search client was not initialized.");
858
875
  const t = (l = a.data.hits || []) == null ? void 0 : l.map((c) => c.doc).filter((c) => !!c).map((c) => ({
859
876
  type: "SearchDocument",
860
- id: M(),
877
+ id: A(),
861
878
  document: c
862
879
  }));
863
- r(a, t);
880
+ n(a, t);
864
881
  })(), (async () => {
865
882
  if (this.adClient) {
866
883
  const a = await this.adClient.getAdsForSearchParams(e);
@@ -880,16 +897,16 @@ class ge {
880
897
  this.config = {
881
898
  ...e,
882
899
  // Strips off the trailing '/' from an endpointURL if one is accidentally added
883
- endpointURL: de(e.endpointURL)
884
- }, this.userId = "", this.initClients(this.config, r), this.initInputForms(), this.startObservingMutations();
900
+ endpointURL: le(e.endpointURL)
901
+ }, this.userId = "", this.initClients(this.config, n), this.initInputForms(), this.startObservingMutations();
885
902
  }
886
903
  initInputForms() {
887
904
  const e = document.querySelectorAll(
888
905
  "searchcraft-input-form"
889
906
  );
890
907
  setTimeout(() => {
891
- e.forEach((r) => {
892
- r.core = this;
908
+ e.forEach((n) => {
909
+ n.core = this;
893
910
  });
894
911
  }, 40);
895
912
  }
@@ -897,24 +914,24 @@ class ge {
897
914
  * When changes happen in the DOM, we want to link any input forms found to the instance of the core.
898
915
  */
899
916
  startObservingMutations() {
900
- new MutationObserver((r, o) => {
917
+ new MutationObserver((n, o) => {
901
918
  let i = !1;
902
- for (const a of r)
919
+ for (const a of n)
903
920
  a.type === "childList" && a.addedNodes.forEach((t) => {
904
921
  t.nodeType === 1 && t.className.toLowerCase() === "searchcraft-input-form" && (i = !0);
905
922
  });
906
923
  i && this.initInputForms();
907
924
  }).observe(document.body, { childList: !0, subtree: !0 });
908
925
  }
909
- initClients(e, r) {
926
+ initClients(e, n) {
910
927
  setTimeout(async () => {
911
928
  let o = this.config.userId;
912
- switch (o || (o = await $()), this.measureClient = new ce(e, r, o), this.searchClient = new he(this, e, o), e.adSource) {
929
+ switch (o || (o = await $()), this.measureClient = new ue(e, n, o), this.searchClient = new fe(this, e, o), e.adSource) {
913
930
  case "adMarketplace":
914
931
  this.adClient = new oe(e);
915
932
  break;
916
933
  case "Nativo":
917
- this.adClient = new ie(e);
934
+ this.adClient = new se(e);
918
935
  break;
919
936
  case "Custom":
920
937
  this.adClient = new ae(e);
@@ -922,29 +939,25 @@ class ge {
922
939
  }
923
940
  }, 300);
924
941
  }
925
- emitEvent(e, r) {
942
+ emitEvent(e, n) {
926
943
  var o;
927
944
  (o = this.subscriptionEvents[e]) == null || o.forEach((i) => {
928
- i(r);
945
+ i(n);
929
946
  });
930
947
  }
931
- subscribe(e, r) {
948
+ subscribe(e, n) {
932
949
  return this.subscriptionEvents[e] || (this.subscriptionEvents[e] = []), this.subscriptionEvents[e].push(
933
- r
950
+ n
934
951
  ), () => {
935
- this.subscriptionEvents[e] = this.subscriptionEvents[e].filter((o) => o !== r);
952
+ this.subscriptionEvents[e] = this.subscriptionEvents[e].filter((o) => o !== n);
936
953
  };
937
954
  }
938
955
  /**
939
956
  * Called when a `<searchcraft-ad>` component is rendered
940
957
  */
941
958
  handleAdContainerRendered(e) {
942
- var r;
943
- if (e.adSource === "adMarketplace") {
944
- const o = e.adClientResponseItem;
945
- (r = o.admAd) != null && r.impression_url && fetch(o.admAd.impression_url);
946
- }
947
- this.emitEvent("ad_container_rendered", {
959
+ var n;
960
+ (n = this.adClient) == null || n.onAdContainerRendered(e), this.emitEvent("ad_container_rendered", {
948
961
  name: "ad_container_rendered",
949
962
  data: {
950
963
  adContainerId: e.adContainerId,
@@ -953,6 +966,20 @@ class ge {
953
966
  }
954
967
  });
955
968
  }
969
+ /**
970
+ * Called when a `<searchcraft-ad>` is viewed
971
+ */
972
+ handleAdContainerViewed(e) {
973
+ var n;
974
+ (n = this.adClient) == null || n.onAdContainerViewed(e), this.emitEvent("ad_container_viewed", {
975
+ name: "ad_container_viewed",
976
+ data: {
977
+ adContainerId: e.adContainerId,
978
+ adSource: e.adSource,
979
+ searchTerm: e.searchTerm
980
+ }
981
+ });
982
+ }
956
983
  /**
957
984
  * Perform various actions when the input is cleared
958
985
  */
@@ -1624,7 +1651,7 @@ const searchcraftStore = zustand.createStore((set, get) => {
1624
1651
  initialize: (searchcraftInstance, debug = false) => {
1625
1652
  const core = searchcraftInstance;
1626
1653
  const logger = debug
1627
- ? new pe({ logLevel: P.DEBUG })
1654
+ ? new ge({ logLevel: P.DEBUG })
1628
1655
  : undefined;
1629
1656
  set({
1630
1657
  core,
@@ -1749,6 +1776,6 @@ const searchcraftStore = zustand.createStore((set, get) => {
1749
1776
  return stateObject;
1750
1777
  });
1751
1778
 
1752
- export { ge as g, searchcraftStore as s };
1779
+ export { searchcraftStore as s, ve as v };
1753
1780
 
1754
- //# sourceMappingURL=p-39be2b10.js.map
1781
+ //# sourceMappingURL=p-580c09dc.js.map