coveo.analytics 2.30.56 → 2.32.0
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.
- package/README.md +37 -43
- package/dist/browser.mjs +513 -357
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +542 -359
- package/dist/coveoua.debug.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/client/analytics.d.ts +3 -2
- package/dist/definitions/client/runtimeEnvironment.d.ts +1 -1
- package/dist/definitions/donottrack.d.ts +1 -0
- package/dist/definitions/react-native/index.d.ts +1 -2
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +15350 -3699
- package/dist/library.es.js +513 -357
- package/dist/library.js +15350 -3699
- package/dist/library.mjs +15350 -3699
- package/dist/react-native.es.js +634 -460
- package/modules/package.json +9 -9
- package/package.json +60 -91
- package/react-native/package.json +7 -7
- package/src/caseAssist/caseAssistActions.ts +51 -50
- package/src/caseAssist/caseAssistClient.spec.ts +328 -297
- package/src/caseAssist/caseAssistClient.ts +201 -185
- package/src/client/analytics.spec.ts +724 -703
- package/src/client/analytics.ts +677 -602
- package/src/client/analyticsBeaconClient.spec.ts +195 -188
- package/src/client/analyticsBeaconClient.ts +99 -88
- package/src/client/analyticsFetchClient.ts +77 -61
- package/src/client/analyticsRequestClient.ts +17 -17
- package/src/client/location.ts +3 -3
- package/src/client/measurementProtocolMapper.ts +54 -45
- package/src/client/measurementProtocolMapping/baseMeasurementProtocolMapper.ts +48 -44
- package/src/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.ts +133 -121
- package/src/client/measurementProtocolMapping/serviceMeasurementProtocolMapper.ts +17 -17
- package/src/client/noopAnalytics.ts +80 -68
- package/src/client/runtimeEnvironment.ts +50 -41
- package/src/client/utils.spec.ts +112 -97
- package/src/client/utils.ts +39 -39
- package/src/cookieutils.spec.ts +59 -0
- package/src/cookieutils.ts +40 -39
- package/src/coveoua/browser.ts +14 -12
- package/src/coveoua/library.ts +4 -4
- package/src/coveoua/plugins.ts +36 -34
- package/src/coveoua/simpleanalytics.spec.ts +467 -452
- package/src/coveoua/simpleanalytics.ts +146 -140
- package/src/detector.ts +17 -17
- package/src/donottrack.spec.ts +199 -121
- package/src/donottrack.ts +31 -8
- package/src/events.ts +86 -79
- package/src/formatting/format-array-for-coveo-custom-data.spec.ts +13 -12
- package/src/formatting/format-array-for-coveo-custom-data.ts +18 -18
- package/src/formatting/format-omnibox-metadata.ts +16 -12
- package/src/history.spec.ts +197 -195
- package/src/history.ts +143 -133
- package/src/hook/addDefaultValues.ts +13 -8
- package/src/hook/enhanceViewEvent.ts +17 -17
- package/src/insight/insightClient.spec.ts +1848 -1717
- package/src/insight/insightClient.ts +866 -761
- package/src/insight/insightEvents.ts +57 -56
- package/src/plugins/BasePlugin.ts +125 -121
- package/src/plugins/ec.spec.ts +457 -429
- package/src/plugins/ec.ts +202 -199
- package/src/plugins/link.spec.ts +183 -159
- package/src/plugins/link.ts +88 -85
- package/src/plugins/svc.spec.ts +161 -155
- package/src/plugins/svc.ts +93 -91
- package/src/react-native/index.ts +8 -1
- package/src/react-native/react-native-runtime.ts +33 -33
- package/src/react-native/react-native-utils.ts +1 -1
- package/src/react-native/react-native.spec.ts +31 -21
- package/src/searchPage/searchPageClient.spec.ts +1944 -1794
- package/src/searchPage/searchPageClient.ts +1261 -1040
- package/src/searchPage/searchPageEvents.ts +524 -511
- package/src/storage.spec.ts +51 -51
- package/src/storage.ts +47 -47
- package/dist/definitions/bundle/browser-fetch.d.ts +0 -1
- package/dist/definitions/src/coveoua/browser.d.ts +0 -6
- package/dist/definitions/src/coveoua/headless.d.ts +0 -6
- package/dist/definitions/src/coveoua/library.d.ts +0 -17
- package/dist/definitions/src/coveoua/plugins.d.ts +0 -10
- package/dist/definitions/src/coveoua/simpleanalytics.d.ts +0 -33
- package/dist/definitions/src/react-native/index.d.ts +0 -3
- package/dist/definitions/src/react-native/react-native-runtime.d.ts +0 -19
package/dist/coveoua.debug.js
CHANGED
|
@@ -149,7 +149,12 @@
|
|
|
149
149
|
return hasNavigator() && navigator.cookieEnabled;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
var eventTypesForDefaultValues = [
|
|
152
|
+
var eventTypesForDefaultValues = [
|
|
153
|
+
EventType.click,
|
|
154
|
+
EventType.custom,
|
|
155
|
+
EventType.search,
|
|
156
|
+
EventType.view,
|
|
157
|
+
];
|
|
153
158
|
var addDefaultValues = function (eventType, payload) {
|
|
154
159
|
return eventTypesForDefaultValues.indexOf(eventType) !== -1
|
|
155
160
|
? __assign({ language: hasDocument() ? document.documentElement.lang : 'unknown', userAgent: hasNavigator() ? navigator.userAgent : 'unknown' }, payload) : payload;
|
|
@@ -196,7 +201,8 @@
|
|
|
196
201
|
"".concat(name, "=").concat(value) +
|
|
197
202
|
(expirationDate ? ";expires=".concat(expirationDate.toUTCString()) : '') +
|
|
198
203
|
(domain ? ";domain=".concat(domain) : '') +
|
|
199
|
-
';path=/;SameSite=Lax'
|
|
204
|
+
';path=/;SameSite=Lax' +
|
|
205
|
+
(window.location.protocol === 'https:' ? ';Secure' : '');
|
|
200
206
|
}
|
|
201
207
|
|
|
202
208
|
var preferredStorage = null;
|
|
@@ -399,7 +405,7 @@
|
|
|
399
405
|
HistoryStore.prototype.isValidEntry = function (elem) {
|
|
400
406
|
var lastEntry = this.getMostRecentElement();
|
|
401
407
|
if (lastEntry && lastEntry.value == elem.value) {
|
|
402
|
-
return (elem.internalTime || 0) - (lastEntry.internalTime || 0) > MIN_THRESHOLD_FOR_DUPLICATE_VALUE;
|
|
408
|
+
return ((elem.internalTime || 0) - (lastEntry.internalTime || 0) > MIN_THRESHOLD_FOR_DUPLICATE_VALUE);
|
|
403
409
|
}
|
|
404
410
|
return true;
|
|
405
411
|
};
|
|
@@ -414,7 +420,10 @@
|
|
|
414
420
|
};
|
|
415
421
|
HistoryStore.prototype.stripEmptyQuery = function (part) {
|
|
416
422
|
var name = part.name, time = part.time, value = part.value;
|
|
417
|
-
if (name &&
|
|
423
|
+
if (name &&
|
|
424
|
+
typeof value === 'string' &&
|
|
425
|
+
name.toLowerCase() === 'query' &&
|
|
426
|
+
value.trim() === '') {
|
|
418
427
|
return { name: name, time: time };
|
|
419
428
|
}
|
|
420
429
|
return part;
|
|
@@ -468,272 +477,194 @@
|
|
|
468
477
|
});
|
|
469
478
|
}); };
|
|
470
479
|
|
|
471
|
-
|
|
472
|
-
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
473
|
-
// generators (like Math.random()).
|
|
474
|
-
let getRandomValues;
|
|
475
|
-
const rnds8 = new Uint8Array(16);
|
|
476
|
-
function rng() {
|
|
477
|
-
// lazy load so that environments that need to polyfill have a chance to do so
|
|
478
|
-
if (!getRandomValues) {
|
|
479
|
-
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
|
|
480
|
-
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
481
|
-
|
|
482
|
-
if (!getRandomValues) {
|
|
483
|
-
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
return getRandomValues(rnds8);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
480
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
491
481
|
|
|
492
482
|
function validate(uuid) {
|
|
493
|
-
|
|
483
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
494
484
|
}
|
|
495
485
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
486
|
+
function parse(uuid) {
|
|
487
|
+
if (!validate(uuid)) {
|
|
488
|
+
throw TypeError('Invalid UUID');
|
|
489
|
+
}
|
|
490
|
+
let v;
|
|
491
|
+
return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff);
|
|
492
|
+
}
|
|
500
493
|
|
|
501
494
|
const byteToHex = [];
|
|
502
|
-
|
|
503
495
|
for (let i = 0; i < 256; ++i) {
|
|
504
|
-
|
|
496
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
505
497
|
}
|
|
506
|
-
|
|
507
498
|
function unsafeStringify(arr, offset = 0) {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
499
|
+
return (byteToHex[arr[offset + 0]] +
|
|
500
|
+
byteToHex[arr[offset + 1]] +
|
|
501
|
+
byteToHex[arr[offset + 2]] +
|
|
502
|
+
byteToHex[arr[offset + 3]] +
|
|
503
|
+
'-' +
|
|
504
|
+
byteToHex[arr[offset + 4]] +
|
|
505
|
+
byteToHex[arr[offset + 5]] +
|
|
506
|
+
'-' +
|
|
507
|
+
byteToHex[arr[offset + 6]] +
|
|
508
|
+
byteToHex[arr[offset + 7]] +
|
|
509
|
+
'-' +
|
|
510
|
+
byteToHex[arr[offset + 8]] +
|
|
511
|
+
byteToHex[arr[offset + 9]] +
|
|
512
|
+
'-' +
|
|
513
|
+
byteToHex[arr[offset + 10]] +
|
|
514
|
+
byteToHex[arr[offset + 11]] +
|
|
515
|
+
byteToHex[arr[offset + 12]] +
|
|
516
|
+
byteToHex[arr[offset + 13]] +
|
|
517
|
+
byteToHex[arr[offset + 14]] +
|
|
518
|
+
byteToHex[arr[offset + 15]]).toLowerCase();
|
|
511
519
|
}
|
|
512
520
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
let v;
|
|
519
|
-
const arr = new Uint8Array(16); // Parse ########-....-....-....-............
|
|
520
|
-
|
|
521
|
-
arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
|
|
522
|
-
arr[1] = v >>> 16 & 0xff;
|
|
523
|
-
arr[2] = v >>> 8 & 0xff;
|
|
524
|
-
arr[3] = v & 0xff; // Parse ........-####-....-....-............
|
|
525
|
-
|
|
526
|
-
arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
|
|
527
|
-
arr[5] = v & 0xff; // Parse ........-....-####-....-............
|
|
528
|
-
|
|
529
|
-
arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
|
|
530
|
-
arr[7] = v & 0xff; // Parse ........-....-....-####-............
|
|
531
|
-
|
|
532
|
-
arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
|
|
533
|
-
arr[9] = v & 0xff; // Parse ........-....-....-....-############
|
|
534
|
-
// (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes)
|
|
535
|
-
|
|
536
|
-
arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;
|
|
537
|
-
arr[11] = v / 0x100000000 & 0xff;
|
|
538
|
-
arr[12] = v >>> 24 & 0xff;
|
|
539
|
-
arr[13] = v >>> 16 & 0xff;
|
|
540
|
-
arr[14] = v >>> 8 & 0xff;
|
|
541
|
-
arr[15] = v & 0xff;
|
|
542
|
-
return arr;
|
|
521
|
+
const rnds8 = new Uint8Array(16);
|
|
522
|
+
function rng() {
|
|
523
|
+
return crypto.getRandomValues(rnds8);
|
|
543
524
|
}
|
|
544
525
|
|
|
545
526
|
function stringToBytes(str) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
bytes
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
return bytes;
|
|
527
|
+
str = unescape(encodeURIComponent(str));
|
|
528
|
+
const bytes = new Uint8Array(str.length);
|
|
529
|
+
for (let i = 0; i < str.length; ++i) {
|
|
530
|
+
bytes[i] = str.charCodeAt(i);
|
|
531
|
+
}
|
|
532
|
+
return bytes;
|
|
555
533
|
}
|
|
556
|
-
|
|
557
534
|
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
|
|
558
535
|
const URL$1 = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';
|
|
559
|
-
function v35(
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (typeof value === 'string') {
|
|
564
|
-
value = stringToBytes(value);
|
|
565
|
-
}
|
|
566
|
-
|
|
536
|
+
function v35(version, hash, value, namespace, buf, offset) {
|
|
537
|
+
const valueBytes = typeof value === 'string' ? stringToBytes(value) : value;
|
|
538
|
+
const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace;
|
|
567
539
|
if (typeof namespace === 'string') {
|
|
568
|
-
|
|
540
|
+
namespace = parse(namespace);
|
|
569
541
|
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
bytes.set(namespace);
|
|
580
|
-
bytes.set(value, namespace.length);
|
|
581
|
-
bytes = hashfunc(bytes);
|
|
582
|
-
bytes[6] = bytes[6] & 0x0f | version;
|
|
583
|
-
bytes[8] = bytes[8] & 0x3f | 0x80;
|
|
584
|
-
|
|
542
|
+
if (namespace?.length !== 16) {
|
|
543
|
+
throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');
|
|
544
|
+
}
|
|
545
|
+
let bytes = new Uint8Array(16 + valueBytes.length);
|
|
546
|
+
bytes.set(namespaceBytes);
|
|
547
|
+
bytes.set(valueBytes, namespaceBytes.length);
|
|
548
|
+
bytes = hash(bytes);
|
|
549
|
+
bytes[6] = (bytes[6] & 0x0f) | version;
|
|
550
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
585
551
|
if (buf) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
552
|
+
offset ??= 0;
|
|
553
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
554
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
555
|
+
}
|
|
556
|
+
for (let i = 0; i < 16; ++i) {
|
|
557
|
+
buf[offset + i] = bytes[i];
|
|
558
|
+
}
|
|
559
|
+
return buf;
|
|
593
560
|
}
|
|
594
|
-
|
|
595
561
|
return unsafeStringify(bytes);
|
|
596
|
-
} // Function#name is not settable on some platforms (#270)
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
try {
|
|
600
|
-
generateUUID.name = name; // eslint-disable-next-line no-empty
|
|
601
|
-
} catch (err) {} // For CommonJS default export support
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
generateUUID.DNS = DNS;
|
|
605
|
-
generateUUID.URL = URL$1;
|
|
606
|
-
return generateUUID;
|
|
607
562
|
}
|
|
608
563
|
|
|
609
|
-
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
610
|
-
var native = {
|
|
611
|
-
randomUUID
|
|
612
|
-
};
|
|
613
|
-
|
|
614
564
|
function v4(options, buf, offset) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
options = options || {};
|
|
620
|
-
const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
621
|
-
|
|
622
|
-
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
623
|
-
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
624
|
-
|
|
625
|
-
if (buf) {
|
|
626
|
-
offset = offset || 0;
|
|
627
|
-
|
|
628
|
-
for (let i = 0; i < 16; ++i) {
|
|
629
|
-
buf[offset + i] = rnds[i];
|
|
565
|
+
if (!buf && !options && crypto.randomUUID) {
|
|
566
|
+
return crypto.randomUUID();
|
|
630
567
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
568
|
+
return _v4(options, buf, offset);
|
|
569
|
+
}
|
|
570
|
+
function _v4(options, buf, offset) {
|
|
571
|
+
options = options || {};
|
|
572
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
573
|
+
if (rnds.length < 16) {
|
|
574
|
+
throw new Error('Random bytes length must be >= 16');
|
|
575
|
+
}
|
|
576
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
577
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
578
|
+
if (buf) {
|
|
579
|
+
offset = offset || 0;
|
|
580
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
581
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
582
|
+
}
|
|
583
|
+
for (let i = 0; i < 16; ++i) {
|
|
584
|
+
buf[offset + i] = rnds[i];
|
|
585
|
+
}
|
|
586
|
+
return buf;
|
|
587
|
+
}
|
|
588
|
+
return unsafeStringify(rnds);
|
|
636
589
|
}
|
|
637
590
|
|
|
638
|
-
// Adapted from Chris Veness' SHA1 code at
|
|
639
|
-
// http://www.movable-type.co.uk/scripts/sha1.html
|
|
640
591
|
function f(s, x, y, z) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
case 3:
|
|
652
|
-
return x ^ y ^ z;
|
|
653
|
-
}
|
|
592
|
+
switch (s) {
|
|
593
|
+
case 0:
|
|
594
|
+
return (x & y) ^ (~x & z);
|
|
595
|
+
case 1:
|
|
596
|
+
return x ^ y ^ z;
|
|
597
|
+
case 2:
|
|
598
|
+
return (x & y) ^ (x & z) ^ (y & z);
|
|
599
|
+
case 3:
|
|
600
|
+
return x ^ y ^ z;
|
|
601
|
+
}
|
|
654
602
|
}
|
|
655
|
-
|
|
656
603
|
function ROTL(x, n) {
|
|
657
|
-
|
|
604
|
+
return (x << n) | (x >>> (32 - n));
|
|
658
605
|
}
|
|
659
|
-
|
|
660
606
|
function sha1(bytes) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
const M = new Array(N);
|
|
681
|
-
|
|
682
|
-
for (let i = 0; i < N; ++i) {
|
|
683
|
-
const arr = new Uint32Array(16);
|
|
684
|
-
|
|
685
|
-
for (let j = 0; j < 16; ++j) {
|
|
686
|
-
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
M[i] = arr;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
|
693
|
-
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
694
|
-
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
|
695
|
-
|
|
696
|
-
for (let i = 0; i < N; ++i) {
|
|
697
|
-
const W = new Uint32Array(80);
|
|
698
|
-
|
|
699
|
-
for (let t = 0; t < 16; ++t) {
|
|
700
|
-
W[t] = M[i][t];
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
for (let t = 16; t < 80; ++t) {
|
|
704
|
-
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
607
|
+
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
|
608
|
+
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
|
609
|
+
const newBytes = new Uint8Array(bytes.length + 1);
|
|
610
|
+
newBytes.set(bytes);
|
|
611
|
+
newBytes[bytes.length] = 0x80;
|
|
612
|
+
bytes = newBytes;
|
|
613
|
+
const l = bytes.length / 4 + 2;
|
|
614
|
+
const N = Math.ceil(l / 16);
|
|
615
|
+
const M = new Array(N);
|
|
616
|
+
for (let i = 0; i < N; ++i) {
|
|
617
|
+
const arr = new Uint32Array(16);
|
|
618
|
+
for (let j = 0; j < 16; ++j) {
|
|
619
|
+
arr[j] =
|
|
620
|
+
(bytes[i * 64 + j * 4] << 24) |
|
|
621
|
+
(bytes[i * 64 + j * 4 + 1] << 16) |
|
|
622
|
+
(bytes[i * 64 + j * 4 + 2] << 8) |
|
|
623
|
+
bytes[i * 64 + j * 4 + 3];
|
|
624
|
+
}
|
|
625
|
+
M[i] = arr;
|
|
705
626
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
let
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
627
|
+
M[N - 1][14] = ((bytes.length - 1) * 8) / 2 ** 32;
|
|
628
|
+
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
|
629
|
+
M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff;
|
|
630
|
+
for (let i = 0; i < N; ++i) {
|
|
631
|
+
const W = new Uint32Array(80);
|
|
632
|
+
for (let t = 0; t < 16; ++t) {
|
|
633
|
+
W[t] = M[i][t];
|
|
634
|
+
}
|
|
635
|
+
for (let t = 16; t < 80; ++t) {
|
|
636
|
+
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
|
637
|
+
}
|
|
638
|
+
let a = H[0];
|
|
639
|
+
let b = H[1];
|
|
640
|
+
let c = H[2];
|
|
641
|
+
let d = H[3];
|
|
642
|
+
let e = H[4];
|
|
643
|
+
for (let t = 0; t < 80; ++t) {
|
|
644
|
+
const s = Math.floor(t / 20);
|
|
645
|
+
const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0;
|
|
646
|
+
e = d;
|
|
647
|
+
d = c;
|
|
648
|
+
c = ROTL(b, 30) >>> 0;
|
|
649
|
+
b = a;
|
|
650
|
+
a = T;
|
|
651
|
+
}
|
|
652
|
+
H[0] = (H[0] + a) >>> 0;
|
|
653
|
+
H[1] = (H[1] + b) >>> 0;
|
|
654
|
+
H[2] = (H[2] + c) >>> 0;
|
|
655
|
+
H[3] = (H[3] + d) >>> 0;
|
|
656
|
+
H[4] = (H[4] + e) >>> 0;
|
|
721
657
|
}
|
|
722
|
-
|
|
723
|
-
H[0] = H[0] + a >>> 0;
|
|
724
|
-
H[1] = H[1] + b >>> 0;
|
|
725
|
-
H[2] = H[2] + c >>> 0;
|
|
726
|
-
H[3] = H[3] + d >>> 0;
|
|
727
|
-
H[4] = H[4] + e >>> 0;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
|
658
|
+
return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]);
|
|
731
659
|
}
|
|
732
660
|
|
|
733
|
-
|
|
734
|
-
|
|
661
|
+
function v5(value, namespace, buf, offset) {
|
|
662
|
+
return v35(0x50, sha1, value, namespace, buf, offset);
|
|
663
|
+
}
|
|
664
|
+
v5.DNS = DNS;
|
|
665
|
+
v5.URL = URL$1;
|
|
735
666
|
|
|
736
|
-
var libVersion = "2.
|
|
667
|
+
var libVersion = "2.32.0";
|
|
737
668
|
|
|
738
669
|
var getFormattedLocation = function (location) {
|
|
739
670
|
return "".concat(location.protocol, "//").concat(location.hostname).concat(location.pathname.indexOf('/') === 0 ? location.pathname : "/".concat(location.pathname)).concat(location.search);
|
|
@@ -828,7 +759,7 @@
|
|
|
828
759
|
};
|
|
829
760
|
};
|
|
830
761
|
BasePlugin.prototype.getCurrentLocationFromPayload = function (payload) {
|
|
831
|
-
if (
|
|
762
|
+
if (payload.page) {
|
|
832
763
|
var removeStartingSlash = function (page) { return page.replace(/^\/?(.*)$/, '/$1'); };
|
|
833
764
|
var extractHostnamePart = function (location) { return location.split('/').slice(0, 3).join('/'); };
|
|
834
765
|
return "".concat(extractHostnamePart(this.currentLocation)).concat(removeStartingSlash(payload.page));
|
|
@@ -1212,7 +1143,9 @@
|
|
|
1212
1143
|
}, {});
|
|
1213
1144
|
};
|
|
1214
1145
|
var measurementProtocolKeysMappingValues = keysOf(measurementProtocolKeysMapping).map(function (key) { return measurementProtocolKeysMapping[key]; });
|
|
1215
|
-
var isKnownMeasurementProtocolKey = function (key) {
|
|
1146
|
+
var isKnownMeasurementProtocolKey = function (key) {
|
|
1147
|
+
return measurementProtocolKeysMappingValues.indexOf(key) !== -1;
|
|
1148
|
+
};
|
|
1216
1149
|
var isCustomKey = function (key) { return key === 'custom'; };
|
|
1217
1150
|
var isMeasurementProtocolKey = function (key) {
|
|
1218
1151
|
return __spreadArray(__spreadArray(__spreadArray([], isCommerceKey, true), isServiceKey, true), [isKnownMeasurementProtocolKey, isCustomKey], false).some(function (test) { return test(key); });
|
|
@@ -1234,7 +1167,7 @@
|
|
|
1234
1167
|
__spreadArray([], isCustomCommerceKey, true).every(function (regex) {
|
|
1235
1168
|
var _a;
|
|
1236
1169
|
matchedKey = (_a = regex.exec(key)) === null || _a === void 0 ? void 0 : _a[1];
|
|
1237
|
-
return !
|
|
1170
|
+
return !matchedKey;
|
|
1238
1171
|
});
|
|
1239
1172
|
return matchedKey;
|
|
1240
1173
|
};
|
|
@@ -1337,7 +1270,8 @@
|
|
|
1337
1270
|
});
|
|
1338
1271
|
};
|
|
1339
1272
|
AnalyticsBeaconClient.prototype.isEventTypeLegacy = function (eventType) {
|
|
1340
|
-
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !==
|
|
1273
|
+
return ([EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !==
|
|
1274
|
+
-1);
|
|
1341
1275
|
};
|
|
1342
1276
|
AnalyticsBeaconClient.prototype.encodeEventToJson = function (eventType, payload, access_token) {
|
|
1343
1277
|
var encoded = "".concat(eventType, "Event=").concat(encodeURIComponent(JSON.stringify(payload)));
|
|
@@ -1369,7 +1303,9 @@
|
|
|
1369
1303
|
return NoopAnalyticsClient;
|
|
1370
1304
|
}());
|
|
1371
1305
|
|
|
1372
|
-
|
|
1306
|
+
// This file is to prevent including a fetch polyfill from the "cross-fetch" dependency when building for a browser target.
|
|
1307
|
+
// Major browsers today provide fetch on the window object, so including a polyfill would needlessly increase the size of the bundle.
|
|
1308
|
+
const fetch$2 = globalThis.fetch;
|
|
1373
1309
|
|
|
1374
1310
|
var AnalyticsFetchClient = (function () {
|
|
1375
1311
|
function AnalyticsFetchClient(opts) {
|
|
@@ -1420,7 +1356,7 @@
|
|
|
1420
1356
|
return [3, 10];
|
|
1421
1357
|
case 9:
|
|
1422
1358
|
error_1 = _f.sent();
|
|
1423
|
-
console.error('An error has
|
|
1359
|
+
console.error('An error has occurred when sending the event.', error_1);
|
|
1424
1360
|
return [2];
|
|
1425
1361
|
case 10:
|
|
1426
1362
|
if (!response.ok) return [3, 12];
|
|
@@ -1437,7 +1373,7 @@
|
|
|
1437
1373
|
}
|
|
1438
1374
|
catch (_g) {
|
|
1439
1375
|
}
|
|
1440
|
-
console.error("An error has
|
|
1376
|
+
console.error("An error has occurred when sending the \"".concat(eventType, "\" event."), response, payload);
|
|
1441
1377
|
throw new Error("An error has occurred when sending the \"".concat(eventType, "\" event. Check the console logs for more details."));
|
|
1442
1378
|
}
|
|
1443
1379
|
});
|
|
@@ -1460,7 +1396,8 @@
|
|
|
1460
1396
|
});
|
|
1461
1397
|
};
|
|
1462
1398
|
AnalyticsFetchClient.prototype.shouldAppendVisitorId = function (eventType) {
|
|
1463
|
-
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !==
|
|
1399
|
+
return ([EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !==
|
|
1400
|
+
-1);
|
|
1464
1401
|
};
|
|
1465
1402
|
AnalyticsFetchClient.prototype.getVisitorIdParam = function () {
|
|
1466
1403
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1508,7 +1445,9 @@
|
|
|
1508
1445
|
});
|
|
1509
1446
|
}
|
|
1510
1447
|
BrowserRuntime.prototype.getClientDependingOnEventType = function (eventType) {
|
|
1511
|
-
return eventType === 'click' && this.beaconClient.isAvailable()
|
|
1448
|
+
return eventType === 'click' && this.beaconClient.isAvailable()
|
|
1449
|
+
? this.beaconClient
|
|
1450
|
+
: this.client;
|
|
1512
1451
|
};
|
|
1513
1452
|
return BrowserRuntime;
|
|
1514
1453
|
}());
|
|
@@ -1552,11 +1491,18 @@
|
|
|
1552
1491
|
}
|
|
1553
1492
|
return checks.some(function (value) { return doNotTrackValues.indexOf(value) !== -1; });
|
|
1554
1493
|
}
|
|
1494
|
+
function shouldDisableAnalyticsForPrivacy(disableBrowserPrivacySignals) {
|
|
1495
|
+
if (disableBrowserPrivacySignals === true) {
|
|
1496
|
+
return false;
|
|
1497
|
+
}
|
|
1498
|
+
return doNotTrack();
|
|
1499
|
+
}
|
|
1555
1500
|
|
|
1556
1501
|
var donottrack = /*#__PURE__*/Object.freeze({
|
|
1557
1502
|
__proto__: null,
|
|
1558
1503
|
default: doNotTrack,
|
|
1559
|
-
doNotTrack: doNotTrack
|
|
1504
|
+
doNotTrack: doNotTrack,
|
|
1505
|
+
shouldDisableAnalyticsForPrivacy: shouldDisableAnalyticsForPrivacy
|
|
1560
1506
|
});
|
|
1561
1507
|
|
|
1562
1508
|
var Version = 'v15';
|
|
@@ -1595,16 +1541,28 @@
|
|
|
1595
1541
|
visitorIdProvider: this,
|
|
1596
1542
|
preprocessRequest: this.options.preprocessRequest,
|
|
1597
1543
|
};
|
|
1598
|
-
if (
|
|
1544
|
+
if (shouldDisableAnalyticsForPrivacy(this.options.disableBrowserPrivacySignals)) {
|
|
1599
1545
|
this.runtime = new NoopRuntime();
|
|
1600
1546
|
}
|
|
1601
1547
|
else {
|
|
1602
1548
|
this.runtime = this.options.runtimeEnvironment || this.initRuntime(clientsOptions);
|
|
1603
1549
|
}
|
|
1604
|
-
this.addEventTypeMapping(EventType.view, {
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1550
|
+
this.addEventTypeMapping(EventType.view, {
|
|
1551
|
+
newEventType: EventType.view,
|
|
1552
|
+
addClientIdParameter: true,
|
|
1553
|
+
});
|
|
1554
|
+
this.addEventTypeMapping(EventType.click, {
|
|
1555
|
+
newEventType: EventType.click,
|
|
1556
|
+
addClientIdParameter: true,
|
|
1557
|
+
});
|
|
1558
|
+
this.addEventTypeMapping(EventType.custom, {
|
|
1559
|
+
newEventType: EventType.custom,
|
|
1560
|
+
addClientIdParameter: true,
|
|
1561
|
+
});
|
|
1562
|
+
this.addEventTypeMapping(EventType.search, {
|
|
1563
|
+
newEventType: EventType.search,
|
|
1564
|
+
addClientIdParameter: true,
|
|
1565
|
+
});
|
|
1608
1566
|
}
|
|
1609
1567
|
Object.defineProperty(CoveoAnalyticsClient.prototype, "defaultOptions", {
|
|
1610
1568
|
get: function () {
|
|
@@ -1715,7 +1673,7 @@
|
|
|
1715
1673
|
if (!namespace) {
|
|
1716
1674
|
throw Error('Cannot generate uuid client id without a specific namespace string.');
|
|
1717
1675
|
}
|
|
1718
|
-
this.setCurrentVisitorId(
|
|
1676
|
+
this.setCurrentVisitorId(v5(value, v5(namespace, COVEO_NAMESPACE)));
|
|
1719
1677
|
}
|
|
1720
1678
|
return [2];
|
|
1721
1679
|
});
|
|
@@ -1769,7 +1727,7 @@
|
|
|
1769
1727
|
configurable: true
|
|
1770
1728
|
});
|
|
1771
1729
|
CoveoAnalyticsClient.prototype.extractClientIdFromLink = function (urlString) {
|
|
1772
|
-
if (
|
|
1730
|
+
if (shouldDisableAnalyticsForPrivacy(this.options.disableBrowserPrivacySignals)) {
|
|
1773
1731
|
return null;
|
|
1774
1732
|
}
|
|
1775
1733
|
try {
|
|
@@ -1778,7 +1736,9 @@
|
|
|
1778
1736
|
return null;
|
|
1779
1737
|
}
|
|
1780
1738
|
var linker = CoveoLinkParam.fromString(linkParam);
|
|
1781
|
-
if (!linker ||
|
|
1739
|
+
if (!linker ||
|
|
1740
|
+
!hasDocument() ||
|
|
1741
|
+
!linker.validate(document.referrer, this.acceptedLinkReferrers)) {
|
|
1782
1742
|
return null;
|
|
1783
1743
|
}
|
|
1784
1744
|
return linker.clientId;
|
|
@@ -1840,7 +1800,9 @@
|
|
|
1840
1800
|
});
|
|
1841
1801
|
}); };
|
|
1842
1802
|
setAnonymousUserStep = function (currentPayload) {
|
|
1843
|
-
return usesMeasurementProtocol
|
|
1803
|
+
return usesMeasurementProtocol
|
|
1804
|
+
? _this.ensureAnonymousUserWhenUsingApiKey(currentPayload)
|
|
1805
|
+
: currentPayload;
|
|
1844
1806
|
};
|
|
1845
1807
|
processBeforeSendHooksStep = function (currentPayload) {
|
|
1846
1808
|
return _this.beforeSendHooks.reduce(function (promisePayload, current) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -1895,7 +1857,9 @@
|
|
|
1895
1857
|
cleanPayloadStep = function (currentPayload) {
|
|
1896
1858
|
return _this.removeEmptyPayloadValues(currentPayload, eventType);
|
|
1897
1859
|
};
|
|
1898
|
-
validateParams = function (currentPayload) {
|
|
1860
|
+
validateParams = function (currentPayload) {
|
|
1861
|
+
return _this.validateParams(currentPayload, eventType);
|
|
1862
|
+
};
|
|
1899
1863
|
processMeasurementProtocolConversionStep = function (currentPayload) {
|
|
1900
1864
|
return usesMeasurementProtocol ? convertKeysToMeasurementProtocol(currentPayload) : currentPayload;
|
|
1901
1865
|
};
|
|
@@ -1962,7 +1926,9 @@
|
|
|
1962
1926
|
eventType: eventTypeToSend,
|
|
1963
1927
|
payload: __assign(__assign({}, payloadToSend), remainingPayload),
|
|
1964
1928
|
});
|
|
1965
|
-
return [4, Promise.all(this.afterSendHooks.map(function (hook) {
|
|
1929
|
+
return [4, Promise.all(this.afterSendHooks.map(function (hook) {
|
|
1930
|
+
return hook(eventType, __assign(__assign({}, parametersToSend), remainingPayload));
|
|
1931
|
+
}))];
|
|
1966
1932
|
case 1:
|
|
1967
1933
|
_a.sent();
|
|
1968
1934
|
return [4, this.deferExecution()];
|
|
@@ -2065,7 +2031,9 @@
|
|
|
2065
2031
|
return __generator(this, function (_b) {
|
|
2066
2032
|
switch (_b.label) {
|
|
2067
2033
|
case 0: return [4, this.makeCustomEvent(preparedRequest)];
|
|
2068
|
-
case 1: return [2, (_b.sent()).log({
|
|
2034
|
+
case 1: return [2, (_b.sent()).log({
|
|
2035
|
+
lastSearchQueryUid: lastSearchQueryUid,
|
|
2036
|
+
})];
|
|
2069
2037
|
}
|
|
2070
2038
|
});
|
|
2071
2039
|
});
|
|
@@ -2156,7 +2124,9 @@
|
|
|
2156
2124
|
};
|
|
2157
2125
|
CoveoAnalyticsClient.prototype.removeEmptyPayloadValues = function (payload, eventType) {
|
|
2158
2126
|
var _this = this;
|
|
2159
|
-
var isNotEmptyValue = function (value) {
|
|
2127
|
+
var isNotEmptyValue = function (value) {
|
|
2128
|
+
return typeof value !== 'undefined' && value !== null && value !== '';
|
|
2129
|
+
};
|
|
2160
2130
|
return Object.keys(payload)
|
|
2161
2131
|
.filter(function (key) { return _this.isKeyAllowedEmpty(eventType, key) || isNotEmptyValue(payload[key]); })
|
|
2162
2132
|
.reduce(function (newPayload, key) {
|
|
@@ -2251,7 +2221,8 @@
|
|
|
2251
2221
|
}
|
|
2252
2222
|
}
|
|
2253
2223
|
if (rest.hasOwnProperty('customData') && isObject(rest.customData)) {
|
|
2254
|
-
if (rest.customData.hasOwnProperty('context_website') ||
|
|
2224
|
+
if (rest.customData.hasOwnProperty('context_website') ||
|
|
2225
|
+
rest.customData.hasOwnProperty('siteName')) {
|
|
2255
2226
|
rest['trackingId'] = rest.customData.context_website || rest.customData.siteName;
|
|
2256
2227
|
}
|
|
2257
2228
|
}
|
|
@@ -2326,7 +2297,9 @@
|
|
|
2326
2297
|
_a[_i - 1] = arguments[_i];
|
|
2327
2298
|
}
|
|
2328
2299
|
var payload = _a[0];
|
|
2329
|
-
return allECEventTypes.indexOf(eventType) !== -1
|
|
2300
|
+
return allECEventTypes.indexOf(eventType) !== -1
|
|
2301
|
+
? _this.addECDataToPayload(eventType, payload)
|
|
2302
|
+
: payload;
|
|
2330
2303
|
});
|
|
2331
2304
|
this.client.registerAfterSendEventHook(function (eventType) {
|
|
2332
2305
|
var _a = [];
|
|
@@ -2398,7 +2371,8 @@
|
|
|
2398
2371
|
ECPlugin.prototype.assureProductValidity = function (product) {
|
|
2399
2372
|
var position = product.position, productRest = __rest(product, ["position"]);
|
|
2400
2373
|
if (position !== undefined && position < 1) {
|
|
2401
|
-
console.warn("The position for product '".concat(product.name || product.id, "' must be greater ") +
|
|
2374
|
+
console.warn("The position for product '".concat(product.name || product.id, "' must be greater ") +
|
|
2375
|
+
"than 0 when provided.");
|
|
2402
2376
|
return productRest;
|
|
2403
2377
|
}
|
|
2404
2378
|
return product;
|
|
@@ -2470,7 +2444,9 @@
|
|
|
2470
2444
|
_a[_i - 1] = arguments[_i];
|
|
2471
2445
|
}
|
|
2472
2446
|
var payload = _a[0];
|
|
2473
|
-
return allSVCEventTypes.indexOf(eventType) !== -1
|
|
2447
|
+
return allSVCEventTypes.indexOf(eventType) !== -1
|
|
2448
|
+
? _this.addSVCDataToPayload(eventType, payload)
|
|
2449
|
+
: payload;
|
|
2474
2450
|
});
|
|
2475
2451
|
this.client.registerAfterSendEventHook(function (eventType) {
|
|
2476
2452
|
var _a = [];
|
|
@@ -2599,7 +2575,9 @@
|
|
|
2599
2575
|
if (typeof optionsOrEndpoint === 'string') {
|
|
2600
2576
|
return Plugins.DefaultPlugins;
|
|
2601
2577
|
}
|
|
2602
|
-
return Array.isArray(optionsOrEndpoint === null || optionsOrEndpoint === void 0 ? void 0 : optionsOrEndpoint.plugins)
|
|
2578
|
+
return Array.isArray(optionsOrEndpoint === null || optionsOrEndpoint === void 0 ? void 0 : optionsOrEndpoint.plugins)
|
|
2579
|
+
? optionsOrEndpoint.plugins
|
|
2580
|
+
: Plugins.DefaultPlugins;
|
|
2603
2581
|
};
|
|
2604
2582
|
CoveoUA.prototype.getEndpoint = function (optionsOrEndpoint) {
|
|
2605
2583
|
if (typeof optionsOrEndpoint === 'string') {
|
|
@@ -2908,7 +2886,11 @@
|
|
|
2908
2886
|
return Promise.resolve();
|
|
2909
2887
|
};
|
|
2910
2888
|
NoopAnalytics.prototype.makeEvent = function (eventType) {
|
|
2911
|
-
return Promise.resolve({
|
|
2889
|
+
return Promise.resolve({
|
|
2890
|
+
eventType: eventType,
|
|
2891
|
+
payload: null,
|
|
2892
|
+
log: function () { return Promise.resolve(); },
|
|
2893
|
+
});
|
|
2912
2894
|
};
|
|
2913
2895
|
NoopAnalytics.prototype.sendEvent = function () {
|
|
2914
2896
|
return Promise.resolve();
|
|
@@ -2987,7 +2969,9 @@
|
|
|
2987
2969
|
var partialQueries = typeof meta.partialQueries === 'string'
|
|
2988
2970
|
? meta.partialQueries
|
|
2989
2971
|
: formatArrayForCoveoCustomData(meta.partialQueries);
|
|
2990
|
-
var suggestions = typeof meta.suggestions === 'string'
|
|
2972
|
+
var suggestions = typeof meta.suggestions === 'string'
|
|
2973
|
+
? meta.suggestions
|
|
2974
|
+
: formatArrayForCoveoCustomData(meta.suggestions);
|
|
2991
2975
|
return __assign(__assign({}, meta), { partialQueries: partialQueries, suggestions: suggestions });
|
|
2992
2976
|
}
|
|
2993
2977
|
|
|
@@ -2995,8 +2979,11 @@
|
|
|
2995
2979
|
function CoveoSearchPageClient(opts, provider) {
|
|
2996
2980
|
this.opts = opts;
|
|
2997
2981
|
this.provider = provider;
|
|
2998
|
-
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
2999
|
-
|
|
2982
|
+
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
2983
|
+
shouldDisableAnalyticsForPrivacy(opts.disableBrowserPrivacySignals);
|
|
2984
|
+
this.coveoAnalyticsClient = shouldDisableAnalytics
|
|
2985
|
+
? new NoopAnalytics()
|
|
2986
|
+
: new CoveoAnalyticsClient(opts);
|
|
3000
2987
|
}
|
|
3001
2988
|
CoveoSearchPageClient.prototype.disable = function () {
|
|
3002
2989
|
this.coveoAnalyticsClient = new NoopAnalytics();
|
|
@@ -3012,7 +2999,9 @@
|
|
|
3012
2999
|
return __generator(this, function (_a) {
|
|
3013
3000
|
switch (_a.label) {
|
|
3014
3001
|
case 0: return [4, this.makeInterfaceLoad()];
|
|
3015
|
-
case 1: return [2, (_a.sent()).log({
|
|
3002
|
+
case 1: return [2, (_a.sent()).log({
|
|
3003
|
+
searchUID: this.provider.getSearchUID(),
|
|
3004
|
+
})];
|
|
3016
3005
|
}
|
|
3017
3006
|
});
|
|
3018
3007
|
});
|
|
@@ -3025,7 +3014,9 @@
|
|
|
3025
3014
|
return __generator(this, function (_a) {
|
|
3026
3015
|
switch (_a.label) {
|
|
3027
3016
|
case 0: return [4, this.makeRecommendationInterfaceLoad()];
|
|
3028
|
-
case 1: return [2, (_a.sent()).log({
|
|
3017
|
+
case 1: return [2, (_a.sent()).log({
|
|
3018
|
+
searchUID: this.provider.getSearchUID(),
|
|
3019
|
+
})];
|
|
3029
3020
|
}
|
|
3030
3021
|
});
|
|
3031
3022
|
});
|
|
@@ -3038,7 +3029,9 @@
|
|
|
3038
3029
|
return __generator(this, function (_a) {
|
|
3039
3030
|
switch (_a.label) {
|
|
3040
3031
|
case 0: return [4, this.makeRecommendation()];
|
|
3041
|
-
case 1: return [2, (_a.sent()).log({
|
|
3032
|
+
case 1: return [2, (_a.sent()).log({
|
|
3033
|
+
searchUID: this.provider.getSearchUID(),
|
|
3034
|
+
})];
|
|
3042
3035
|
}
|
|
3043
3036
|
});
|
|
3044
3037
|
});
|
|
@@ -3051,7 +3044,9 @@
|
|
|
3051
3044
|
return __generator(this, function (_a) {
|
|
3052
3045
|
switch (_a.label) {
|
|
3053
3046
|
case 0: return [4, this.makeRecommendationOpen(info, identifier)];
|
|
3054
|
-
case 1: return [2, (_a.sent()).log({
|
|
3047
|
+
case 1: return [2, (_a.sent()).log({
|
|
3048
|
+
searchUID: this.provider.getSearchUID(),
|
|
3049
|
+
})];
|
|
3055
3050
|
}
|
|
3056
3051
|
});
|
|
3057
3052
|
});
|
|
@@ -3064,7 +3059,9 @@
|
|
|
3064
3059
|
return __generator(this, function (_a) {
|
|
3065
3060
|
switch (_a.label) {
|
|
3066
3061
|
case 0: return [4, this.makeStaticFilterClearAll(meta)];
|
|
3067
|
-
case 1: return [2, (_a.sent()).log({
|
|
3062
|
+
case 1: return [2, (_a.sent()).log({
|
|
3063
|
+
searchUID: this.provider.getSearchUID(),
|
|
3064
|
+
})];
|
|
3068
3065
|
}
|
|
3069
3066
|
});
|
|
3070
3067
|
});
|
|
@@ -3077,7 +3074,9 @@
|
|
|
3077
3074
|
return __generator(this, function (_a) {
|
|
3078
3075
|
switch (_a.label) {
|
|
3079
3076
|
case 0: return [4, this.makeStaticFilterSelect(meta)];
|
|
3080
|
-
case 1: return [2, (_a.sent()).log({
|
|
3077
|
+
case 1: return [2, (_a.sent()).log({
|
|
3078
|
+
searchUID: this.provider.getSearchUID(),
|
|
3079
|
+
})];
|
|
3081
3080
|
}
|
|
3082
3081
|
});
|
|
3083
3082
|
});
|
|
@@ -3090,20 +3089,26 @@
|
|
|
3090
3089
|
return __generator(this, function (_a) {
|
|
3091
3090
|
switch (_a.label) {
|
|
3092
3091
|
case 0: return [4, this.makeStaticFilterDeselect(meta)];
|
|
3093
|
-
case 1: return [2, (_a.sent()).log({
|
|
3092
|
+
case 1: return [2, (_a.sent()).log({
|
|
3093
|
+
searchUID: this.provider.getSearchUID(),
|
|
3094
|
+
})];
|
|
3094
3095
|
}
|
|
3095
3096
|
});
|
|
3096
3097
|
});
|
|
3097
3098
|
};
|
|
3098
3099
|
CoveoSearchPageClient.prototype.makeFetchMoreResults = function () {
|
|
3099
|
-
return this.makeCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
3100
|
+
return this.makeCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
3101
|
+
type: 'getMoreResults',
|
|
3102
|
+
});
|
|
3100
3103
|
};
|
|
3101
3104
|
CoveoSearchPageClient.prototype.logFetchMoreResults = function () {
|
|
3102
3105
|
return __awaiter(this, void 0, void 0, function () {
|
|
3103
3106
|
return __generator(this, function (_a) {
|
|
3104
3107
|
switch (_a.label) {
|
|
3105
3108
|
case 0: return [4, this.makeFetchMoreResults()];
|
|
3106
|
-
case 1: return [2, (_a.sent()).log({
|
|
3109
|
+
case 1: return [2, (_a.sent()).log({
|
|
3110
|
+
searchUID: this.provider.getSearchUID(),
|
|
3111
|
+
})];
|
|
3107
3112
|
}
|
|
3108
3113
|
});
|
|
3109
3114
|
});
|
|
@@ -3116,7 +3121,9 @@
|
|
|
3116
3121
|
return __generator(this, function (_a) {
|
|
3117
3122
|
switch (_a.label) {
|
|
3118
3123
|
case 0: return [4, this.makeInterfaceChange(metadata)];
|
|
3119
|
-
case 1: return [2, (_a.sent()).log({
|
|
3124
|
+
case 1: return [2, (_a.sent()).log({
|
|
3125
|
+
searchUID: this.provider.getSearchUID(),
|
|
3126
|
+
})];
|
|
3120
3127
|
}
|
|
3121
3128
|
});
|
|
3122
3129
|
});
|
|
@@ -3129,7 +3136,9 @@
|
|
|
3129
3136
|
return __generator(this, function (_a) {
|
|
3130
3137
|
switch (_a.label) {
|
|
3131
3138
|
case 0: return [4, this.makeDidYouMeanAutomatic()];
|
|
3132
|
-
case 1: return [2, (_a.sent()).log({
|
|
3139
|
+
case 1: return [2, (_a.sent()).log({
|
|
3140
|
+
searchUID: this.provider.getSearchUID(),
|
|
3141
|
+
})];
|
|
3133
3142
|
}
|
|
3134
3143
|
});
|
|
3135
3144
|
});
|
|
@@ -3142,7 +3151,9 @@
|
|
|
3142
3151
|
return __generator(this, function (_a) {
|
|
3143
3152
|
switch (_a.label) {
|
|
3144
3153
|
case 0: return [4, this.makeDidYouMeanClick()];
|
|
3145
|
-
case 1: return [2, (_a.sent()).log({
|
|
3154
|
+
case 1: return [2, (_a.sent()).log({
|
|
3155
|
+
searchUID: this.provider.getSearchUID(),
|
|
3156
|
+
})];
|
|
3146
3157
|
}
|
|
3147
3158
|
});
|
|
3148
3159
|
});
|
|
@@ -3155,7 +3166,9 @@
|
|
|
3155
3166
|
return __generator(this, function (_a) {
|
|
3156
3167
|
switch (_a.label) {
|
|
3157
3168
|
case 0: return [4, this.makeResultsSort(metadata)];
|
|
3158
|
-
case 1: return [2, (_a.sent()).log({
|
|
3169
|
+
case 1: return [2, (_a.sent()).log({
|
|
3170
|
+
searchUID: this.provider.getSearchUID(),
|
|
3171
|
+
})];
|
|
3159
3172
|
}
|
|
3160
3173
|
});
|
|
3161
3174
|
});
|
|
@@ -3168,7 +3181,9 @@
|
|
|
3168
3181
|
return __generator(this, function (_a) {
|
|
3169
3182
|
switch (_a.label) {
|
|
3170
3183
|
case 0: return [4, this.makeSearchboxSubmit()];
|
|
3171
|
-
case 1: return [2, (_a.sent()).log({
|
|
3184
|
+
case 1: return [2, (_a.sent()).log({
|
|
3185
|
+
searchUID: this.provider.getSearchUID(),
|
|
3186
|
+
})];
|
|
3172
3187
|
}
|
|
3173
3188
|
});
|
|
3174
3189
|
});
|
|
@@ -3181,7 +3196,9 @@
|
|
|
3181
3196
|
return __generator(this, function (_a) {
|
|
3182
3197
|
switch (_a.label) {
|
|
3183
3198
|
case 0: return [4, this.makeSearchboxClear()];
|
|
3184
|
-
case 1: return [2, (_a.sent()).log({
|
|
3199
|
+
case 1: return [2, (_a.sent()).log({
|
|
3200
|
+
searchUID: this.provider.getSearchUID(),
|
|
3201
|
+
})];
|
|
3185
3202
|
}
|
|
3186
3203
|
});
|
|
3187
3204
|
});
|
|
@@ -3194,7 +3211,9 @@
|
|
|
3194
3211
|
return __generator(this, function (_a) {
|
|
3195
3212
|
switch (_a.label) {
|
|
3196
3213
|
case 0: return [4, this.makeSearchboxAsYouType()];
|
|
3197
|
-
case 1: return [2, (_a.sent()).log({
|
|
3214
|
+
case 1: return [2, (_a.sent()).log({
|
|
3215
|
+
searchUID: this.provider.getSearchUID(),
|
|
3216
|
+
})];
|
|
3198
3217
|
}
|
|
3199
3218
|
});
|
|
3200
3219
|
});
|
|
@@ -3207,7 +3226,9 @@
|
|
|
3207
3226
|
return __generator(this, function (_a) {
|
|
3208
3227
|
switch (_a.label) {
|
|
3209
3228
|
case 0: return [4, this.makeBreadcrumbFacet(metadata)];
|
|
3210
|
-
case 1: return [2, (_a.sent()).log({
|
|
3229
|
+
case 1: return [2, (_a.sent()).log({
|
|
3230
|
+
searchUID: this.provider.getSearchUID(),
|
|
3231
|
+
})];
|
|
3211
3232
|
}
|
|
3212
3233
|
});
|
|
3213
3234
|
});
|
|
@@ -3220,7 +3241,9 @@
|
|
|
3220
3241
|
return __generator(this, function (_a) {
|
|
3221
3242
|
switch (_a.label) {
|
|
3222
3243
|
case 0: return [4, this.makeBreadcrumbResetAll()];
|
|
3223
|
-
case 1: return [2, (_a.sent()).log({
|
|
3244
|
+
case 1: return [2, (_a.sent()).log({
|
|
3245
|
+
searchUID: this.provider.getSearchUID(),
|
|
3246
|
+
})];
|
|
3224
3247
|
}
|
|
3225
3248
|
});
|
|
3226
3249
|
});
|
|
@@ -3233,7 +3256,9 @@
|
|
|
3233
3256
|
return __generator(this, function (_a) {
|
|
3234
3257
|
switch (_a.label) {
|
|
3235
3258
|
case 0: return [4, this.makeDocumentQuickview(info, identifier)];
|
|
3236
|
-
case 1: return [2, (_a.sent()).log({
|
|
3259
|
+
case 1: return [2, (_a.sent()).log({
|
|
3260
|
+
searchUID: this.provider.getSearchUID(),
|
|
3261
|
+
})];
|
|
3237
3262
|
}
|
|
3238
3263
|
});
|
|
3239
3264
|
});
|
|
@@ -3246,7 +3271,9 @@
|
|
|
3246
3271
|
return __generator(this, function (_a) {
|
|
3247
3272
|
switch (_a.label) {
|
|
3248
3273
|
case 0: return [4, this.makeDocumentOpen(info, identifier)];
|
|
3249
|
-
case 1: return [2, (_a.sent()).log({
|
|
3274
|
+
case 1: return [2, (_a.sent()).log({
|
|
3275
|
+
searchUID: this.provider.getSearchUID(),
|
|
3276
|
+
})];
|
|
3250
3277
|
}
|
|
3251
3278
|
});
|
|
3252
3279
|
});
|
|
@@ -3259,7 +3286,9 @@
|
|
|
3259
3286
|
return __generator(this, function (_a) {
|
|
3260
3287
|
switch (_a.label) {
|
|
3261
3288
|
case 0: return [4, this.makeOmniboxAnalytics(meta)];
|
|
3262
|
-
case 1: return [2, (_a.sent()).log({
|
|
3289
|
+
case 1: return [2, (_a.sent()).log({
|
|
3290
|
+
searchUID: this.provider.getSearchUID(),
|
|
3291
|
+
})];
|
|
3263
3292
|
}
|
|
3264
3293
|
});
|
|
3265
3294
|
});
|
|
@@ -3272,7 +3301,9 @@
|
|
|
3272
3301
|
return __generator(this, function (_a) {
|
|
3273
3302
|
switch (_a.label) {
|
|
3274
3303
|
case 0: return [4, this.makeOmniboxFromLink(meta)];
|
|
3275
|
-
case 1: return [2, (_a.sent()).log({
|
|
3304
|
+
case 1: return [2, (_a.sent()).log({
|
|
3305
|
+
searchUID: this.provider.getSearchUID(),
|
|
3306
|
+
})];
|
|
3276
3307
|
}
|
|
3277
3308
|
});
|
|
3278
3309
|
});
|
|
@@ -3285,7 +3316,9 @@
|
|
|
3285
3316
|
return __generator(this, function (_a) {
|
|
3286
3317
|
switch (_a.label) {
|
|
3287
3318
|
case 0: return [4, this.makeSearchFromLink()];
|
|
3288
|
-
case 1: return [2, (_a.sent()).log({
|
|
3319
|
+
case 1: return [2, (_a.sent()).log({
|
|
3320
|
+
searchUID: this.provider.getSearchUID(),
|
|
3321
|
+
})];
|
|
3289
3322
|
}
|
|
3290
3323
|
});
|
|
3291
3324
|
});
|
|
@@ -3298,7 +3331,9 @@
|
|
|
3298
3331
|
return __generator(this, function (_a) {
|
|
3299
3332
|
switch (_a.label) {
|
|
3300
3333
|
case 0: return [4, this.makeTriggerNotify(meta)];
|
|
3301
|
-
case 1: return [2, (_a.sent()).log({
|
|
3334
|
+
case 1: return [2, (_a.sent()).log({
|
|
3335
|
+
searchUID: this.provider.getSearchUID(),
|
|
3336
|
+
})];
|
|
3302
3337
|
}
|
|
3303
3338
|
});
|
|
3304
3339
|
});
|
|
@@ -3311,7 +3346,9 @@
|
|
|
3311
3346
|
return __generator(this, function (_a) {
|
|
3312
3347
|
switch (_a.label) {
|
|
3313
3348
|
case 0: return [4, this.makeTriggerExecute(meta)];
|
|
3314
|
-
case 1: return [2, (_a.sent()).log({
|
|
3349
|
+
case 1: return [2, (_a.sent()).log({
|
|
3350
|
+
searchUID: this.provider.getSearchUID(),
|
|
3351
|
+
})];
|
|
3315
3352
|
}
|
|
3316
3353
|
});
|
|
3317
3354
|
});
|
|
@@ -3324,7 +3361,9 @@
|
|
|
3324
3361
|
return __generator(this, function (_a) {
|
|
3325
3362
|
switch (_a.label) {
|
|
3326
3363
|
case 0: return [4, this.makeTriggerQuery()];
|
|
3327
|
-
case 1: return [2, (_a.sent()).log({
|
|
3364
|
+
case 1: return [2, (_a.sent()).log({
|
|
3365
|
+
searchUID: this.provider.getSearchUID(),
|
|
3366
|
+
})];
|
|
3328
3367
|
}
|
|
3329
3368
|
});
|
|
3330
3369
|
});
|
|
@@ -3337,7 +3376,9 @@
|
|
|
3337
3376
|
return __generator(this, function (_a) {
|
|
3338
3377
|
switch (_a.label) {
|
|
3339
3378
|
case 0: return [4, this.makeUndoTriggerQuery(meta)];
|
|
3340
|
-
case 1: return [2, (_a.sent()).log({
|
|
3379
|
+
case 1: return [2, (_a.sent()).log({
|
|
3380
|
+
searchUID: this.provider.getSearchUID(),
|
|
3381
|
+
})];
|
|
3341
3382
|
}
|
|
3342
3383
|
});
|
|
3343
3384
|
});
|
|
@@ -3350,7 +3391,9 @@
|
|
|
3350
3391
|
return __generator(this, function (_a) {
|
|
3351
3392
|
switch (_a.label) {
|
|
3352
3393
|
case 0: return [4, this.makeTriggerRedirect(meta)];
|
|
3353
|
-
case 1: return [2, (_a.sent()).log({
|
|
3394
|
+
case 1: return [2, (_a.sent()).log({
|
|
3395
|
+
searchUID: this.provider.getSearchUID(),
|
|
3396
|
+
})];
|
|
3354
3397
|
}
|
|
3355
3398
|
});
|
|
3356
3399
|
});
|
|
@@ -3363,7 +3406,9 @@
|
|
|
3363
3406
|
return __generator(this, function (_a) {
|
|
3364
3407
|
switch (_a.label) {
|
|
3365
3408
|
case 0: return [4, this.makePagerResize(meta)];
|
|
3366
|
-
case 1: return [2, (_a.sent()).log({
|
|
3409
|
+
case 1: return [2, (_a.sent()).log({
|
|
3410
|
+
searchUID: this.provider.getSearchUID(),
|
|
3411
|
+
})];
|
|
3367
3412
|
}
|
|
3368
3413
|
});
|
|
3369
3414
|
});
|
|
@@ -3376,7 +3421,9 @@
|
|
|
3376
3421
|
return __generator(this, function (_a) {
|
|
3377
3422
|
switch (_a.label) {
|
|
3378
3423
|
case 0: return [4, this.makePagerNumber(meta)];
|
|
3379
|
-
case 1: return [2, (_a.sent()).log({
|
|
3424
|
+
case 1: return [2, (_a.sent()).log({
|
|
3425
|
+
searchUID: this.provider.getSearchUID(),
|
|
3426
|
+
})];
|
|
3380
3427
|
}
|
|
3381
3428
|
});
|
|
3382
3429
|
});
|
|
@@ -3389,7 +3436,9 @@
|
|
|
3389
3436
|
return __generator(this, function (_a) {
|
|
3390
3437
|
switch (_a.label) {
|
|
3391
3438
|
case 0: return [4, this.makePagerNext(meta)];
|
|
3392
|
-
case 1: return [2, (_a.sent()).log({
|
|
3439
|
+
case 1: return [2, (_a.sent()).log({
|
|
3440
|
+
searchUID: this.provider.getSearchUID(),
|
|
3441
|
+
})];
|
|
3393
3442
|
}
|
|
3394
3443
|
});
|
|
3395
3444
|
});
|
|
@@ -3402,7 +3451,9 @@
|
|
|
3402
3451
|
return __generator(this, function (_a) {
|
|
3403
3452
|
switch (_a.label) {
|
|
3404
3453
|
case 0: return [4, this.makePagerPrevious(meta)];
|
|
3405
|
-
case 1: return [2, (_a.sent()).log({
|
|
3454
|
+
case 1: return [2, (_a.sent()).log({
|
|
3455
|
+
searchUID: this.provider.getSearchUID(),
|
|
3456
|
+
})];
|
|
3406
3457
|
}
|
|
3407
3458
|
});
|
|
3408
3459
|
});
|
|
@@ -3415,7 +3466,9 @@
|
|
|
3415
3466
|
return __generator(this, function (_a) {
|
|
3416
3467
|
switch (_a.label) {
|
|
3417
3468
|
case 0: return [4, this.makePagerScrolling()];
|
|
3418
|
-
case 1: return [2, (_a.sent()).log({
|
|
3469
|
+
case 1: return [2, (_a.sent()).log({
|
|
3470
|
+
searchUID: this.provider.getSearchUID(),
|
|
3471
|
+
})];
|
|
3419
3472
|
}
|
|
3420
3473
|
});
|
|
3421
3474
|
});
|
|
@@ -3428,7 +3481,9 @@
|
|
|
3428
3481
|
return __generator(this, function (_a) {
|
|
3429
3482
|
switch (_a.label) {
|
|
3430
3483
|
case 0: return [4, this.makeFacetClearAll(meta)];
|
|
3431
|
-
case 1: return [2, (_a.sent()).log({
|
|
3484
|
+
case 1: return [2, (_a.sent()).log({
|
|
3485
|
+
searchUID: this.provider.getSearchUID(),
|
|
3486
|
+
})];
|
|
3432
3487
|
}
|
|
3433
3488
|
});
|
|
3434
3489
|
});
|
|
@@ -3441,7 +3496,9 @@
|
|
|
3441
3496
|
return __generator(this, function (_a) {
|
|
3442
3497
|
switch (_a.label) {
|
|
3443
3498
|
case 0: return [4, this.makeFacetSearch(meta)];
|
|
3444
|
-
case 1: return [2, (_a.sent()).log({
|
|
3499
|
+
case 1: return [2, (_a.sent()).log({
|
|
3500
|
+
searchUID: this.provider.getSearchUID(),
|
|
3501
|
+
})];
|
|
3445
3502
|
}
|
|
3446
3503
|
});
|
|
3447
3504
|
});
|
|
@@ -3454,7 +3511,9 @@
|
|
|
3454
3511
|
return __generator(this, function (_a) {
|
|
3455
3512
|
switch (_a.label) {
|
|
3456
3513
|
case 0: return [4, this.makeFacetSelect(meta)];
|
|
3457
|
-
case 1: return [2, (_a.sent()).log({
|
|
3514
|
+
case 1: return [2, (_a.sent()).log({
|
|
3515
|
+
searchUID: this.provider.getSearchUID(),
|
|
3516
|
+
})];
|
|
3458
3517
|
}
|
|
3459
3518
|
});
|
|
3460
3519
|
});
|
|
@@ -3467,7 +3526,9 @@
|
|
|
3467
3526
|
return __generator(this, function (_a) {
|
|
3468
3527
|
switch (_a.label) {
|
|
3469
3528
|
case 0: return [4, this.makeFacetDeselect(meta)];
|
|
3470
|
-
case 1: return [2, (_a.sent()).log({
|
|
3529
|
+
case 1: return [2, (_a.sent()).log({
|
|
3530
|
+
searchUID: this.provider.getSearchUID(),
|
|
3531
|
+
})];
|
|
3471
3532
|
}
|
|
3472
3533
|
});
|
|
3473
3534
|
});
|
|
@@ -3480,7 +3541,9 @@
|
|
|
3480
3541
|
return __generator(this, function (_a) {
|
|
3481
3542
|
switch (_a.label) {
|
|
3482
3543
|
case 0: return [4, this.makeFacetExclude(meta)];
|
|
3483
|
-
case 1: return [2, (_a.sent()).log({
|
|
3544
|
+
case 1: return [2, (_a.sent()).log({
|
|
3545
|
+
searchUID: this.provider.getSearchUID(),
|
|
3546
|
+
})];
|
|
3484
3547
|
}
|
|
3485
3548
|
});
|
|
3486
3549
|
});
|
|
@@ -3493,7 +3556,9 @@
|
|
|
3493
3556
|
return __generator(this, function (_a) {
|
|
3494
3557
|
switch (_a.label) {
|
|
3495
3558
|
case 0: return [4, this.makeFacetUnexclude(meta)];
|
|
3496
|
-
case 1: return [2, (_a.sent()).log({
|
|
3559
|
+
case 1: return [2, (_a.sent()).log({
|
|
3560
|
+
searchUID: this.provider.getSearchUID(),
|
|
3561
|
+
})];
|
|
3497
3562
|
}
|
|
3498
3563
|
});
|
|
3499
3564
|
});
|
|
@@ -3506,7 +3571,9 @@
|
|
|
3506
3571
|
return __generator(this, function (_a) {
|
|
3507
3572
|
switch (_a.label) {
|
|
3508
3573
|
case 0: return [4, this.makeFacetSelectAll(meta)];
|
|
3509
|
-
case 1: return [2, (_a.sent()).log({
|
|
3574
|
+
case 1: return [2, (_a.sent()).log({
|
|
3575
|
+
searchUID: this.provider.getSearchUID(),
|
|
3576
|
+
})];
|
|
3510
3577
|
}
|
|
3511
3578
|
});
|
|
3512
3579
|
});
|
|
@@ -3519,7 +3586,9 @@
|
|
|
3519
3586
|
return __generator(this, function (_a) {
|
|
3520
3587
|
switch (_a.label) {
|
|
3521
3588
|
case 0: return [4, this.makeFacetUpdateSort(meta)];
|
|
3522
|
-
case 1: return [2, (_a.sent()).log({
|
|
3589
|
+
case 1: return [2, (_a.sent()).log({
|
|
3590
|
+
searchUID: this.provider.getSearchUID(),
|
|
3591
|
+
})];
|
|
3523
3592
|
}
|
|
3524
3593
|
});
|
|
3525
3594
|
});
|
|
@@ -3532,7 +3601,9 @@
|
|
|
3532
3601
|
return __generator(this, function (_a) {
|
|
3533
3602
|
switch (_a.label) {
|
|
3534
3603
|
case 0: return [4, this.makeFacetShowMore(meta)];
|
|
3535
|
-
case 1: return [2, (_a.sent()).log({
|
|
3604
|
+
case 1: return [2, (_a.sent()).log({
|
|
3605
|
+
searchUID: this.provider.getSearchUID(),
|
|
3606
|
+
})];
|
|
3536
3607
|
}
|
|
3537
3608
|
});
|
|
3538
3609
|
});
|
|
@@ -3545,7 +3616,9 @@
|
|
|
3545
3616
|
return __generator(this, function (_a) {
|
|
3546
3617
|
switch (_a.label) {
|
|
3547
3618
|
case 0: return [4, this.makeFacetShowLess(meta)];
|
|
3548
|
-
case 1: return [2, (_a.sent()).log({
|
|
3619
|
+
case 1: return [2, (_a.sent()).log({
|
|
3620
|
+
searchUID: this.provider.getSearchUID(),
|
|
3621
|
+
})];
|
|
3549
3622
|
}
|
|
3550
3623
|
});
|
|
3551
3624
|
});
|
|
@@ -3558,7 +3631,9 @@
|
|
|
3558
3631
|
return __generator(this, function (_a) {
|
|
3559
3632
|
switch (_a.label) {
|
|
3560
3633
|
case 0: return [4, this.makeQueryError(meta)];
|
|
3561
|
-
case 1: return [2, (_a.sent()).log({
|
|
3634
|
+
case 1: return [2, (_a.sent()).log({
|
|
3635
|
+
searchUID: this.provider.getSearchUID(),
|
|
3636
|
+
})];
|
|
3562
3637
|
}
|
|
3563
3638
|
});
|
|
3564
3639
|
});
|
|
@@ -3594,7 +3669,9 @@
|
|
|
3594
3669
|
return __generator(this, function (_a) {
|
|
3595
3670
|
switch (_a.label) {
|
|
3596
3671
|
case 0: return [4, this.makeQueryErrorBack()];
|
|
3597
|
-
case 1: return [2, (_a.sent()).log({
|
|
3672
|
+
case 1: return [2, (_a.sent()).log({
|
|
3673
|
+
searchUID: this.provider.getSearchUID(),
|
|
3674
|
+
})];
|
|
3598
3675
|
}
|
|
3599
3676
|
});
|
|
3600
3677
|
});
|
|
@@ -3630,7 +3707,9 @@
|
|
|
3630
3707
|
return __generator(this, function (_a) {
|
|
3631
3708
|
switch (_a.label) {
|
|
3632
3709
|
case 0: return [4, this.makeQueryErrorRetry()];
|
|
3633
|
-
case 1: return [2, (_a.sent()).log({
|
|
3710
|
+
case 1: return [2, (_a.sent()).log({
|
|
3711
|
+
searchUID: this.provider.getSearchUID(),
|
|
3712
|
+
})];
|
|
3634
3713
|
}
|
|
3635
3714
|
});
|
|
3636
3715
|
});
|
|
@@ -3666,7 +3745,9 @@
|
|
|
3666
3745
|
return __generator(this, function (_a) {
|
|
3667
3746
|
switch (_a.label) {
|
|
3668
3747
|
case 0: return [4, this.makeQueryErrorClear()];
|
|
3669
|
-
case 1: return [2, (_a.sent()).log({
|
|
3748
|
+
case 1: return [2, (_a.sent()).log({
|
|
3749
|
+
searchUID: this.provider.getSearchUID(),
|
|
3750
|
+
})];
|
|
3670
3751
|
}
|
|
3671
3752
|
});
|
|
3672
3753
|
});
|
|
@@ -3679,7 +3760,9 @@
|
|
|
3679
3760
|
return __generator(this, function (_a) {
|
|
3680
3761
|
switch (_a.label) {
|
|
3681
3762
|
case 0: return [4, this.makeLikeSmartSnippet()];
|
|
3682
|
-
case 1: return [2, (_a.sent()).log({
|
|
3763
|
+
case 1: return [2, (_a.sent()).log({
|
|
3764
|
+
searchUID: this.provider.getSearchUID(),
|
|
3765
|
+
})];
|
|
3683
3766
|
}
|
|
3684
3767
|
});
|
|
3685
3768
|
});
|
|
@@ -3692,7 +3775,9 @@
|
|
|
3692
3775
|
return __generator(this, function (_a) {
|
|
3693
3776
|
switch (_a.label) {
|
|
3694
3777
|
case 0: return [4, this.makeDislikeSmartSnippet()];
|
|
3695
|
-
case 1: return [2, (_a.sent()).log({
|
|
3778
|
+
case 1: return [2, (_a.sent()).log({
|
|
3779
|
+
searchUID: this.provider.getSearchUID(),
|
|
3780
|
+
})];
|
|
3696
3781
|
}
|
|
3697
3782
|
});
|
|
3698
3783
|
});
|
|
@@ -3705,7 +3790,9 @@
|
|
|
3705
3790
|
return __generator(this, function (_a) {
|
|
3706
3791
|
switch (_a.label) {
|
|
3707
3792
|
case 0: return [4, this.makeExpandSmartSnippet()];
|
|
3708
|
-
case 1: return [2, (_a.sent()).log({
|
|
3793
|
+
case 1: return [2, (_a.sent()).log({
|
|
3794
|
+
searchUID: this.provider.getSearchUID(),
|
|
3795
|
+
})];
|
|
3709
3796
|
}
|
|
3710
3797
|
});
|
|
3711
3798
|
});
|
|
@@ -3718,7 +3805,9 @@
|
|
|
3718
3805
|
return __generator(this, function (_a) {
|
|
3719
3806
|
switch (_a.label) {
|
|
3720
3807
|
case 0: return [4, this.makeCollapseSmartSnippet()];
|
|
3721
|
-
case 1: return [2, (_a.sent()).log({
|
|
3808
|
+
case 1: return [2, (_a.sent()).log({
|
|
3809
|
+
searchUID: this.provider.getSearchUID(),
|
|
3810
|
+
})];
|
|
3722
3811
|
}
|
|
3723
3812
|
});
|
|
3724
3813
|
});
|
|
@@ -3731,7 +3820,9 @@
|
|
|
3731
3820
|
return __generator(this, function (_a) {
|
|
3732
3821
|
switch (_a.label) {
|
|
3733
3822
|
case 0: return [4, this.makeOpenSmartSnippetFeedbackModal()];
|
|
3734
|
-
case 1: return [2, (_a.sent()).log({
|
|
3823
|
+
case 1: return [2, (_a.sent()).log({
|
|
3824
|
+
searchUID: this.provider.getSearchUID(),
|
|
3825
|
+
})];
|
|
3735
3826
|
}
|
|
3736
3827
|
});
|
|
3737
3828
|
});
|
|
@@ -3744,13 +3835,18 @@
|
|
|
3744
3835
|
return __generator(this, function (_a) {
|
|
3745
3836
|
switch (_a.label) {
|
|
3746
3837
|
case 0: return [4, this.makeCloseSmartSnippetFeedbackModal()];
|
|
3747
|
-
case 1: return [2, (_a.sent()).log({
|
|
3838
|
+
case 1: return [2, (_a.sent()).log({
|
|
3839
|
+
searchUID: this.provider.getSearchUID(),
|
|
3840
|
+
})];
|
|
3748
3841
|
}
|
|
3749
3842
|
});
|
|
3750
3843
|
});
|
|
3751
3844
|
};
|
|
3752
3845
|
CoveoSearchPageClient.prototype.makeSmartSnippetFeedbackReason = function (reason, details) {
|
|
3753
|
-
return this.makeCustomEvent(SearchPageEvents.sendSmartSnippetReason, {
|
|
3846
|
+
return this.makeCustomEvent(SearchPageEvents.sendSmartSnippetReason, {
|
|
3847
|
+
reason: reason,
|
|
3848
|
+
details: details,
|
|
3849
|
+
});
|
|
3754
3850
|
};
|
|
3755
3851
|
CoveoSearchPageClient.prototype.logSmartSnippetFeedbackReason = function (reason, details) {
|
|
3756
3852
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3772,7 +3868,9 @@
|
|
|
3772
3868
|
return __generator(this, function (_a) {
|
|
3773
3869
|
switch (_a.label) {
|
|
3774
3870
|
case 0: return [4, this.makeExpandSmartSnippetSuggestion(snippet)];
|
|
3775
|
-
case 1: return [2, (_a.sent()).log({
|
|
3871
|
+
case 1: return [2, (_a.sent()).log({
|
|
3872
|
+
searchUID: this.provider.getSearchUID(),
|
|
3873
|
+
})];
|
|
3776
3874
|
}
|
|
3777
3875
|
});
|
|
3778
3876
|
});
|
|
@@ -3785,7 +3883,9 @@
|
|
|
3785
3883
|
return __generator(this, function (_a) {
|
|
3786
3884
|
switch (_a.label) {
|
|
3787
3885
|
case 0: return [4, this.makeCollapseSmartSnippetSuggestion(snippet)];
|
|
3788
|
-
case 1: return [2, (_a.sent()).log({
|
|
3886
|
+
case 1: return [2, (_a.sent()).log({
|
|
3887
|
+
searchUID: this.provider.getSearchUID(),
|
|
3888
|
+
})];
|
|
3789
3889
|
}
|
|
3790
3890
|
});
|
|
3791
3891
|
});
|
|
@@ -3798,7 +3898,9 @@
|
|
|
3798
3898
|
return __generator(this, function (_a) {
|
|
3799
3899
|
switch (_a.label) {
|
|
3800
3900
|
case 0: return [4, this.makeShowMoreSmartSnippetSuggestion(snippet)];
|
|
3801
|
-
case 1: return [2, (_a.sent()).log({
|
|
3901
|
+
case 1: return [2, (_a.sent()).log({
|
|
3902
|
+
searchUID: this.provider.getSearchUID(),
|
|
3903
|
+
})];
|
|
3802
3904
|
}
|
|
3803
3905
|
});
|
|
3804
3906
|
});
|
|
@@ -3811,7 +3913,9 @@
|
|
|
3811
3913
|
return __generator(this, function (_a) {
|
|
3812
3914
|
switch (_a.label) {
|
|
3813
3915
|
case 0: return [4, this.makeShowLessSmartSnippetSuggestion(snippet)];
|
|
3814
|
-
case 1: return [2, (_a.sent()).log({
|
|
3916
|
+
case 1: return [2, (_a.sent()).log({
|
|
3917
|
+
searchUID: this.provider.getSearchUID(),
|
|
3918
|
+
})];
|
|
3815
3919
|
}
|
|
3816
3920
|
});
|
|
3817
3921
|
});
|
|
@@ -3824,13 +3928,18 @@
|
|
|
3824
3928
|
return __generator(this, function (_a) {
|
|
3825
3929
|
switch (_a.label) {
|
|
3826
3930
|
case 0: return [4, this.makeOpenSmartSnippetSource(info, identifier)];
|
|
3827
|
-
case 1: return [2, (_a.sent()).log({
|
|
3931
|
+
case 1: return [2, (_a.sent()).log({
|
|
3932
|
+
searchUID: this.provider.getSearchUID(),
|
|
3933
|
+
})];
|
|
3828
3934
|
}
|
|
3829
3935
|
});
|
|
3830
3936
|
});
|
|
3831
3937
|
};
|
|
3832
3938
|
CoveoSearchPageClient.prototype.makeOpenSmartSnippetSuggestionSource = function (info, snippet) {
|
|
3833
|
-
return this.makeClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, {
|
|
3939
|
+
return this.makeClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, {
|
|
3940
|
+
contentIDKey: snippet.documentId.contentIdKey,
|
|
3941
|
+
contentIDValue: snippet.documentId.contentIdValue,
|
|
3942
|
+
}, snippet);
|
|
3834
3943
|
};
|
|
3835
3944
|
CoveoSearchPageClient.prototype.makeCopyToClipboard = function (info, identifier) {
|
|
3836
3945
|
return this.makeClickEvent(SearchPageEvents.copyToClipboard, info, identifier);
|
|
@@ -3840,7 +3949,9 @@
|
|
|
3840
3949
|
return __generator(this, function (_a) {
|
|
3841
3950
|
switch (_a.label) {
|
|
3842
3951
|
case 0: return [4, this.makeCopyToClipboard(info, identifier)];
|
|
3843
|
-
case 1: return [2, (_a.sent()).log({
|
|
3952
|
+
case 1: return [2, (_a.sent()).log({
|
|
3953
|
+
searchUID: this.provider.getSearchUID(),
|
|
3954
|
+
})];
|
|
3844
3955
|
}
|
|
3845
3956
|
});
|
|
3846
3957
|
});
|
|
@@ -3858,7 +3969,10 @@
|
|
|
3858
3969
|
});
|
|
3859
3970
|
};
|
|
3860
3971
|
CoveoSearchPageClient.prototype.makeOpenSmartSnippetInlineLink = function (info, identifierAndLink) {
|
|
3861
|
-
return this.makeClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
3972
|
+
return this.makeClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
3973
|
+
contentIDKey: identifierAndLink.contentIDKey,
|
|
3974
|
+
contentIDValue: identifierAndLink.contentIDValue,
|
|
3975
|
+
}, identifierAndLink);
|
|
3862
3976
|
};
|
|
3863
3977
|
CoveoSearchPageClient.prototype.logOpenSmartSnippetInlineLink = function (info, identifierAndLink) {
|
|
3864
3978
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3898,7 +4012,9 @@
|
|
|
3898
4012
|
return __generator(this, function (_a) {
|
|
3899
4013
|
switch (_a.label) {
|
|
3900
4014
|
case 0: return [4, this.makeRecentQueryClick()];
|
|
3901
|
-
case 1: return [2, (_a.sent()).log({
|
|
4015
|
+
case 1: return [2, (_a.sent()).log({
|
|
4016
|
+
searchUID: this.provider.getSearchUID(),
|
|
4017
|
+
})];
|
|
3902
4018
|
}
|
|
3903
4019
|
});
|
|
3904
4020
|
});
|
|
@@ -3911,20 +4027,27 @@
|
|
|
3911
4027
|
return __generator(this, function (_a) {
|
|
3912
4028
|
switch (_a.label) {
|
|
3913
4029
|
case 0: return [4, this.makeClearRecentQueries()];
|
|
3914
|
-
case 1: return [2, (_a.sent()).log({
|
|
4030
|
+
case 1: return [2, (_a.sent()).log({
|
|
4031
|
+
searchUID: this.provider.getSearchUID(),
|
|
4032
|
+
})];
|
|
3915
4033
|
}
|
|
3916
4034
|
});
|
|
3917
4035
|
});
|
|
3918
4036
|
};
|
|
3919
4037
|
CoveoSearchPageClient.prototype.makeRecentResultClick = function (info, identifier) {
|
|
3920
|
-
return this.makeCustomEvent(SearchPageEvents.recentResultClick, {
|
|
4038
|
+
return this.makeCustomEvent(SearchPageEvents.recentResultClick, {
|
|
4039
|
+
info: info,
|
|
4040
|
+
identifier: identifier,
|
|
4041
|
+
});
|
|
3921
4042
|
};
|
|
3922
4043
|
CoveoSearchPageClient.prototype.logRecentResultClick = function (info, identifier) {
|
|
3923
4044
|
return __awaiter(this, void 0, void 0, function () {
|
|
3924
4045
|
return __generator(this, function (_a) {
|
|
3925
4046
|
switch (_a.label) {
|
|
3926
4047
|
case 0: return [4, this.makeRecentResultClick(info, identifier)];
|
|
3927
|
-
case 1: return [2, (_a.sent()).log({
|
|
4048
|
+
case 1: return [2, (_a.sent()).log({
|
|
4049
|
+
searchUID: this.provider.getSearchUID(),
|
|
4050
|
+
})];
|
|
3928
4051
|
}
|
|
3929
4052
|
});
|
|
3930
4053
|
});
|
|
@@ -3937,7 +4060,9 @@
|
|
|
3937
4060
|
return __generator(this, function (_a) {
|
|
3938
4061
|
switch (_a.label) {
|
|
3939
4062
|
case 0: return [4, this.makeClearRecentResults()];
|
|
3940
|
-
case 1: return [2, (_a.sent()).log({
|
|
4063
|
+
case 1: return [2, (_a.sent()).log({
|
|
4064
|
+
searchUID: this.provider.getSearchUID(),
|
|
4065
|
+
})];
|
|
3941
4066
|
}
|
|
3942
4067
|
});
|
|
3943
4068
|
});
|
|
@@ -3950,7 +4075,9 @@
|
|
|
3950
4075
|
return __generator(this, function (_a) {
|
|
3951
4076
|
switch (_a.label) {
|
|
3952
4077
|
case 0: return [4, this.makeNoResultsBack()];
|
|
3953
|
-
case 1: return [2, (_a.sent()).log({
|
|
4078
|
+
case 1: return [2, (_a.sent()).log({
|
|
4079
|
+
searchUID: this.provider.getSearchUID(),
|
|
4080
|
+
})];
|
|
3954
4081
|
}
|
|
3955
4082
|
});
|
|
3956
4083
|
});
|
|
@@ -3963,7 +4090,9 @@
|
|
|
3963
4090
|
return __generator(this, function (_a) {
|
|
3964
4091
|
switch (_a.label) {
|
|
3965
4092
|
case 0: return [4, this.makeShowMoreFoldedResults(info, identifier)];
|
|
3966
|
-
case 1: return [2, (_a.sent()).log({
|
|
4093
|
+
case 1: return [2, (_a.sent()).log({
|
|
4094
|
+
searchUID: this.provider.getSearchUID(),
|
|
4095
|
+
})];
|
|
3967
4096
|
}
|
|
3968
4097
|
});
|
|
3969
4098
|
});
|
|
@@ -3976,7 +4105,9 @@
|
|
|
3976
4105
|
return __generator(this, function (_a) {
|
|
3977
4106
|
switch (_a.label) {
|
|
3978
4107
|
case 0: return [4, this.makeShowLessFoldedResults()];
|
|
3979
|
-
case 1: return [2, (_a.sent()).log({
|
|
4108
|
+
case 1: return [2, (_a.sent()).log({
|
|
4109
|
+
searchUID: this.provider.getSearchUID(),
|
|
4110
|
+
})];
|
|
3980
4111
|
}
|
|
3981
4112
|
});
|
|
3982
4113
|
});
|
|
@@ -4018,7 +4149,9 @@
|
|
|
4018
4149
|
return __generator(this, function (_a) {
|
|
4019
4150
|
switch (_a.label) {
|
|
4020
4151
|
case 0: return [4, this.makeCustomEvent(event, metadata, eventType)];
|
|
4021
|
-
case 1: return [2, (_a.sent()).log({
|
|
4152
|
+
case 1: return [2, (_a.sent()).log({
|
|
4153
|
+
searchUID: this.provider.getSearchUID(),
|
|
4154
|
+
})];
|
|
4022
4155
|
}
|
|
4023
4156
|
});
|
|
4024
4157
|
});
|
|
@@ -4065,7 +4198,9 @@
|
|
|
4065
4198
|
return __generator(this, function (_a) {
|
|
4066
4199
|
switch (_a.label) {
|
|
4067
4200
|
case 0: return [4, this.makeSearchEvent(event, metadata)];
|
|
4068
|
-
case 1: return [2, (_a.sent()).log({
|
|
4201
|
+
case 1: return [2, (_a.sent()).log({
|
|
4202
|
+
searchUID: this.provider.getSearchUID(),
|
|
4203
|
+
})];
|
|
4069
4204
|
}
|
|
4070
4205
|
});
|
|
4071
4206
|
});
|
|
@@ -4173,8 +4308,12 @@
|
|
|
4173
4308
|
: undefined;
|
|
4174
4309
|
};
|
|
4175
4310
|
CoveoSearchPageClient.prototype.getSplitTestRun = function () {
|
|
4176
|
-
var splitTestRunName = this.provider.getSplitTestRunName
|
|
4177
|
-
|
|
4311
|
+
var splitTestRunName = this.provider.getSplitTestRunName
|
|
4312
|
+
? this.provider.getSplitTestRunName()
|
|
4313
|
+
: '';
|
|
4314
|
+
var splitTestRunVersion = this.provider.getSplitTestRunVersion
|
|
4315
|
+
? this.provider.getSplitTestRunVersion()
|
|
4316
|
+
: '';
|
|
4178
4317
|
return __assign(__assign({}, (splitTestRunName && { splitTestRunName: splitTestRunName })), (splitTestRunVersion && { splitTestRunVersion: splitTestRunVersion }));
|
|
4179
4318
|
};
|
|
4180
4319
|
CoveoSearchPageClient.prototype.makeLikeGeneratedAnswer = function (metadata) {
|
|
@@ -4185,7 +4324,9 @@
|
|
|
4185
4324
|
return __generator(this, function (_a) {
|
|
4186
4325
|
switch (_a.label) {
|
|
4187
4326
|
case 0: return [4, this.makeLikeGeneratedAnswer(metadata)];
|
|
4188
|
-
case 1: return [2, (_a.sent()).log({
|
|
4327
|
+
case 1: return [2, (_a.sent()).log({
|
|
4328
|
+
searchUID: this.provider.getSearchUID(),
|
|
4329
|
+
})];
|
|
4189
4330
|
}
|
|
4190
4331
|
});
|
|
4191
4332
|
});
|
|
@@ -4198,7 +4339,9 @@
|
|
|
4198
4339
|
return __generator(this, function (_a) {
|
|
4199
4340
|
switch (_a.label) {
|
|
4200
4341
|
case 0: return [4, this.makeDislikeGeneratedAnswer(metadata)];
|
|
4201
|
-
case 1: return [2, (_a.sent()).log({
|
|
4342
|
+
case 1: return [2, (_a.sent()).log({
|
|
4343
|
+
searchUID: this.provider.getSearchUID(),
|
|
4344
|
+
})];
|
|
4202
4345
|
}
|
|
4203
4346
|
});
|
|
4204
4347
|
});
|
|
@@ -4234,7 +4377,10 @@
|
|
|
4234
4377
|
});
|
|
4235
4378
|
};
|
|
4236
4379
|
CoveoSearchPageClient.prototype.makeGeneratedAnswerCitationClick = function (info, citation) {
|
|
4237
|
-
return this.makeClickEvent(SearchPageEvents.generatedAnswerCitationClick, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
4380
|
+
return this.makeClickEvent(SearchPageEvents.generatedAnswerCitationClick, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
4381
|
+
contentIDKey: citation.documentId.contentIdKey,
|
|
4382
|
+
contentIDValue: citation.documentId.contentIdValue,
|
|
4383
|
+
}, citation);
|
|
4238
4384
|
};
|
|
4239
4385
|
CoveoSearchPageClient.prototype.logGeneratedAnswerCitationClick = function (info, citation) {
|
|
4240
4386
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4331,7 +4477,9 @@
|
|
|
4331
4477
|
return __generator(this, function (_a) {
|
|
4332
4478
|
switch (_a.label) {
|
|
4333
4479
|
case 0: return [4, this.makeGeneratedAnswerExpand(metadata)];
|
|
4334
|
-
case 1: return [2, (_a.sent()).log({
|
|
4480
|
+
case 1: return [2, (_a.sent()).log({
|
|
4481
|
+
searchUID: this.provider.getSearchUID(),
|
|
4482
|
+
})];
|
|
4335
4483
|
}
|
|
4336
4484
|
});
|
|
4337
4485
|
});
|
|
@@ -4344,7 +4492,9 @@
|
|
|
4344
4492
|
return __generator(this, function (_a) {
|
|
4345
4493
|
switch (_a.label) {
|
|
4346
4494
|
case 0: return [4, this.makeGeneratedAnswerCollapse(metadata)];
|
|
4347
|
-
case 1: return [2, (_a.sent()).log({
|
|
4495
|
+
case 1: return [2, (_a.sent()).log({
|
|
4496
|
+
searchUID: this.provider.getSearchUID(),
|
|
4497
|
+
})];
|
|
4348
4498
|
}
|
|
4349
4499
|
});
|
|
4350
4500
|
});
|
|
@@ -4387,7 +4537,9 @@
|
|
|
4387
4537
|
return __generator(this, function (_a) {
|
|
4388
4538
|
switch (_a.label) {
|
|
4389
4539
|
case 0: return [4, this.makeRephraseGeneratedAnswer(meta)];
|
|
4390
|
-
case 1: return [2, (_a.sent()).log({
|
|
4540
|
+
case 1: return [2, (_a.sent()).log({
|
|
4541
|
+
searchUID: this.provider.getSearchUID(),
|
|
4542
|
+
})];
|
|
4391
4543
|
}
|
|
4392
4544
|
});
|
|
4393
4545
|
});
|
|
@@ -4400,7 +4552,9 @@
|
|
|
4400
4552
|
return __generator(this, function (_a) {
|
|
4401
4553
|
switch (_a.label) {
|
|
4402
4554
|
case 0: return [4, this.makeRetryGeneratedAnswer()];
|
|
4403
|
-
case 1: return [2, (_a.sent()).log({
|
|
4555
|
+
case 1: return [2, (_a.sent()).log({
|
|
4556
|
+
searchUID: this.provider.getSearchUID(),
|
|
4557
|
+
})];
|
|
4404
4558
|
}
|
|
4405
4559
|
});
|
|
4406
4560
|
});
|
|
@@ -4413,7 +4567,9 @@
|
|
|
4413
4567
|
return __generator(this, function (_a) {
|
|
4414
4568
|
switch (_a.label) {
|
|
4415
4569
|
case 0: return [4, this.makeGeneratedAnswerStreamEnd(metadata)];
|
|
4416
|
-
case 1: return [2, (_a.sent()).log({
|
|
4570
|
+
case 1: return [2, (_a.sent()).log({
|
|
4571
|
+
searchUID: this.provider.getSearchUID(),
|
|
4572
|
+
})];
|
|
4417
4573
|
}
|
|
4418
4574
|
});
|
|
4419
4575
|
});
|
|
@@ -4450,8 +4606,11 @@
|
|
|
4450
4606
|
var _a;
|
|
4451
4607
|
this.options = options;
|
|
4452
4608
|
this.provider = provider;
|
|
4453
|
-
var analyticsEnabled = ((_a = options.enableAnalytics) !== null && _a !== void 0 ? _a : true) &&
|
|
4454
|
-
|
|
4609
|
+
var analyticsEnabled = ((_a = options.enableAnalytics) !== null && _a !== void 0 ? _a : true) &&
|
|
4610
|
+
!shouldDisableAnalyticsForPrivacy(options.disableBrowserPrivacySignals);
|
|
4611
|
+
this.coveoAnalyticsClient = analyticsEnabled
|
|
4612
|
+
? new CoveoAnalyticsClient(options)
|
|
4613
|
+
: new NoopAnalytics();
|
|
4455
4614
|
this.svc = new SVCPlugin({ client: this.coveoAnalyticsClient });
|
|
4456
4615
|
}
|
|
4457
4616
|
CaseAssistClient.prototype.disable = function () {
|
|
@@ -4604,14 +4763,19 @@
|
|
|
4604
4763
|
if (includeContext === void 0) { includeContext = true; }
|
|
4605
4764
|
metadata.caseContext; var caseId = metadata.caseId, caseNumber = metadata.caseNumber, metadataWithoutContext = __rest(metadata, ["caseContext", "caseId", "caseNumber"]);
|
|
4606
4765
|
var context = extractContextFromMetadata(metadata);
|
|
4607
|
-
return __assign(__assign(__assign({ CaseId: caseId, CaseNumber: caseNumber }, metadataWithoutContext), (!!context.context_Case_Subject && {
|
|
4766
|
+
return __assign(__assign(__assign({ CaseId: caseId, CaseNumber: caseNumber }, metadataWithoutContext), (!!context.context_Case_Subject && {
|
|
4767
|
+
CaseSubject: context.context_Case_Subject,
|
|
4768
|
+
})), (includeContext && context));
|
|
4608
4769
|
};
|
|
4609
4770
|
var CoveoInsightClient = (function () {
|
|
4610
4771
|
function CoveoInsightClient(opts, provider) {
|
|
4611
4772
|
this.opts = opts;
|
|
4612
4773
|
this.provider = provider;
|
|
4613
|
-
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
4614
|
-
|
|
4774
|
+
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
4775
|
+
shouldDisableAnalyticsForPrivacy(opts.disableBrowserPrivacySignals);
|
|
4776
|
+
this.coveoAnalyticsClient = shouldDisableAnalytics
|
|
4777
|
+
? new NoopAnalytics()
|
|
4778
|
+
: new CoveoAnalyticsClient(opts);
|
|
4615
4779
|
}
|
|
4616
4780
|
CoveoInsightClient.prototype.disable = function () {
|
|
4617
4781
|
this.coveoAnalyticsClient = new NoopAnalytics();
|
|
@@ -4653,7 +4817,9 @@
|
|
|
4653
4817
|
var metadataToSend = generateMetadataToSend(metadata);
|
|
4654
4818
|
return this.logCustomEvent(SearchPageEvents.pagerScrolling, __assign(__assign({}, metadataToSend), { type: 'getMoreResults' }));
|
|
4655
4819
|
}
|
|
4656
|
-
return this.logCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
4820
|
+
return this.logCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
4821
|
+
type: 'getMoreResults',
|
|
4822
|
+
});
|
|
4657
4823
|
};
|
|
4658
4824
|
CoveoInsightClient.prototype.logBreadcrumbFacet = function (metadata) {
|
|
4659
4825
|
var metadataToSend = generateMetadataToSend(metadata);
|
|
@@ -4762,7 +4928,8 @@
|
|
|
4762
4928
|
return this.logCustomEvent(InsightEvents.clickPageView, __assign(__assign({}, generateMetadataToSend(metadata, false)), { pageView: pageView }));
|
|
4763
4929
|
};
|
|
4764
4930
|
CoveoInsightClient.prototype.logCreateArticle = function (createArticleMetadata, metadata) {
|
|
4765
|
-
return this.logCustomEvent(InsightEvents.createArticle, metadata
|
|
4931
|
+
return this.logCustomEvent(InsightEvents.createArticle, metadata
|
|
4932
|
+
? __assign(__assign({}, generateMetadataToSend(metadata, false)), createArticleMetadata) : createArticleMetadata);
|
|
4766
4933
|
};
|
|
4767
4934
|
CoveoInsightClient.prototype.logDocumentOpen = function (info, identifier, metadata) {
|
|
4768
4935
|
return this.logClickEvent(SearchPageEvents.documentOpen, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -4828,10 +4995,17 @@
|
|
|
4828
4995
|
return this.logClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
4829
4996
|
};
|
|
4830
4997
|
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionSource = function (info, snippet, metadata) {
|
|
4831
|
-
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, {
|
|
4998
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionSource, info, {
|
|
4999
|
+
contentIDKey: snippet.documentId.contentIdKey,
|
|
5000
|
+
contentIDValue: snippet.documentId.contentIdValue,
|
|
5001
|
+
}, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), snippet) : snippet);
|
|
4832
5002
|
};
|
|
4833
5003
|
CoveoInsightClient.prototype.logOpenSmartSnippetInlineLink = function (info, identifierAndLink, metadata) {
|
|
4834
|
-
return this.logClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
5004
|
+
return this.logClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
5005
|
+
contentIDKey: identifierAndLink.contentIDKey,
|
|
5006
|
+
contentIDValue: identifierAndLink.contentIDValue,
|
|
5007
|
+
}, metadata
|
|
5008
|
+
? __assign(__assign({}, generateMetadataToSend(metadata, false)), identifierAndLink) : identifierAndLink);
|
|
4835
5009
|
};
|
|
4836
5010
|
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionInlineLink = function (info, snippetAndLink, metadata) {
|
|
4837
5011
|
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionInlineLink, info, {
|
|
@@ -4852,7 +5026,10 @@
|
|
|
4852
5026
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerSourceMetadata) : generatedAnswerSourceMetadata);
|
|
4853
5027
|
};
|
|
4854
5028
|
CoveoInsightClient.prototype.logGeneratedAnswerCitationClick = function (info, citation, metadata) {
|
|
4855
|
-
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationClick, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
5029
|
+
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationClick, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
5030
|
+
contentIDKey: citation.documentId.contentIdKey,
|
|
5031
|
+
contentIDValue: citation.documentId.contentIdValue,
|
|
5032
|
+
}, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
4856
5033
|
};
|
|
4857
5034
|
CoveoInsightClient.prototype.logGeneratedAnswerSourceHover = function (generatedAnswerSourceMetadata, metadata) {
|
|
4858
5035
|
return this.logCustomEvent(SearchPageEvents.generatedAnswerSourceHover, metadata
|
|
@@ -4898,7 +5075,10 @@
|
|
|
4898
5075
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
4899
5076
|
};
|
|
4900
5077
|
CoveoInsightClient.prototype.logGeneratedAnswerCitationDocumentAttach = function (info, citation, metadata) {
|
|
4901
|
-
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationDocumentAttach, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
5078
|
+
return this.logClickEvent(SearchPageEvents.generatedAnswerCitationDocumentAttach, __assign(__assign({}, info), { documentPosition: 1 }), {
|
|
5079
|
+
contentIDKey: citation.documentId.contentIdKey,
|
|
5080
|
+
contentIDValue: citation.documentId.contentIdValue,
|
|
5081
|
+
}, metadata ? __assign(__assign({}, generateMetadataToSend(metadata, false)), citation) : citation);
|
|
4902
5082
|
};
|
|
4903
5083
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
4904
5084
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4959,7 +5139,8 @@
|
|
|
4959
5139
|
});
|
|
4960
5140
|
};
|
|
4961
5141
|
CoveoInsightClient.prototype.logTriggerNotify = function (triggerNotifyMetadata, metadata) {
|
|
4962
|
-
return this.logCustomEvent(SearchPageEvents.triggerNotify, metadata
|
|
5142
|
+
return this.logCustomEvent(SearchPageEvents.triggerNotify, metadata
|
|
5143
|
+
? __assign(__assign({}, generateMetadataToSend(metadata, false)), triggerNotifyMetadata) : triggerNotifyMetadata);
|
|
4963
5144
|
};
|
|
4964
5145
|
CoveoInsightClient.prototype.getBaseCustomEventRequest = function (metadata) {
|
|
4965
5146
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -5058,7 +5239,9 @@
|
|
|
5058
5239
|
if (coveoua.q) {
|
|
5059
5240
|
var initEvents = coveoua.q.filter(function (args) { return args[0] === 'init'; });
|
|
5060
5241
|
var otherEvents = coveoua.q.filter(function (args) { return args[0] !== 'init'; });
|
|
5061
|
-
__spreadArray(__spreadArray([], initEvents, true), otherEvents, true).forEach(function (args) {
|
|
5242
|
+
__spreadArray(__spreadArray([], initEvents, true), otherEvents, true).forEach(function (args) {
|
|
5243
|
+
return handleOneAnalyticsEvent.apply(void 0, args);
|
|
5244
|
+
});
|
|
5062
5245
|
}
|
|
5063
5246
|
var browser = self.coveoua;
|
|
5064
5247
|
|