coveo.analytics 2.30.55 → 2.31.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 +525 -357
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.debug.js +559 -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 -1
- package/dist/definitions/searchPage/searchPageClient.d.ts +3 -1
- package/dist/definitions/searchPage/searchPageEvents.d.ts +6 -0
- package/dist/definitions/version.d.ts +1 -1
- package/dist/library.cjs +15367 -3699
- package/dist/library.es.js +525 -357
- package/dist/library.js +15367 -3699
- package/dist/library.mjs +15367 -3699
- package/dist/react-native.es.js +646 -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 +5 -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 +22 -21
- package/src/searchPage/searchPageClient.spec.ts +1944 -1766
- package/src/searchPage/searchPageClient.ts +1261 -1029
- package/src/searchPage/searchPageEvents.ts +529 -500
- 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.31.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') {
|
|
@@ -2837,6 +2815,7 @@
|
|
|
2837
2815
|
SearchPageEvents["rephraseGeneratedAnswer"] = "rephraseGeneratedAnswer";
|
|
2838
2816
|
SearchPageEvents["generatedAnswerFeedbackSubmitV2"] = "generatedAnswerFeedbackSubmitV2";
|
|
2839
2817
|
SearchPageEvents["generatedAnswerCitationClick"] = "generatedAnswerCitationClick";
|
|
2818
|
+
SearchPageEvents["generatedAnswerFollowupOpenSource"] = "generatedAnswerFollowupOpenSource";
|
|
2840
2819
|
SearchPageEvents["generatedAnswerCitationDocumentAttach"] = "generatedAnswerCitationDocumentAttach";
|
|
2841
2820
|
})(SearchPageEvents || (SearchPageEvents = {}));
|
|
2842
2821
|
var CustomEventsTypes = (_a = {},
|
|
@@ -2876,6 +2855,7 @@
|
|
|
2876
2855
|
_a[SearchPageEvents.dislikeGeneratedAnswer] = 'generatedAnswer',
|
|
2877
2856
|
_a[SearchPageEvents.openGeneratedAnswerSource] = 'generatedAnswer',
|
|
2878
2857
|
_a[SearchPageEvents.generatedAnswerOpenInlineLink] = 'generatedAnswer',
|
|
2858
|
+
_a[SearchPageEvents.generatedAnswerFollowupOpenSource] = 'generatedAnswer',
|
|
2879
2859
|
_a[SearchPageEvents.generatedAnswerStreamEnd] = 'generatedAnswer',
|
|
2880
2860
|
_a[SearchPageEvents.generatedAnswerSourceHover] = 'generatedAnswer',
|
|
2881
2861
|
_a[SearchPageEvents.generatedAnswerCopyToClipboard] = 'generatedAnswer',
|
|
@@ -2906,7 +2886,11 @@
|
|
|
2906
2886
|
return Promise.resolve();
|
|
2907
2887
|
};
|
|
2908
2888
|
NoopAnalytics.prototype.makeEvent = function (eventType) {
|
|
2909
|
-
return Promise.resolve({
|
|
2889
|
+
return Promise.resolve({
|
|
2890
|
+
eventType: eventType,
|
|
2891
|
+
payload: null,
|
|
2892
|
+
log: function () { return Promise.resolve(); },
|
|
2893
|
+
});
|
|
2910
2894
|
};
|
|
2911
2895
|
NoopAnalytics.prototype.sendEvent = function () {
|
|
2912
2896
|
return Promise.resolve();
|
|
@@ -2985,7 +2969,9 @@
|
|
|
2985
2969
|
var partialQueries = typeof meta.partialQueries === 'string'
|
|
2986
2970
|
? meta.partialQueries
|
|
2987
2971
|
: formatArrayForCoveoCustomData(meta.partialQueries);
|
|
2988
|
-
var suggestions = typeof meta.suggestions === 'string'
|
|
2972
|
+
var suggestions = typeof meta.suggestions === 'string'
|
|
2973
|
+
? meta.suggestions
|
|
2974
|
+
: formatArrayForCoveoCustomData(meta.suggestions);
|
|
2989
2975
|
return __assign(__assign({}, meta), { partialQueries: partialQueries, suggestions: suggestions });
|
|
2990
2976
|
}
|
|
2991
2977
|
|
|
@@ -2993,8 +2979,11 @@
|
|
|
2993
2979
|
function CoveoSearchPageClient(opts, provider) {
|
|
2994
2980
|
this.opts = opts;
|
|
2995
2981
|
this.provider = provider;
|
|
2996
|
-
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
2997
|
-
|
|
2982
|
+
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
2983
|
+
shouldDisableAnalyticsForPrivacy(opts.disableBrowserPrivacySignals);
|
|
2984
|
+
this.coveoAnalyticsClient = shouldDisableAnalytics
|
|
2985
|
+
? new NoopAnalytics()
|
|
2986
|
+
: new CoveoAnalyticsClient(opts);
|
|
2998
2987
|
}
|
|
2999
2988
|
CoveoSearchPageClient.prototype.disable = function () {
|
|
3000
2989
|
this.coveoAnalyticsClient = new NoopAnalytics();
|
|
@@ -3010,7 +2999,9 @@
|
|
|
3010
2999
|
return __generator(this, function (_a) {
|
|
3011
3000
|
switch (_a.label) {
|
|
3012
3001
|
case 0: return [4, this.makeInterfaceLoad()];
|
|
3013
|
-
case 1: return [2, (_a.sent()).log({
|
|
3002
|
+
case 1: return [2, (_a.sent()).log({
|
|
3003
|
+
searchUID: this.provider.getSearchUID(),
|
|
3004
|
+
})];
|
|
3014
3005
|
}
|
|
3015
3006
|
});
|
|
3016
3007
|
});
|
|
@@ -3023,7 +3014,9 @@
|
|
|
3023
3014
|
return __generator(this, function (_a) {
|
|
3024
3015
|
switch (_a.label) {
|
|
3025
3016
|
case 0: return [4, this.makeRecommendationInterfaceLoad()];
|
|
3026
|
-
case 1: return [2, (_a.sent()).log({
|
|
3017
|
+
case 1: return [2, (_a.sent()).log({
|
|
3018
|
+
searchUID: this.provider.getSearchUID(),
|
|
3019
|
+
})];
|
|
3027
3020
|
}
|
|
3028
3021
|
});
|
|
3029
3022
|
});
|
|
@@ -3036,7 +3029,9 @@
|
|
|
3036
3029
|
return __generator(this, function (_a) {
|
|
3037
3030
|
switch (_a.label) {
|
|
3038
3031
|
case 0: return [4, this.makeRecommendation()];
|
|
3039
|
-
case 1: return [2, (_a.sent()).log({
|
|
3032
|
+
case 1: return [2, (_a.sent()).log({
|
|
3033
|
+
searchUID: this.provider.getSearchUID(),
|
|
3034
|
+
})];
|
|
3040
3035
|
}
|
|
3041
3036
|
});
|
|
3042
3037
|
});
|
|
@@ -3049,7 +3044,9 @@
|
|
|
3049
3044
|
return __generator(this, function (_a) {
|
|
3050
3045
|
switch (_a.label) {
|
|
3051
3046
|
case 0: return [4, this.makeRecommendationOpen(info, identifier)];
|
|
3052
|
-
case 1: return [2, (_a.sent()).log({
|
|
3047
|
+
case 1: return [2, (_a.sent()).log({
|
|
3048
|
+
searchUID: this.provider.getSearchUID(),
|
|
3049
|
+
})];
|
|
3053
3050
|
}
|
|
3054
3051
|
});
|
|
3055
3052
|
});
|
|
@@ -3062,7 +3059,9 @@
|
|
|
3062
3059
|
return __generator(this, function (_a) {
|
|
3063
3060
|
switch (_a.label) {
|
|
3064
3061
|
case 0: return [4, this.makeStaticFilterClearAll(meta)];
|
|
3065
|
-
case 1: return [2, (_a.sent()).log({
|
|
3062
|
+
case 1: return [2, (_a.sent()).log({
|
|
3063
|
+
searchUID: this.provider.getSearchUID(),
|
|
3064
|
+
})];
|
|
3066
3065
|
}
|
|
3067
3066
|
});
|
|
3068
3067
|
});
|
|
@@ -3075,7 +3074,9 @@
|
|
|
3075
3074
|
return __generator(this, function (_a) {
|
|
3076
3075
|
switch (_a.label) {
|
|
3077
3076
|
case 0: return [4, this.makeStaticFilterSelect(meta)];
|
|
3078
|
-
case 1: return [2, (_a.sent()).log({
|
|
3077
|
+
case 1: return [2, (_a.sent()).log({
|
|
3078
|
+
searchUID: this.provider.getSearchUID(),
|
|
3079
|
+
})];
|
|
3079
3080
|
}
|
|
3080
3081
|
});
|
|
3081
3082
|
});
|
|
@@ -3088,20 +3089,26 @@
|
|
|
3088
3089
|
return __generator(this, function (_a) {
|
|
3089
3090
|
switch (_a.label) {
|
|
3090
3091
|
case 0: return [4, this.makeStaticFilterDeselect(meta)];
|
|
3091
|
-
case 1: return [2, (_a.sent()).log({
|
|
3092
|
+
case 1: return [2, (_a.sent()).log({
|
|
3093
|
+
searchUID: this.provider.getSearchUID(),
|
|
3094
|
+
})];
|
|
3092
3095
|
}
|
|
3093
3096
|
});
|
|
3094
3097
|
});
|
|
3095
3098
|
};
|
|
3096
3099
|
CoveoSearchPageClient.prototype.makeFetchMoreResults = function () {
|
|
3097
|
-
return this.makeCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
3100
|
+
return this.makeCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
3101
|
+
type: 'getMoreResults',
|
|
3102
|
+
});
|
|
3098
3103
|
};
|
|
3099
3104
|
CoveoSearchPageClient.prototype.logFetchMoreResults = function () {
|
|
3100
3105
|
return __awaiter(this, void 0, void 0, function () {
|
|
3101
3106
|
return __generator(this, function (_a) {
|
|
3102
3107
|
switch (_a.label) {
|
|
3103
3108
|
case 0: return [4, this.makeFetchMoreResults()];
|
|
3104
|
-
case 1: return [2, (_a.sent()).log({
|
|
3109
|
+
case 1: return [2, (_a.sent()).log({
|
|
3110
|
+
searchUID: this.provider.getSearchUID(),
|
|
3111
|
+
})];
|
|
3105
3112
|
}
|
|
3106
3113
|
});
|
|
3107
3114
|
});
|
|
@@ -3114,7 +3121,9 @@
|
|
|
3114
3121
|
return __generator(this, function (_a) {
|
|
3115
3122
|
switch (_a.label) {
|
|
3116
3123
|
case 0: return [4, this.makeInterfaceChange(metadata)];
|
|
3117
|
-
case 1: return [2, (_a.sent()).log({
|
|
3124
|
+
case 1: return [2, (_a.sent()).log({
|
|
3125
|
+
searchUID: this.provider.getSearchUID(),
|
|
3126
|
+
})];
|
|
3118
3127
|
}
|
|
3119
3128
|
});
|
|
3120
3129
|
});
|
|
@@ -3127,7 +3136,9 @@
|
|
|
3127
3136
|
return __generator(this, function (_a) {
|
|
3128
3137
|
switch (_a.label) {
|
|
3129
3138
|
case 0: return [4, this.makeDidYouMeanAutomatic()];
|
|
3130
|
-
case 1: return [2, (_a.sent()).log({
|
|
3139
|
+
case 1: return [2, (_a.sent()).log({
|
|
3140
|
+
searchUID: this.provider.getSearchUID(),
|
|
3141
|
+
})];
|
|
3131
3142
|
}
|
|
3132
3143
|
});
|
|
3133
3144
|
});
|
|
@@ -3140,7 +3151,9 @@
|
|
|
3140
3151
|
return __generator(this, function (_a) {
|
|
3141
3152
|
switch (_a.label) {
|
|
3142
3153
|
case 0: return [4, this.makeDidYouMeanClick()];
|
|
3143
|
-
case 1: return [2, (_a.sent()).log({
|
|
3154
|
+
case 1: return [2, (_a.sent()).log({
|
|
3155
|
+
searchUID: this.provider.getSearchUID(),
|
|
3156
|
+
})];
|
|
3144
3157
|
}
|
|
3145
3158
|
});
|
|
3146
3159
|
});
|
|
@@ -3153,7 +3166,9 @@
|
|
|
3153
3166
|
return __generator(this, function (_a) {
|
|
3154
3167
|
switch (_a.label) {
|
|
3155
3168
|
case 0: return [4, this.makeResultsSort(metadata)];
|
|
3156
|
-
case 1: return [2, (_a.sent()).log({
|
|
3169
|
+
case 1: return [2, (_a.sent()).log({
|
|
3170
|
+
searchUID: this.provider.getSearchUID(),
|
|
3171
|
+
})];
|
|
3157
3172
|
}
|
|
3158
3173
|
});
|
|
3159
3174
|
});
|
|
@@ -3166,7 +3181,9 @@
|
|
|
3166
3181
|
return __generator(this, function (_a) {
|
|
3167
3182
|
switch (_a.label) {
|
|
3168
3183
|
case 0: return [4, this.makeSearchboxSubmit()];
|
|
3169
|
-
case 1: return [2, (_a.sent()).log({
|
|
3184
|
+
case 1: return [2, (_a.sent()).log({
|
|
3185
|
+
searchUID: this.provider.getSearchUID(),
|
|
3186
|
+
})];
|
|
3170
3187
|
}
|
|
3171
3188
|
});
|
|
3172
3189
|
});
|
|
@@ -3179,7 +3196,9 @@
|
|
|
3179
3196
|
return __generator(this, function (_a) {
|
|
3180
3197
|
switch (_a.label) {
|
|
3181
3198
|
case 0: return [4, this.makeSearchboxClear()];
|
|
3182
|
-
case 1: return [2, (_a.sent()).log({
|
|
3199
|
+
case 1: return [2, (_a.sent()).log({
|
|
3200
|
+
searchUID: this.provider.getSearchUID(),
|
|
3201
|
+
})];
|
|
3183
3202
|
}
|
|
3184
3203
|
});
|
|
3185
3204
|
});
|
|
@@ -3192,7 +3211,9 @@
|
|
|
3192
3211
|
return __generator(this, function (_a) {
|
|
3193
3212
|
switch (_a.label) {
|
|
3194
3213
|
case 0: return [4, this.makeSearchboxAsYouType()];
|
|
3195
|
-
case 1: return [2, (_a.sent()).log({
|
|
3214
|
+
case 1: return [2, (_a.sent()).log({
|
|
3215
|
+
searchUID: this.provider.getSearchUID(),
|
|
3216
|
+
})];
|
|
3196
3217
|
}
|
|
3197
3218
|
});
|
|
3198
3219
|
});
|
|
@@ -3205,7 +3226,9 @@
|
|
|
3205
3226
|
return __generator(this, function (_a) {
|
|
3206
3227
|
switch (_a.label) {
|
|
3207
3228
|
case 0: return [4, this.makeBreadcrumbFacet(metadata)];
|
|
3208
|
-
case 1: return [2, (_a.sent()).log({
|
|
3229
|
+
case 1: return [2, (_a.sent()).log({
|
|
3230
|
+
searchUID: this.provider.getSearchUID(),
|
|
3231
|
+
})];
|
|
3209
3232
|
}
|
|
3210
3233
|
});
|
|
3211
3234
|
});
|
|
@@ -3218,7 +3241,9 @@
|
|
|
3218
3241
|
return __generator(this, function (_a) {
|
|
3219
3242
|
switch (_a.label) {
|
|
3220
3243
|
case 0: return [4, this.makeBreadcrumbResetAll()];
|
|
3221
|
-
case 1: return [2, (_a.sent()).log({
|
|
3244
|
+
case 1: return [2, (_a.sent()).log({
|
|
3245
|
+
searchUID: this.provider.getSearchUID(),
|
|
3246
|
+
})];
|
|
3222
3247
|
}
|
|
3223
3248
|
});
|
|
3224
3249
|
});
|
|
@@ -3231,7 +3256,9 @@
|
|
|
3231
3256
|
return __generator(this, function (_a) {
|
|
3232
3257
|
switch (_a.label) {
|
|
3233
3258
|
case 0: return [4, this.makeDocumentQuickview(info, identifier)];
|
|
3234
|
-
case 1: return [2, (_a.sent()).log({
|
|
3259
|
+
case 1: return [2, (_a.sent()).log({
|
|
3260
|
+
searchUID: this.provider.getSearchUID(),
|
|
3261
|
+
})];
|
|
3235
3262
|
}
|
|
3236
3263
|
});
|
|
3237
3264
|
});
|
|
@@ -3244,7 +3271,9 @@
|
|
|
3244
3271
|
return __generator(this, function (_a) {
|
|
3245
3272
|
switch (_a.label) {
|
|
3246
3273
|
case 0: return [4, this.makeDocumentOpen(info, identifier)];
|
|
3247
|
-
case 1: return [2, (_a.sent()).log({
|
|
3274
|
+
case 1: return [2, (_a.sent()).log({
|
|
3275
|
+
searchUID: this.provider.getSearchUID(),
|
|
3276
|
+
})];
|
|
3248
3277
|
}
|
|
3249
3278
|
});
|
|
3250
3279
|
});
|
|
@@ -3257,7 +3286,9 @@
|
|
|
3257
3286
|
return __generator(this, function (_a) {
|
|
3258
3287
|
switch (_a.label) {
|
|
3259
3288
|
case 0: return [4, this.makeOmniboxAnalytics(meta)];
|
|
3260
|
-
case 1: return [2, (_a.sent()).log({
|
|
3289
|
+
case 1: return [2, (_a.sent()).log({
|
|
3290
|
+
searchUID: this.provider.getSearchUID(),
|
|
3291
|
+
})];
|
|
3261
3292
|
}
|
|
3262
3293
|
});
|
|
3263
3294
|
});
|
|
@@ -3270,7 +3301,9 @@
|
|
|
3270
3301
|
return __generator(this, function (_a) {
|
|
3271
3302
|
switch (_a.label) {
|
|
3272
3303
|
case 0: return [4, this.makeOmniboxFromLink(meta)];
|
|
3273
|
-
case 1: return [2, (_a.sent()).log({
|
|
3304
|
+
case 1: return [2, (_a.sent()).log({
|
|
3305
|
+
searchUID: this.provider.getSearchUID(),
|
|
3306
|
+
})];
|
|
3274
3307
|
}
|
|
3275
3308
|
});
|
|
3276
3309
|
});
|
|
@@ -3283,7 +3316,9 @@
|
|
|
3283
3316
|
return __generator(this, function (_a) {
|
|
3284
3317
|
switch (_a.label) {
|
|
3285
3318
|
case 0: return [4, this.makeSearchFromLink()];
|
|
3286
|
-
case 1: return [2, (_a.sent()).log({
|
|
3319
|
+
case 1: return [2, (_a.sent()).log({
|
|
3320
|
+
searchUID: this.provider.getSearchUID(),
|
|
3321
|
+
})];
|
|
3287
3322
|
}
|
|
3288
3323
|
});
|
|
3289
3324
|
});
|
|
@@ -3296,7 +3331,9 @@
|
|
|
3296
3331
|
return __generator(this, function (_a) {
|
|
3297
3332
|
switch (_a.label) {
|
|
3298
3333
|
case 0: return [4, this.makeTriggerNotify(meta)];
|
|
3299
|
-
case 1: return [2, (_a.sent()).log({
|
|
3334
|
+
case 1: return [2, (_a.sent()).log({
|
|
3335
|
+
searchUID: this.provider.getSearchUID(),
|
|
3336
|
+
})];
|
|
3300
3337
|
}
|
|
3301
3338
|
});
|
|
3302
3339
|
});
|
|
@@ -3309,7 +3346,9 @@
|
|
|
3309
3346
|
return __generator(this, function (_a) {
|
|
3310
3347
|
switch (_a.label) {
|
|
3311
3348
|
case 0: return [4, this.makeTriggerExecute(meta)];
|
|
3312
|
-
case 1: return [2, (_a.sent()).log({
|
|
3349
|
+
case 1: return [2, (_a.sent()).log({
|
|
3350
|
+
searchUID: this.provider.getSearchUID(),
|
|
3351
|
+
})];
|
|
3313
3352
|
}
|
|
3314
3353
|
});
|
|
3315
3354
|
});
|
|
@@ -3322,7 +3361,9 @@
|
|
|
3322
3361
|
return __generator(this, function (_a) {
|
|
3323
3362
|
switch (_a.label) {
|
|
3324
3363
|
case 0: return [4, this.makeTriggerQuery()];
|
|
3325
|
-
case 1: return [2, (_a.sent()).log({
|
|
3364
|
+
case 1: return [2, (_a.sent()).log({
|
|
3365
|
+
searchUID: this.provider.getSearchUID(),
|
|
3366
|
+
})];
|
|
3326
3367
|
}
|
|
3327
3368
|
});
|
|
3328
3369
|
});
|
|
@@ -3335,7 +3376,9 @@
|
|
|
3335
3376
|
return __generator(this, function (_a) {
|
|
3336
3377
|
switch (_a.label) {
|
|
3337
3378
|
case 0: return [4, this.makeUndoTriggerQuery(meta)];
|
|
3338
|
-
case 1: return [2, (_a.sent()).log({
|
|
3379
|
+
case 1: return [2, (_a.sent()).log({
|
|
3380
|
+
searchUID: this.provider.getSearchUID(),
|
|
3381
|
+
})];
|
|
3339
3382
|
}
|
|
3340
3383
|
});
|
|
3341
3384
|
});
|
|
@@ -3348,7 +3391,9 @@
|
|
|
3348
3391
|
return __generator(this, function (_a) {
|
|
3349
3392
|
switch (_a.label) {
|
|
3350
3393
|
case 0: return [4, this.makeTriggerRedirect(meta)];
|
|
3351
|
-
case 1: return [2, (_a.sent()).log({
|
|
3394
|
+
case 1: return [2, (_a.sent()).log({
|
|
3395
|
+
searchUID: this.provider.getSearchUID(),
|
|
3396
|
+
})];
|
|
3352
3397
|
}
|
|
3353
3398
|
});
|
|
3354
3399
|
});
|
|
@@ -3361,7 +3406,9 @@
|
|
|
3361
3406
|
return __generator(this, function (_a) {
|
|
3362
3407
|
switch (_a.label) {
|
|
3363
3408
|
case 0: return [4, this.makePagerResize(meta)];
|
|
3364
|
-
case 1: return [2, (_a.sent()).log({
|
|
3409
|
+
case 1: return [2, (_a.sent()).log({
|
|
3410
|
+
searchUID: this.provider.getSearchUID(),
|
|
3411
|
+
})];
|
|
3365
3412
|
}
|
|
3366
3413
|
});
|
|
3367
3414
|
});
|
|
@@ -3374,7 +3421,9 @@
|
|
|
3374
3421
|
return __generator(this, function (_a) {
|
|
3375
3422
|
switch (_a.label) {
|
|
3376
3423
|
case 0: return [4, this.makePagerNumber(meta)];
|
|
3377
|
-
case 1: return [2, (_a.sent()).log({
|
|
3424
|
+
case 1: return [2, (_a.sent()).log({
|
|
3425
|
+
searchUID: this.provider.getSearchUID(),
|
|
3426
|
+
})];
|
|
3378
3427
|
}
|
|
3379
3428
|
});
|
|
3380
3429
|
});
|
|
@@ -3387,7 +3436,9 @@
|
|
|
3387
3436
|
return __generator(this, function (_a) {
|
|
3388
3437
|
switch (_a.label) {
|
|
3389
3438
|
case 0: return [4, this.makePagerNext(meta)];
|
|
3390
|
-
case 1: return [2, (_a.sent()).log({
|
|
3439
|
+
case 1: return [2, (_a.sent()).log({
|
|
3440
|
+
searchUID: this.provider.getSearchUID(),
|
|
3441
|
+
})];
|
|
3391
3442
|
}
|
|
3392
3443
|
});
|
|
3393
3444
|
});
|
|
@@ -3400,7 +3451,9 @@
|
|
|
3400
3451
|
return __generator(this, function (_a) {
|
|
3401
3452
|
switch (_a.label) {
|
|
3402
3453
|
case 0: return [4, this.makePagerPrevious(meta)];
|
|
3403
|
-
case 1: return [2, (_a.sent()).log({
|
|
3454
|
+
case 1: return [2, (_a.sent()).log({
|
|
3455
|
+
searchUID: this.provider.getSearchUID(),
|
|
3456
|
+
})];
|
|
3404
3457
|
}
|
|
3405
3458
|
});
|
|
3406
3459
|
});
|
|
@@ -3413,7 +3466,9 @@
|
|
|
3413
3466
|
return __generator(this, function (_a) {
|
|
3414
3467
|
switch (_a.label) {
|
|
3415
3468
|
case 0: return [4, this.makePagerScrolling()];
|
|
3416
|
-
case 1: return [2, (_a.sent()).log({
|
|
3469
|
+
case 1: return [2, (_a.sent()).log({
|
|
3470
|
+
searchUID: this.provider.getSearchUID(),
|
|
3471
|
+
})];
|
|
3417
3472
|
}
|
|
3418
3473
|
});
|
|
3419
3474
|
});
|
|
@@ -3426,7 +3481,9 @@
|
|
|
3426
3481
|
return __generator(this, function (_a) {
|
|
3427
3482
|
switch (_a.label) {
|
|
3428
3483
|
case 0: return [4, this.makeFacetClearAll(meta)];
|
|
3429
|
-
case 1: return [2, (_a.sent()).log({
|
|
3484
|
+
case 1: return [2, (_a.sent()).log({
|
|
3485
|
+
searchUID: this.provider.getSearchUID(),
|
|
3486
|
+
})];
|
|
3430
3487
|
}
|
|
3431
3488
|
});
|
|
3432
3489
|
});
|
|
@@ -3439,7 +3496,9 @@
|
|
|
3439
3496
|
return __generator(this, function (_a) {
|
|
3440
3497
|
switch (_a.label) {
|
|
3441
3498
|
case 0: return [4, this.makeFacetSearch(meta)];
|
|
3442
|
-
case 1: return [2, (_a.sent()).log({
|
|
3499
|
+
case 1: return [2, (_a.sent()).log({
|
|
3500
|
+
searchUID: this.provider.getSearchUID(),
|
|
3501
|
+
})];
|
|
3443
3502
|
}
|
|
3444
3503
|
});
|
|
3445
3504
|
});
|
|
@@ -3452,7 +3511,9 @@
|
|
|
3452
3511
|
return __generator(this, function (_a) {
|
|
3453
3512
|
switch (_a.label) {
|
|
3454
3513
|
case 0: return [4, this.makeFacetSelect(meta)];
|
|
3455
|
-
case 1: return [2, (_a.sent()).log({
|
|
3514
|
+
case 1: return [2, (_a.sent()).log({
|
|
3515
|
+
searchUID: this.provider.getSearchUID(),
|
|
3516
|
+
})];
|
|
3456
3517
|
}
|
|
3457
3518
|
});
|
|
3458
3519
|
});
|
|
@@ -3465,7 +3526,9 @@
|
|
|
3465
3526
|
return __generator(this, function (_a) {
|
|
3466
3527
|
switch (_a.label) {
|
|
3467
3528
|
case 0: return [4, this.makeFacetDeselect(meta)];
|
|
3468
|
-
case 1: return [2, (_a.sent()).log({
|
|
3529
|
+
case 1: return [2, (_a.sent()).log({
|
|
3530
|
+
searchUID: this.provider.getSearchUID(),
|
|
3531
|
+
})];
|
|
3469
3532
|
}
|
|
3470
3533
|
});
|
|
3471
3534
|
});
|
|
@@ -3478,7 +3541,9 @@
|
|
|
3478
3541
|
return __generator(this, function (_a) {
|
|
3479
3542
|
switch (_a.label) {
|
|
3480
3543
|
case 0: return [4, this.makeFacetExclude(meta)];
|
|
3481
|
-
case 1: return [2, (_a.sent()).log({
|
|
3544
|
+
case 1: return [2, (_a.sent()).log({
|
|
3545
|
+
searchUID: this.provider.getSearchUID(),
|
|
3546
|
+
})];
|
|
3482
3547
|
}
|
|
3483
3548
|
});
|
|
3484
3549
|
});
|
|
@@ -3491,7 +3556,9 @@
|
|
|
3491
3556
|
return __generator(this, function (_a) {
|
|
3492
3557
|
switch (_a.label) {
|
|
3493
3558
|
case 0: return [4, this.makeFacetUnexclude(meta)];
|
|
3494
|
-
case 1: return [2, (_a.sent()).log({
|
|
3559
|
+
case 1: return [2, (_a.sent()).log({
|
|
3560
|
+
searchUID: this.provider.getSearchUID(),
|
|
3561
|
+
})];
|
|
3495
3562
|
}
|
|
3496
3563
|
});
|
|
3497
3564
|
});
|
|
@@ -3504,7 +3571,9 @@
|
|
|
3504
3571
|
return __generator(this, function (_a) {
|
|
3505
3572
|
switch (_a.label) {
|
|
3506
3573
|
case 0: return [4, this.makeFacetSelectAll(meta)];
|
|
3507
|
-
case 1: return [2, (_a.sent()).log({
|
|
3574
|
+
case 1: return [2, (_a.sent()).log({
|
|
3575
|
+
searchUID: this.provider.getSearchUID(),
|
|
3576
|
+
})];
|
|
3508
3577
|
}
|
|
3509
3578
|
});
|
|
3510
3579
|
});
|
|
@@ -3517,7 +3586,9 @@
|
|
|
3517
3586
|
return __generator(this, function (_a) {
|
|
3518
3587
|
switch (_a.label) {
|
|
3519
3588
|
case 0: return [4, this.makeFacetUpdateSort(meta)];
|
|
3520
|
-
case 1: return [2, (_a.sent()).log({
|
|
3589
|
+
case 1: return [2, (_a.sent()).log({
|
|
3590
|
+
searchUID: this.provider.getSearchUID(),
|
|
3591
|
+
})];
|
|
3521
3592
|
}
|
|
3522
3593
|
});
|
|
3523
3594
|
});
|
|
@@ -3530,7 +3601,9 @@
|
|
|
3530
3601
|
return __generator(this, function (_a) {
|
|
3531
3602
|
switch (_a.label) {
|
|
3532
3603
|
case 0: return [4, this.makeFacetShowMore(meta)];
|
|
3533
|
-
case 1: return [2, (_a.sent()).log({
|
|
3604
|
+
case 1: return [2, (_a.sent()).log({
|
|
3605
|
+
searchUID: this.provider.getSearchUID(),
|
|
3606
|
+
})];
|
|
3534
3607
|
}
|
|
3535
3608
|
});
|
|
3536
3609
|
});
|
|
@@ -3543,7 +3616,9 @@
|
|
|
3543
3616
|
return __generator(this, function (_a) {
|
|
3544
3617
|
switch (_a.label) {
|
|
3545
3618
|
case 0: return [4, this.makeFacetShowLess(meta)];
|
|
3546
|
-
case 1: return [2, (_a.sent()).log({
|
|
3619
|
+
case 1: return [2, (_a.sent()).log({
|
|
3620
|
+
searchUID: this.provider.getSearchUID(),
|
|
3621
|
+
})];
|
|
3547
3622
|
}
|
|
3548
3623
|
});
|
|
3549
3624
|
});
|
|
@@ -3556,7 +3631,9 @@
|
|
|
3556
3631
|
return __generator(this, function (_a) {
|
|
3557
3632
|
switch (_a.label) {
|
|
3558
3633
|
case 0: return [4, this.makeQueryError(meta)];
|
|
3559
|
-
case 1: return [2, (_a.sent()).log({
|
|
3634
|
+
case 1: return [2, (_a.sent()).log({
|
|
3635
|
+
searchUID: this.provider.getSearchUID(),
|
|
3636
|
+
})];
|
|
3560
3637
|
}
|
|
3561
3638
|
});
|
|
3562
3639
|
});
|
|
@@ -3592,7 +3669,9 @@
|
|
|
3592
3669
|
return __generator(this, function (_a) {
|
|
3593
3670
|
switch (_a.label) {
|
|
3594
3671
|
case 0: return [4, this.makeQueryErrorBack()];
|
|
3595
|
-
case 1: return [2, (_a.sent()).log({
|
|
3672
|
+
case 1: return [2, (_a.sent()).log({
|
|
3673
|
+
searchUID: this.provider.getSearchUID(),
|
|
3674
|
+
})];
|
|
3596
3675
|
}
|
|
3597
3676
|
});
|
|
3598
3677
|
});
|
|
@@ -3628,7 +3707,9 @@
|
|
|
3628
3707
|
return __generator(this, function (_a) {
|
|
3629
3708
|
switch (_a.label) {
|
|
3630
3709
|
case 0: return [4, this.makeQueryErrorRetry()];
|
|
3631
|
-
case 1: return [2, (_a.sent()).log({
|
|
3710
|
+
case 1: return [2, (_a.sent()).log({
|
|
3711
|
+
searchUID: this.provider.getSearchUID(),
|
|
3712
|
+
})];
|
|
3632
3713
|
}
|
|
3633
3714
|
});
|
|
3634
3715
|
});
|
|
@@ -3664,7 +3745,9 @@
|
|
|
3664
3745
|
return __generator(this, function (_a) {
|
|
3665
3746
|
switch (_a.label) {
|
|
3666
3747
|
case 0: return [4, this.makeQueryErrorClear()];
|
|
3667
|
-
case 1: return [2, (_a.sent()).log({
|
|
3748
|
+
case 1: return [2, (_a.sent()).log({
|
|
3749
|
+
searchUID: this.provider.getSearchUID(),
|
|
3750
|
+
})];
|
|
3668
3751
|
}
|
|
3669
3752
|
});
|
|
3670
3753
|
});
|
|
@@ -3677,7 +3760,9 @@
|
|
|
3677
3760
|
return __generator(this, function (_a) {
|
|
3678
3761
|
switch (_a.label) {
|
|
3679
3762
|
case 0: return [4, this.makeLikeSmartSnippet()];
|
|
3680
|
-
case 1: return [2, (_a.sent()).log({
|
|
3763
|
+
case 1: return [2, (_a.sent()).log({
|
|
3764
|
+
searchUID: this.provider.getSearchUID(),
|
|
3765
|
+
})];
|
|
3681
3766
|
}
|
|
3682
3767
|
});
|
|
3683
3768
|
});
|
|
@@ -3690,7 +3775,9 @@
|
|
|
3690
3775
|
return __generator(this, function (_a) {
|
|
3691
3776
|
switch (_a.label) {
|
|
3692
3777
|
case 0: return [4, this.makeDislikeSmartSnippet()];
|
|
3693
|
-
case 1: return [2, (_a.sent()).log({
|
|
3778
|
+
case 1: return [2, (_a.sent()).log({
|
|
3779
|
+
searchUID: this.provider.getSearchUID(),
|
|
3780
|
+
})];
|
|
3694
3781
|
}
|
|
3695
3782
|
});
|
|
3696
3783
|
});
|
|
@@ -3703,7 +3790,9 @@
|
|
|
3703
3790
|
return __generator(this, function (_a) {
|
|
3704
3791
|
switch (_a.label) {
|
|
3705
3792
|
case 0: return [4, this.makeExpandSmartSnippet()];
|
|
3706
|
-
case 1: return [2, (_a.sent()).log({
|
|
3793
|
+
case 1: return [2, (_a.sent()).log({
|
|
3794
|
+
searchUID: this.provider.getSearchUID(),
|
|
3795
|
+
})];
|
|
3707
3796
|
}
|
|
3708
3797
|
});
|
|
3709
3798
|
});
|
|
@@ -3716,7 +3805,9 @@
|
|
|
3716
3805
|
return __generator(this, function (_a) {
|
|
3717
3806
|
switch (_a.label) {
|
|
3718
3807
|
case 0: return [4, this.makeCollapseSmartSnippet()];
|
|
3719
|
-
case 1: return [2, (_a.sent()).log({
|
|
3808
|
+
case 1: return [2, (_a.sent()).log({
|
|
3809
|
+
searchUID: this.provider.getSearchUID(),
|
|
3810
|
+
})];
|
|
3720
3811
|
}
|
|
3721
3812
|
});
|
|
3722
3813
|
});
|
|
@@ -3729,7 +3820,9 @@
|
|
|
3729
3820
|
return __generator(this, function (_a) {
|
|
3730
3821
|
switch (_a.label) {
|
|
3731
3822
|
case 0: return [4, this.makeOpenSmartSnippetFeedbackModal()];
|
|
3732
|
-
case 1: return [2, (_a.sent()).log({
|
|
3823
|
+
case 1: return [2, (_a.sent()).log({
|
|
3824
|
+
searchUID: this.provider.getSearchUID(),
|
|
3825
|
+
})];
|
|
3733
3826
|
}
|
|
3734
3827
|
});
|
|
3735
3828
|
});
|
|
@@ -3742,13 +3835,18 @@
|
|
|
3742
3835
|
return __generator(this, function (_a) {
|
|
3743
3836
|
switch (_a.label) {
|
|
3744
3837
|
case 0: return [4, this.makeCloseSmartSnippetFeedbackModal()];
|
|
3745
|
-
case 1: return [2, (_a.sent()).log({
|
|
3838
|
+
case 1: return [2, (_a.sent()).log({
|
|
3839
|
+
searchUID: this.provider.getSearchUID(),
|
|
3840
|
+
})];
|
|
3746
3841
|
}
|
|
3747
3842
|
});
|
|
3748
3843
|
});
|
|
3749
3844
|
};
|
|
3750
3845
|
CoveoSearchPageClient.prototype.makeSmartSnippetFeedbackReason = function (reason, details) {
|
|
3751
|
-
return this.makeCustomEvent(SearchPageEvents.sendSmartSnippetReason, {
|
|
3846
|
+
return this.makeCustomEvent(SearchPageEvents.sendSmartSnippetReason, {
|
|
3847
|
+
reason: reason,
|
|
3848
|
+
details: details,
|
|
3849
|
+
});
|
|
3752
3850
|
};
|
|
3753
3851
|
CoveoSearchPageClient.prototype.logSmartSnippetFeedbackReason = function (reason, details) {
|
|
3754
3852
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3770,7 +3868,9 @@
|
|
|
3770
3868
|
return __generator(this, function (_a) {
|
|
3771
3869
|
switch (_a.label) {
|
|
3772
3870
|
case 0: return [4, this.makeExpandSmartSnippetSuggestion(snippet)];
|
|
3773
|
-
case 1: return [2, (_a.sent()).log({
|
|
3871
|
+
case 1: return [2, (_a.sent()).log({
|
|
3872
|
+
searchUID: this.provider.getSearchUID(),
|
|
3873
|
+
})];
|
|
3774
3874
|
}
|
|
3775
3875
|
});
|
|
3776
3876
|
});
|
|
@@ -3783,7 +3883,9 @@
|
|
|
3783
3883
|
return __generator(this, function (_a) {
|
|
3784
3884
|
switch (_a.label) {
|
|
3785
3885
|
case 0: return [4, this.makeCollapseSmartSnippetSuggestion(snippet)];
|
|
3786
|
-
case 1: return [2, (_a.sent()).log({
|
|
3886
|
+
case 1: return [2, (_a.sent()).log({
|
|
3887
|
+
searchUID: this.provider.getSearchUID(),
|
|
3888
|
+
})];
|
|
3787
3889
|
}
|
|
3788
3890
|
});
|
|
3789
3891
|
});
|
|
@@ -3796,7 +3898,9 @@
|
|
|
3796
3898
|
return __generator(this, function (_a) {
|
|
3797
3899
|
switch (_a.label) {
|
|
3798
3900
|
case 0: return [4, this.makeShowMoreSmartSnippetSuggestion(snippet)];
|
|
3799
|
-
case 1: return [2, (_a.sent()).log({
|
|
3901
|
+
case 1: return [2, (_a.sent()).log({
|
|
3902
|
+
searchUID: this.provider.getSearchUID(),
|
|
3903
|
+
})];
|
|
3800
3904
|
}
|
|
3801
3905
|
});
|
|
3802
3906
|
});
|
|
@@ -3809,7 +3913,9 @@
|
|
|
3809
3913
|
return __generator(this, function (_a) {
|
|
3810
3914
|
switch (_a.label) {
|
|
3811
3915
|
case 0: return [4, this.makeShowLessSmartSnippetSuggestion(snippet)];
|
|
3812
|
-
case 1: return [2, (_a.sent()).log({
|
|
3916
|
+
case 1: return [2, (_a.sent()).log({
|
|
3917
|
+
searchUID: this.provider.getSearchUID(),
|
|
3918
|
+
})];
|
|
3813
3919
|
}
|
|
3814
3920
|
});
|
|
3815
3921
|
});
|
|
@@ -3822,13 +3928,18 @@
|
|
|
3822
3928
|
return __generator(this, function (_a) {
|
|
3823
3929
|
switch (_a.label) {
|
|
3824
3930
|
case 0: return [4, this.makeOpenSmartSnippetSource(info, identifier)];
|
|
3825
|
-
case 1: return [2, (_a.sent()).log({
|
|
3931
|
+
case 1: return [2, (_a.sent()).log({
|
|
3932
|
+
searchUID: this.provider.getSearchUID(),
|
|
3933
|
+
})];
|
|
3826
3934
|
}
|
|
3827
3935
|
});
|
|
3828
3936
|
});
|
|
3829
3937
|
};
|
|
3830
3938
|
CoveoSearchPageClient.prototype.makeOpenSmartSnippetSuggestionSource = function (info, snippet) {
|
|
3831
|
-
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);
|
|
3832
3943
|
};
|
|
3833
3944
|
CoveoSearchPageClient.prototype.makeCopyToClipboard = function (info, identifier) {
|
|
3834
3945
|
return this.makeClickEvent(SearchPageEvents.copyToClipboard, info, identifier);
|
|
@@ -3838,7 +3949,9 @@
|
|
|
3838
3949
|
return __generator(this, function (_a) {
|
|
3839
3950
|
switch (_a.label) {
|
|
3840
3951
|
case 0: return [4, this.makeCopyToClipboard(info, identifier)];
|
|
3841
|
-
case 1: return [2, (_a.sent()).log({
|
|
3952
|
+
case 1: return [2, (_a.sent()).log({
|
|
3953
|
+
searchUID: this.provider.getSearchUID(),
|
|
3954
|
+
})];
|
|
3842
3955
|
}
|
|
3843
3956
|
});
|
|
3844
3957
|
});
|
|
@@ -3856,7 +3969,10 @@
|
|
|
3856
3969
|
});
|
|
3857
3970
|
};
|
|
3858
3971
|
CoveoSearchPageClient.prototype.makeOpenSmartSnippetInlineLink = function (info, identifierAndLink) {
|
|
3859
|
-
return this.makeClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
3972
|
+
return this.makeClickEvent(SearchPageEvents.openSmartSnippetInlineLink, info, {
|
|
3973
|
+
contentIDKey: identifierAndLink.contentIDKey,
|
|
3974
|
+
contentIDValue: identifierAndLink.contentIDValue,
|
|
3975
|
+
}, identifierAndLink);
|
|
3860
3976
|
};
|
|
3861
3977
|
CoveoSearchPageClient.prototype.logOpenSmartSnippetInlineLink = function (info, identifierAndLink) {
|
|
3862
3978
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3896,7 +4012,9 @@
|
|
|
3896
4012
|
return __generator(this, function (_a) {
|
|
3897
4013
|
switch (_a.label) {
|
|
3898
4014
|
case 0: return [4, this.makeRecentQueryClick()];
|
|
3899
|
-
case 1: return [2, (_a.sent()).log({
|
|
4015
|
+
case 1: return [2, (_a.sent()).log({
|
|
4016
|
+
searchUID: this.provider.getSearchUID(),
|
|
4017
|
+
})];
|
|
3900
4018
|
}
|
|
3901
4019
|
});
|
|
3902
4020
|
});
|
|
@@ -3909,20 +4027,27 @@
|
|
|
3909
4027
|
return __generator(this, function (_a) {
|
|
3910
4028
|
switch (_a.label) {
|
|
3911
4029
|
case 0: return [4, this.makeClearRecentQueries()];
|
|
3912
|
-
case 1: return [2, (_a.sent()).log({
|
|
4030
|
+
case 1: return [2, (_a.sent()).log({
|
|
4031
|
+
searchUID: this.provider.getSearchUID(),
|
|
4032
|
+
})];
|
|
3913
4033
|
}
|
|
3914
4034
|
});
|
|
3915
4035
|
});
|
|
3916
4036
|
};
|
|
3917
4037
|
CoveoSearchPageClient.prototype.makeRecentResultClick = function (info, identifier) {
|
|
3918
|
-
return this.makeCustomEvent(SearchPageEvents.recentResultClick, {
|
|
4038
|
+
return this.makeCustomEvent(SearchPageEvents.recentResultClick, {
|
|
4039
|
+
info: info,
|
|
4040
|
+
identifier: identifier,
|
|
4041
|
+
});
|
|
3919
4042
|
};
|
|
3920
4043
|
CoveoSearchPageClient.prototype.logRecentResultClick = function (info, identifier) {
|
|
3921
4044
|
return __awaiter(this, void 0, void 0, function () {
|
|
3922
4045
|
return __generator(this, function (_a) {
|
|
3923
4046
|
switch (_a.label) {
|
|
3924
4047
|
case 0: return [4, this.makeRecentResultClick(info, identifier)];
|
|
3925
|
-
case 1: return [2, (_a.sent()).log({
|
|
4048
|
+
case 1: return [2, (_a.sent()).log({
|
|
4049
|
+
searchUID: this.provider.getSearchUID(),
|
|
4050
|
+
})];
|
|
3926
4051
|
}
|
|
3927
4052
|
});
|
|
3928
4053
|
});
|
|
@@ -3935,7 +4060,9 @@
|
|
|
3935
4060
|
return __generator(this, function (_a) {
|
|
3936
4061
|
switch (_a.label) {
|
|
3937
4062
|
case 0: return [4, this.makeClearRecentResults()];
|
|
3938
|
-
case 1: return [2, (_a.sent()).log({
|
|
4063
|
+
case 1: return [2, (_a.sent()).log({
|
|
4064
|
+
searchUID: this.provider.getSearchUID(),
|
|
4065
|
+
})];
|
|
3939
4066
|
}
|
|
3940
4067
|
});
|
|
3941
4068
|
});
|
|
@@ -3948,7 +4075,9 @@
|
|
|
3948
4075
|
return __generator(this, function (_a) {
|
|
3949
4076
|
switch (_a.label) {
|
|
3950
4077
|
case 0: return [4, this.makeNoResultsBack()];
|
|
3951
|
-
case 1: return [2, (_a.sent()).log({
|
|
4078
|
+
case 1: return [2, (_a.sent()).log({
|
|
4079
|
+
searchUID: this.provider.getSearchUID(),
|
|
4080
|
+
})];
|
|
3952
4081
|
}
|
|
3953
4082
|
});
|
|
3954
4083
|
});
|
|
@@ -3961,7 +4090,9 @@
|
|
|
3961
4090
|
return __generator(this, function (_a) {
|
|
3962
4091
|
switch (_a.label) {
|
|
3963
4092
|
case 0: return [4, this.makeShowMoreFoldedResults(info, identifier)];
|
|
3964
|
-
case 1: return [2, (_a.sent()).log({
|
|
4093
|
+
case 1: return [2, (_a.sent()).log({
|
|
4094
|
+
searchUID: this.provider.getSearchUID(),
|
|
4095
|
+
})];
|
|
3965
4096
|
}
|
|
3966
4097
|
});
|
|
3967
4098
|
});
|
|
@@ -3974,7 +4105,9 @@
|
|
|
3974
4105
|
return __generator(this, function (_a) {
|
|
3975
4106
|
switch (_a.label) {
|
|
3976
4107
|
case 0: return [4, this.makeShowLessFoldedResults()];
|
|
3977
|
-
case 1: return [2, (_a.sent()).log({
|
|
4108
|
+
case 1: return [2, (_a.sent()).log({
|
|
4109
|
+
searchUID: this.provider.getSearchUID(),
|
|
4110
|
+
})];
|
|
3978
4111
|
}
|
|
3979
4112
|
});
|
|
3980
4113
|
});
|
|
@@ -4016,7 +4149,9 @@
|
|
|
4016
4149
|
return __generator(this, function (_a) {
|
|
4017
4150
|
switch (_a.label) {
|
|
4018
4151
|
case 0: return [4, this.makeCustomEvent(event, metadata, eventType)];
|
|
4019
|
-
case 1: return [2, (_a.sent()).log({
|
|
4152
|
+
case 1: return [2, (_a.sent()).log({
|
|
4153
|
+
searchUID: this.provider.getSearchUID(),
|
|
4154
|
+
})];
|
|
4020
4155
|
}
|
|
4021
4156
|
});
|
|
4022
4157
|
});
|
|
@@ -4063,7 +4198,9 @@
|
|
|
4063
4198
|
return __generator(this, function (_a) {
|
|
4064
4199
|
switch (_a.label) {
|
|
4065
4200
|
case 0: return [4, this.makeSearchEvent(event, metadata)];
|
|
4066
|
-
case 1: return [2, (_a.sent()).log({
|
|
4201
|
+
case 1: return [2, (_a.sent()).log({
|
|
4202
|
+
searchUID: this.provider.getSearchUID(),
|
|
4203
|
+
})];
|
|
4067
4204
|
}
|
|
4068
4205
|
});
|
|
4069
4206
|
});
|
|
@@ -4171,8 +4308,12 @@
|
|
|
4171
4308
|
: undefined;
|
|
4172
4309
|
};
|
|
4173
4310
|
CoveoSearchPageClient.prototype.getSplitTestRun = function () {
|
|
4174
|
-
var splitTestRunName = this.provider.getSplitTestRunName
|
|
4175
|
-
|
|
4311
|
+
var splitTestRunName = this.provider.getSplitTestRunName
|
|
4312
|
+
? this.provider.getSplitTestRunName()
|
|
4313
|
+
: '';
|
|
4314
|
+
var splitTestRunVersion = this.provider.getSplitTestRunVersion
|
|
4315
|
+
? this.provider.getSplitTestRunVersion()
|
|
4316
|
+
: '';
|
|
4176
4317
|
return __assign(__assign({}, (splitTestRunName && { splitTestRunName: splitTestRunName })), (splitTestRunVersion && { splitTestRunVersion: splitTestRunVersion }));
|
|
4177
4318
|
};
|
|
4178
4319
|
CoveoSearchPageClient.prototype.makeLikeGeneratedAnswer = function (metadata) {
|
|
@@ -4183,7 +4324,9 @@
|
|
|
4183
4324
|
return __generator(this, function (_a) {
|
|
4184
4325
|
switch (_a.label) {
|
|
4185
4326
|
case 0: return [4, this.makeLikeGeneratedAnswer(metadata)];
|
|
4186
|
-
case 1: return [2, (_a.sent()).log({
|
|
4327
|
+
case 1: return [2, (_a.sent()).log({
|
|
4328
|
+
searchUID: this.provider.getSearchUID(),
|
|
4329
|
+
})];
|
|
4187
4330
|
}
|
|
4188
4331
|
});
|
|
4189
4332
|
});
|
|
@@ -4196,7 +4339,9 @@
|
|
|
4196
4339
|
return __generator(this, function (_a) {
|
|
4197
4340
|
switch (_a.label) {
|
|
4198
4341
|
case 0: return [4, this.makeDislikeGeneratedAnswer(metadata)];
|
|
4199
|
-
case 1: return [2, (_a.sent()).log({
|
|
4342
|
+
case 1: return [2, (_a.sent()).log({
|
|
4343
|
+
searchUID: this.provider.getSearchUID(),
|
|
4344
|
+
})];
|
|
4200
4345
|
}
|
|
4201
4346
|
});
|
|
4202
4347
|
});
|
|
@@ -4232,7 +4377,10 @@
|
|
|
4232
4377
|
});
|
|
4233
4378
|
};
|
|
4234
4379
|
CoveoSearchPageClient.prototype.makeGeneratedAnswerCitationClick = function (info, citation) {
|
|
4235
|
-
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);
|
|
4236
4384
|
};
|
|
4237
4385
|
CoveoSearchPageClient.prototype.logGeneratedAnswerCitationClick = function (info, citation) {
|
|
4238
4386
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4246,6 +4394,21 @@
|
|
|
4246
4394
|
});
|
|
4247
4395
|
});
|
|
4248
4396
|
};
|
|
4397
|
+
CoveoSearchPageClient.prototype.makeGeneratedAnswerFollowupOpenSource = function (metadata) {
|
|
4398
|
+
return this.makeCustomEvent(SearchPageEvents.generatedAnswerFollowupOpenSource, metadata);
|
|
4399
|
+
};
|
|
4400
|
+
CoveoSearchPageClient.prototype.logGeneratedAnswerFollowupOpenSource = function (metadata) {
|
|
4401
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4402
|
+
return __generator(this, function (_a) {
|
|
4403
|
+
switch (_a.label) {
|
|
4404
|
+
case 0: return [4, this.makeGeneratedAnswerFollowupOpenSource(metadata)];
|
|
4405
|
+
case 1: return [2, (_a.sent()).log({
|
|
4406
|
+
searchUID: this.provider.getSearchUID(),
|
|
4407
|
+
})];
|
|
4408
|
+
}
|
|
4409
|
+
});
|
|
4410
|
+
});
|
|
4411
|
+
};
|
|
4249
4412
|
CoveoSearchPageClient.prototype.makeGeneratedAnswerSourceHover = function (metadata) {
|
|
4250
4413
|
return this.makeCustomEvent(SearchPageEvents.generatedAnswerSourceHover, metadata);
|
|
4251
4414
|
};
|
|
@@ -4314,7 +4477,9 @@
|
|
|
4314
4477
|
return __generator(this, function (_a) {
|
|
4315
4478
|
switch (_a.label) {
|
|
4316
4479
|
case 0: return [4, this.makeGeneratedAnswerExpand(metadata)];
|
|
4317
|
-
case 1: return [2, (_a.sent()).log({
|
|
4480
|
+
case 1: return [2, (_a.sent()).log({
|
|
4481
|
+
searchUID: this.provider.getSearchUID(),
|
|
4482
|
+
})];
|
|
4318
4483
|
}
|
|
4319
4484
|
});
|
|
4320
4485
|
});
|
|
@@ -4327,7 +4492,9 @@
|
|
|
4327
4492
|
return __generator(this, function (_a) {
|
|
4328
4493
|
switch (_a.label) {
|
|
4329
4494
|
case 0: return [4, this.makeGeneratedAnswerCollapse(metadata)];
|
|
4330
|
-
case 1: return [2, (_a.sent()).log({
|
|
4495
|
+
case 1: return [2, (_a.sent()).log({
|
|
4496
|
+
searchUID: this.provider.getSearchUID(),
|
|
4497
|
+
})];
|
|
4331
4498
|
}
|
|
4332
4499
|
});
|
|
4333
4500
|
});
|
|
@@ -4370,7 +4537,9 @@
|
|
|
4370
4537
|
return __generator(this, function (_a) {
|
|
4371
4538
|
switch (_a.label) {
|
|
4372
4539
|
case 0: return [4, this.makeRephraseGeneratedAnswer(meta)];
|
|
4373
|
-
case 1: return [2, (_a.sent()).log({
|
|
4540
|
+
case 1: return [2, (_a.sent()).log({
|
|
4541
|
+
searchUID: this.provider.getSearchUID(),
|
|
4542
|
+
})];
|
|
4374
4543
|
}
|
|
4375
4544
|
});
|
|
4376
4545
|
});
|
|
@@ -4383,7 +4552,9 @@
|
|
|
4383
4552
|
return __generator(this, function (_a) {
|
|
4384
4553
|
switch (_a.label) {
|
|
4385
4554
|
case 0: return [4, this.makeRetryGeneratedAnswer()];
|
|
4386
|
-
case 1: return [2, (_a.sent()).log({
|
|
4555
|
+
case 1: return [2, (_a.sent()).log({
|
|
4556
|
+
searchUID: this.provider.getSearchUID(),
|
|
4557
|
+
})];
|
|
4387
4558
|
}
|
|
4388
4559
|
});
|
|
4389
4560
|
});
|
|
@@ -4396,7 +4567,9 @@
|
|
|
4396
4567
|
return __generator(this, function (_a) {
|
|
4397
4568
|
switch (_a.label) {
|
|
4398
4569
|
case 0: return [4, this.makeGeneratedAnswerStreamEnd(metadata)];
|
|
4399
|
-
case 1: return [2, (_a.sent()).log({
|
|
4570
|
+
case 1: return [2, (_a.sent()).log({
|
|
4571
|
+
searchUID: this.provider.getSearchUID(),
|
|
4572
|
+
})];
|
|
4400
4573
|
}
|
|
4401
4574
|
});
|
|
4402
4575
|
});
|
|
@@ -4433,8 +4606,11 @@
|
|
|
4433
4606
|
var _a;
|
|
4434
4607
|
this.options = options;
|
|
4435
4608
|
this.provider = provider;
|
|
4436
|
-
var analyticsEnabled = ((_a = options.enableAnalytics) !== null && _a !== void 0 ? _a : true) &&
|
|
4437
|
-
|
|
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();
|
|
4438
4614
|
this.svc = new SVCPlugin({ client: this.coveoAnalyticsClient });
|
|
4439
4615
|
}
|
|
4440
4616
|
CaseAssistClient.prototype.disable = function () {
|
|
@@ -4587,14 +4763,19 @@
|
|
|
4587
4763
|
if (includeContext === void 0) { includeContext = true; }
|
|
4588
4764
|
metadata.caseContext; var caseId = metadata.caseId, caseNumber = metadata.caseNumber, metadataWithoutContext = __rest(metadata, ["caseContext", "caseId", "caseNumber"]);
|
|
4589
4765
|
var context = extractContextFromMetadata(metadata);
|
|
4590
|
-
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));
|
|
4591
4769
|
};
|
|
4592
4770
|
var CoveoInsightClient = (function () {
|
|
4593
4771
|
function CoveoInsightClient(opts, provider) {
|
|
4594
4772
|
this.opts = opts;
|
|
4595
4773
|
this.provider = provider;
|
|
4596
|
-
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
4597
|
-
|
|
4774
|
+
var shouldDisableAnalytics = opts.enableAnalytics === false ||
|
|
4775
|
+
shouldDisableAnalyticsForPrivacy(opts.disableBrowserPrivacySignals);
|
|
4776
|
+
this.coveoAnalyticsClient = shouldDisableAnalytics
|
|
4777
|
+
? new NoopAnalytics()
|
|
4778
|
+
: new CoveoAnalyticsClient(opts);
|
|
4598
4779
|
}
|
|
4599
4780
|
CoveoInsightClient.prototype.disable = function () {
|
|
4600
4781
|
this.coveoAnalyticsClient = new NoopAnalytics();
|
|
@@ -4636,7 +4817,9 @@
|
|
|
4636
4817
|
var metadataToSend = generateMetadataToSend(metadata);
|
|
4637
4818
|
return this.logCustomEvent(SearchPageEvents.pagerScrolling, __assign(__assign({}, metadataToSend), { type: 'getMoreResults' }));
|
|
4638
4819
|
}
|
|
4639
|
-
return this.logCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
4820
|
+
return this.logCustomEvent(SearchPageEvents.pagerScrolling, {
|
|
4821
|
+
type: 'getMoreResults',
|
|
4822
|
+
});
|
|
4640
4823
|
};
|
|
4641
4824
|
CoveoInsightClient.prototype.logBreadcrumbFacet = function (metadata) {
|
|
4642
4825
|
var metadataToSend = generateMetadataToSend(metadata);
|
|
@@ -4745,7 +4928,8 @@
|
|
|
4745
4928
|
return this.logCustomEvent(InsightEvents.clickPageView, __assign(__assign({}, generateMetadataToSend(metadata, false)), { pageView: pageView }));
|
|
4746
4929
|
};
|
|
4747
4930
|
CoveoInsightClient.prototype.logCreateArticle = function (createArticleMetadata, metadata) {
|
|
4748
|
-
return this.logCustomEvent(InsightEvents.createArticle, metadata
|
|
4931
|
+
return this.logCustomEvent(InsightEvents.createArticle, metadata
|
|
4932
|
+
? __assign(__assign({}, generateMetadataToSend(metadata, false)), createArticleMetadata) : createArticleMetadata);
|
|
4749
4933
|
};
|
|
4750
4934
|
CoveoInsightClient.prototype.logDocumentOpen = function (info, identifier, metadata) {
|
|
4751
4935
|
return this.logClickEvent(SearchPageEvents.documentOpen, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
@@ -4811,10 +4995,17 @@
|
|
|
4811
4995
|
return this.logClickEvent(SearchPageEvents.openSmartSnippetSource, info, identifier, metadata ? generateMetadataToSend(metadata, false) : undefined);
|
|
4812
4996
|
};
|
|
4813
4997
|
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionSource = function (info, snippet, metadata) {
|
|
4814
|
-
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);
|
|
4815
5002
|
};
|
|
4816
5003
|
CoveoInsightClient.prototype.logOpenSmartSnippetInlineLink = function (info, identifierAndLink, metadata) {
|
|
4817
|
-
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);
|
|
4818
5009
|
};
|
|
4819
5010
|
CoveoInsightClient.prototype.logOpenSmartSnippetSuggestionInlineLink = function (info, snippetAndLink, metadata) {
|
|
4820
5011
|
return this.logClickEvent(SearchPageEvents.openSmartSnippetSuggestionInlineLink, info, {
|
|
@@ -4835,7 +5026,10 @@
|
|
|
4835
5026
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerSourceMetadata) : generatedAnswerSourceMetadata);
|
|
4836
5027
|
};
|
|
4837
5028
|
CoveoInsightClient.prototype.logGeneratedAnswerCitationClick = function (info, citation, metadata) {
|
|
4838
|
-
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);
|
|
4839
5033
|
};
|
|
4840
5034
|
CoveoInsightClient.prototype.logGeneratedAnswerSourceHover = function (generatedAnswerSourceMetadata, metadata) {
|
|
4841
5035
|
return this.logCustomEvent(SearchPageEvents.generatedAnswerSourceHover, metadata
|
|
@@ -4881,7 +5075,10 @@
|
|
|
4881
5075
|
? __assign(__assign({}, generateMetadataToSend(metadata, false)), generatedAnswerStreamEndMetadata) : generatedAnswerStreamEndMetadata);
|
|
4882
5076
|
};
|
|
4883
5077
|
CoveoInsightClient.prototype.logGeneratedAnswerCitationDocumentAttach = function (info, citation, metadata) {
|
|
4884
|
-
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);
|
|
4885
5082
|
};
|
|
4886
5083
|
CoveoInsightClient.prototype.logCustomEvent = function (event, metadata) {
|
|
4887
5084
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4942,7 +5139,8 @@
|
|
|
4942
5139
|
});
|
|
4943
5140
|
};
|
|
4944
5141
|
CoveoInsightClient.prototype.logTriggerNotify = function (triggerNotifyMetadata, metadata) {
|
|
4945
|
-
return this.logCustomEvent(SearchPageEvents.triggerNotify, metadata
|
|
5142
|
+
return this.logCustomEvent(SearchPageEvents.triggerNotify, metadata
|
|
5143
|
+
? __assign(__assign({}, generateMetadataToSend(metadata, false)), triggerNotifyMetadata) : triggerNotifyMetadata);
|
|
4946
5144
|
};
|
|
4947
5145
|
CoveoInsightClient.prototype.getBaseCustomEventRequest = function (metadata) {
|
|
4948
5146
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -5041,7 +5239,9 @@
|
|
|
5041
5239
|
if (coveoua.q) {
|
|
5042
5240
|
var initEvents = coveoua.q.filter(function (args) { return args[0] === 'init'; });
|
|
5043
5241
|
var otherEvents = coveoua.q.filter(function (args) { return args[0] !== 'init'; });
|
|
5044
|
-
__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
|
+
});
|
|
5045
5245
|
}
|
|
5046
5246
|
var browser = self.coveoua;
|
|
5047
5247
|
|