coveo.analytics 2.19.4 → 2.19.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coveoua.browser.js +1 -1
- package/dist/coveoua.browser.js.map +1 -1
- package/dist/coveoua.js +1 -1
- package/dist/coveoua.js.map +1 -1
- package/dist/definitions/caseAssist/caseAssistActions.d.ts +1 -0
- package/dist/definitions/caseAssist/caseAssistClient.d.ts +5 -1
- package/dist/definitions/client/measurementProtocolMapping/commerceMeasurementProtocolMapper.d.ts +2 -2
- package/dist/definitions/client/measurementProtocolMapping/serviceMeasurementProtocolMapper.d.ts +2 -1
- package/dist/definitions/coveoua/headless.d.ts +1 -1
- package/dist/definitions/coveoua/library.d.ts +1 -1
- package/dist/definitions/src/coveoua/headless.d.ts +1 -1
- package/dist/definitions/src/coveoua/library.d.ts +1 -1
- package/dist/library.es.js +25 -14
- package/dist/library.js +297 -461
- package/dist/react-native.es.js +10 -10
- package/package.json +4 -1
- package/src/caseAssist/caseAssistActions.ts +1 -0
- package/src/caseAssist/caseAssistClient.spec.ts +17 -5
- package/src/caseAssist/caseAssistClient.ts +28 -4
- package/src/coveoua/headless.ts +1 -1
- package/src/coveoua/library.ts +1 -1
- package/dist/definitions/src/client/location.d.ts +0 -1
package/dist/library.js
CHANGED
|
@@ -20,283 +20,106 @@ var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
|
|
|
20
20
|
var require$$5__default = /*#__PURE__*/_interopDefaultLegacy(require$$5);
|
|
21
21
|
var require$$6__default = /*#__PURE__*/_interopDefaultLegacy(require$$6);
|
|
22
22
|
|
|
23
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
24
|
-
|
|
25
|
-
var tslib = {exports: {}};
|
|
26
|
-
|
|
27
23
|
/*! *****************************************************************************
|
|
28
|
-
Copyright (c) Microsoft Corporation.
|
|
29
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
30
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
31
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
24
|
+
Copyright (c) Microsoft Corporation.
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
36
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
26
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
27
|
+
purpose with or without fee is hereby granted.
|
|
37
28
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
var __awaiter;
|
|
51
|
-
var __generator;
|
|
52
|
-
var __exportStar;
|
|
53
|
-
var __values;
|
|
54
|
-
var __read;
|
|
55
|
-
var __spread;
|
|
56
|
-
var __spreadArrays;
|
|
57
|
-
var __await;
|
|
58
|
-
var __asyncGenerator;
|
|
59
|
-
var __asyncDelegator;
|
|
60
|
-
var __asyncValues;
|
|
61
|
-
var __makeTemplateObject;
|
|
62
|
-
var __importStar;
|
|
63
|
-
var __importDefault;
|
|
64
|
-
var __classPrivateFieldGet;
|
|
65
|
-
var __classPrivateFieldSet;
|
|
66
|
-
(function (factory) {
|
|
67
|
-
var root = typeof commonjsGlobal === "object" ? commonjsGlobal : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
|
68
|
-
{
|
|
69
|
-
factory(createExporter(root, createExporter(module.exports)));
|
|
70
|
-
}
|
|
71
|
-
function createExporter(exports, previous) {
|
|
72
|
-
if (exports !== root) {
|
|
73
|
-
if (typeof Object.create === "function") {
|
|
74
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
exports.__esModule = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
(function (exporter) {
|
|
84
|
-
var extendStatics = Object.setPrototypeOf ||
|
|
29
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
30
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
31
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
32
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
33
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
34
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
35
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
36
|
+
***************************************************************************** */
|
|
37
|
+
/* global Reflect, Promise */
|
|
38
|
+
|
|
39
|
+
var extendStatics = function(d, b) {
|
|
40
|
+
extendStatics = Object.setPrototypeOf ||
|
|
85
41
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
86
|
-
function (d, b) { for (var p in b) if (
|
|
42
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
43
|
+
return extendStatics(d, b);
|
|
44
|
+
};
|
|
87
45
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
46
|
+
function __extends(d, b) {
|
|
47
|
+
if (typeof b !== "function" && b !== null)
|
|
48
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
49
|
+
extendStatics(d, b);
|
|
50
|
+
function __() { this.constructor = d; }
|
|
51
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
52
|
+
}
|
|
93
53
|
|
|
94
|
-
|
|
54
|
+
var __assign = function() {
|
|
55
|
+
__assign = Object.assign || function __assign(t) {
|
|
95
56
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
96
57
|
s = arguments[i];
|
|
97
58
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
98
59
|
}
|
|
99
60
|
return t;
|
|
100
61
|
};
|
|
62
|
+
return __assign.apply(this, arguments);
|
|
63
|
+
};
|
|
101
64
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
return t;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
__decorate = function (decorators, target, key, desc) {
|
|
115
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
116
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
117
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
118
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
__param = function (paramIndex, decorator) {
|
|
122
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
__metadata = function (metadataKey, metadataValue) {
|
|
126
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
__awaiter = function (thisArg, _arguments, P, generator) {
|
|
130
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
131
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
132
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
133
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
134
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
135
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
__generator = function (thisArg, body) {
|
|
140
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
141
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
142
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
143
|
-
function step(op) {
|
|
144
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
145
|
-
while (_) try {
|
|
146
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
147
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
148
|
-
switch (op[0]) {
|
|
149
|
-
case 0: case 1: t = op; break;
|
|
150
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
151
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
152
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
153
|
-
default:
|
|
154
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
155
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
156
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
157
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
158
|
-
if (t[2]) _.ops.pop();
|
|
159
|
-
_.trys.pop(); continue;
|
|
160
|
-
}
|
|
161
|
-
op = body.call(thisArg, _);
|
|
162
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
163
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
65
|
+
function __rest(s, e) {
|
|
66
|
+
var t = {};
|
|
67
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
68
|
+
t[p] = s[p];
|
|
69
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
70
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
71
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
72
|
+
t[p[i]] = s[p[i]];
|
|
164
73
|
}
|
|
165
|
-
|
|
74
|
+
return t;
|
|
75
|
+
}
|
|
166
76
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
77
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
78
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
79
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
80
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
81
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
82
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
83
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
84
|
+
});
|
|
85
|
+
}
|
|
170
86
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
87
|
+
function __generator(thisArg, body) {
|
|
88
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
89
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
90
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
91
|
+
function step(op) {
|
|
92
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
93
|
+
while (_) try {
|
|
94
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
95
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
96
|
+
switch (op[0]) {
|
|
97
|
+
case 0: case 1: t = op; break;
|
|
98
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
99
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
100
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
101
|
+
default:
|
|
102
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
103
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
104
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
105
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
106
|
+
if (t[2]) _.ops.pop();
|
|
107
|
+
_.trys.pop(); continue;
|
|
178
108
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
185
|
-
if (!m) return o;
|
|
186
|
-
var i = m.call(o), r, ar = [], e;
|
|
187
|
-
try {
|
|
188
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
189
|
-
}
|
|
190
|
-
catch (error) { e = { error: error }; }
|
|
191
|
-
finally {
|
|
192
|
-
try {
|
|
193
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
194
|
-
}
|
|
195
|
-
finally { if (e) throw e.error; }
|
|
196
|
-
}
|
|
197
|
-
return ar;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
__spread = function () {
|
|
201
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
202
|
-
ar = ar.concat(__read(arguments[i]));
|
|
203
|
-
return ar;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
__spreadArrays = function () {
|
|
207
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
208
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
209
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
210
|
-
r[k] = a[j];
|
|
211
|
-
return r;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
__await = function (v) {
|
|
215
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
__asyncGenerator = function (thisArg, _arguments, generator) {
|
|
219
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
220
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
221
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
222
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
223
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
224
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
225
|
-
function fulfill(value) { resume("next", value); }
|
|
226
|
-
function reject(value) { resume("throw", value); }
|
|
227
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
__asyncDelegator = function (o) {
|
|
231
|
-
var i, p;
|
|
232
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
233
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
__asyncValues = function (o) {
|
|
237
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
238
|
-
var m = o[Symbol.asyncIterator], i;
|
|
239
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
240
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
241
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
__makeTemplateObject = function (cooked, raw) {
|
|
245
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
246
|
-
return cooked;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
__importStar = function (mod) {
|
|
250
|
-
if (mod && mod.__esModule) return mod;
|
|
251
|
-
var result = {};
|
|
252
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
253
|
-
result["default"] = mod;
|
|
254
|
-
return result;
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
__importDefault = function (mod) {
|
|
258
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
__classPrivateFieldGet = function (receiver, privateMap) {
|
|
262
|
-
if (!privateMap.has(receiver)) {
|
|
263
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
264
|
-
}
|
|
265
|
-
return privateMap.get(receiver);
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
__classPrivateFieldSet = function (receiver, privateMap, value) {
|
|
269
|
-
if (!privateMap.has(receiver)) {
|
|
270
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
271
|
-
}
|
|
272
|
-
privateMap.set(receiver, value);
|
|
273
|
-
return value;
|
|
274
|
-
};
|
|
109
|
+
op = body.call(thisArg, _);
|
|
110
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
111
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
275
114
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
exporter("__exportStar", __exportStar);
|
|
285
|
-
exporter("__values", __values);
|
|
286
|
-
exporter("__read", __read);
|
|
287
|
-
exporter("__spread", __spread);
|
|
288
|
-
exporter("__spreadArrays", __spreadArrays);
|
|
289
|
-
exporter("__await", __await);
|
|
290
|
-
exporter("__asyncGenerator", __asyncGenerator);
|
|
291
|
-
exporter("__asyncDelegator", __asyncDelegator);
|
|
292
|
-
exporter("__asyncValues", __asyncValues);
|
|
293
|
-
exporter("__makeTemplateObject", __makeTemplateObject);
|
|
294
|
-
exporter("__importStar", __importStar);
|
|
295
|
-
exporter("__importDefault", __importDefault);
|
|
296
|
-
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
|
297
|
-
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
|
298
|
-
});
|
|
299
|
-
}(tslib));
|
|
115
|
+
/** @deprecated */
|
|
116
|
+
function __spreadArrays() {
|
|
117
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
118
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
119
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
120
|
+
r[k] = a[j];
|
|
121
|
+
return r;
|
|
122
|
+
}
|
|
300
123
|
|
|
301
124
|
var EventType;
|
|
302
125
|
(function (EventType) {
|
|
@@ -345,7 +168,7 @@ function hasCryptoRandomValues() {
|
|
|
345
168
|
var eventTypesForDefaultValues = [EventType.click, EventType.custom, EventType.search, EventType.view];
|
|
346
169
|
var addDefaultValues = function (eventType, payload) {
|
|
347
170
|
return eventTypesForDefaultValues.indexOf(eventType) !== -1
|
|
348
|
-
?
|
|
171
|
+
? __assign({ language: hasDocument() ? document.documentElement.lang : 'unknown', userAgent: hasNavigator() ? navigator.userAgent : 'unknown' }, payload) : payload;
|
|
349
172
|
};
|
|
350
173
|
|
|
351
174
|
var Cookie = (function () {
|
|
@@ -457,12 +280,12 @@ var NullStorage = (function () {
|
|
|
457
280
|
}());
|
|
458
281
|
|
|
459
282
|
var storage = /*#__PURE__*/Object.freeze({
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
283
|
+
__proto__: null,
|
|
284
|
+
preferredStorage: preferredStorage,
|
|
285
|
+
getAvailableStorage: getAvailableStorage,
|
|
286
|
+
CookieStorage: CookieStorage,
|
|
287
|
+
CookieAndLocalStorage: CookieAndLocalStorage,
|
|
288
|
+
NullStorage: NullStorage
|
|
466
289
|
});
|
|
467
290
|
|
|
468
291
|
var STORE_KEY = '__coveo.analytics.history';
|
|
@@ -487,9 +310,9 @@ var HistoryStore = (function () {
|
|
|
487
310
|
}
|
|
488
311
|
};
|
|
489
312
|
HistoryStore.prototype.addElementAsync = function (elem) {
|
|
490
|
-
return
|
|
313
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
491
314
|
var currentHistory;
|
|
492
|
-
return
|
|
315
|
+
return __generator(this, function (_a) {
|
|
493
316
|
switch (_a.label) {
|
|
494
317
|
case 0:
|
|
495
318
|
elem.internalTime = new Date().getTime();
|
|
@@ -515,9 +338,9 @@ var HistoryStore = (function () {
|
|
|
515
338
|
return this.stripEmptyQueries(this.stripInternalTime(history));
|
|
516
339
|
};
|
|
517
340
|
HistoryStore.prototype.getHistoryAsync = function () {
|
|
518
|
-
return
|
|
341
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
519
342
|
var history;
|
|
520
|
-
return
|
|
343
|
+
return __generator(this, function (_a) {
|
|
521
344
|
switch (_a.label) {
|
|
522
345
|
case 0: return [4, this.getHistoryWithInternalTimeAsync()];
|
|
523
346
|
case 1:
|
|
@@ -542,9 +365,9 @@ var HistoryStore = (function () {
|
|
|
542
365
|
}
|
|
543
366
|
};
|
|
544
367
|
HistoryStore.prototype.getHistoryWithInternalTimeAsync = function () {
|
|
545
|
-
return
|
|
368
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
546
369
|
var elements;
|
|
547
|
-
return
|
|
370
|
+
return __generator(this, function (_a) {
|
|
548
371
|
switch (_a.label) {
|
|
549
372
|
case 0:
|
|
550
373
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -623,31 +446,31 @@ var HistoryStore = (function () {
|
|
|
623
446
|
}());
|
|
624
447
|
|
|
625
448
|
var history = /*#__PURE__*/Object.freeze({
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
449
|
+
__proto__: null,
|
|
450
|
+
STORE_KEY: STORE_KEY,
|
|
451
|
+
MAX_NUMBER_OF_HISTORY_ELEMENTS: MAX_NUMBER_OF_HISTORY_ELEMENTS,
|
|
452
|
+
MIN_THRESHOLD_FOR_DUPLICATE_VALUE: MIN_THRESHOLD_FOR_DUPLICATE_VALUE,
|
|
453
|
+
MAX_VALUE_SIZE: MAX_VALUE_SIZE,
|
|
454
|
+
HistoryStore: HistoryStore,
|
|
455
|
+
'default': HistoryStore
|
|
633
456
|
});
|
|
634
457
|
|
|
635
|
-
var enhanceViewEvent = function (eventType, payload) { return
|
|
636
|
-
return
|
|
458
|
+
var enhanceViewEvent = function (eventType, payload) { return __awaiter(void 0, void 0, void 0, function () {
|
|
459
|
+
return __generator(this, function (_a) {
|
|
637
460
|
switch (_a.label) {
|
|
638
461
|
case 0:
|
|
639
462
|
if (!(eventType === EventType.view)) return [3, 2];
|
|
640
463
|
return [4, addPageViewToHistory(payload.contentIdValue)];
|
|
641
464
|
case 1:
|
|
642
465
|
_a.sent();
|
|
643
|
-
return [2,
|
|
466
|
+
return [2, __assign({ location: window.location.toString(), referrer: document.referrer, title: document.title }, payload)];
|
|
644
467
|
case 2: return [2, payload];
|
|
645
468
|
}
|
|
646
469
|
});
|
|
647
470
|
}); };
|
|
648
|
-
var addPageViewToHistory = function (pageViewValue) { return
|
|
471
|
+
var addPageViewToHistory = function (pageViewValue) { return __awaiter(void 0, void 0, void 0, function () {
|
|
649
472
|
var store, historyElement;
|
|
650
|
-
return
|
|
473
|
+
return __generator(this, function (_a) {
|
|
651
474
|
switch (_a.label) {
|
|
652
475
|
case 0:
|
|
653
476
|
store = new HistoryStore();
|
|
@@ -694,7 +517,7 @@ var ticketKeysMapping = {
|
|
|
694
517
|
custom: 'svc_ticket_custom',
|
|
695
518
|
};
|
|
696
519
|
var ticketKeysMappingValues = keysOf(ticketKeysMapping).map(function (key) { return ticketKeysMapping[key]; });
|
|
697
|
-
var ticketSubKeysMatchGroup =
|
|
520
|
+
var ticketSubKeysMatchGroup = __spreadArrays(ticketKeysMappingValues).join('|');
|
|
698
521
|
var ticketKeyRegex = new RegExp("^(" + ticketSubKeysMatchGroup + "$)");
|
|
699
522
|
var serviceActionsKeysMapping = {
|
|
700
523
|
svcAction: 'svc_action',
|
|
@@ -706,7 +529,7 @@ var convertTicketToMeasurementProtocol = function (ticket) {
|
|
|
706
529
|
.reduce(function (mappedTicket, key) {
|
|
707
530
|
var _a;
|
|
708
531
|
var newKey = ticketKeysMapping[key] || key;
|
|
709
|
-
return
|
|
532
|
+
return __assign(__assign({}, mappedTicket), (_a = {}, _a[newKey] = ticket[key], _a));
|
|
710
533
|
}, {});
|
|
711
534
|
};
|
|
712
535
|
var isTicketKey = function (key) { return ticketKeyRegex.test(key); };
|
|
@@ -780,22 +603,22 @@ var commerceActionKeysMappingPerAction = {
|
|
|
780
603
|
detail: productActionsKeysMapping,
|
|
781
604
|
impression: productActionsKeysMapping,
|
|
782
605
|
remove: productActionsKeysMapping,
|
|
783
|
-
refund:
|
|
784
|
-
purchase:
|
|
606
|
+
refund: __assign(__assign({}, productActionsKeysMapping), transactionActionsKeysMapping),
|
|
607
|
+
purchase: __assign(__assign({}, productActionsKeysMapping), transactionActionsKeysMapping),
|
|
785
608
|
quickview: productActionsKeysMapping,
|
|
786
|
-
quote:
|
|
787
|
-
review:
|
|
609
|
+
quote: __assign(__assign({}, productActionsKeysMapping), quoteActionsKeysMapping),
|
|
610
|
+
review: __assign(__assign({}, productActionsKeysMapping), reviewActionsKeysMapping),
|
|
788
611
|
};
|
|
789
612
|
var convertProductToMeasurementProtocol = function (product, index) {
|
|
790
613
|
return keysOf(product).reduce(function (mappedProduct, key) {
|
|
791
614
|
var _a;
|
|
792
615
|
var newKey = "pr" + (index + 1) + (productKeysMapping[key] || key);
|
|
793
|
-
return
|
|
616
|
+
return __assign(__assign({}, mappedProduct), (_a = {}, _a[newKey] = product[key], _a));
|
|
794
617
|
}, {});
|
|
795
618
|
};
|
|
796
619
|
var convertImpressionListToMeasurementProtocol = function (impressionList, listIndex, prefix) {
|
|
797
620
|
var payload = impressionList.impressions.reduce(function (mappedImpressions, impression, productIndex) {
|
|
798
|
-
return
|
|
621
|
+
return __assign(__assign({}, mappedImpressions), convertImpressionToMeasurementProtocol(impression, listIndex, productIndex, prefix));
|
|
799
622
|
}, {});
|
|
800
623
|
if (impressionList.listName) {
|
|
801
624
|
var listNameKey = "il" + (listIndex + 1) + "nm";
|
|
@@ -807,7 +630,7 @@ var convertImpressionToMeasurementProtocol = function (impression, listIndex, pr
|
|
|
807
630
|
return keysOf(impression).reduce(function (mappedImpression, key) {
|
|
808
631
|
var _a;
|
|
809
632
|
var newKey = "il" + (listIndex + 1) + prefix + (productIndex + 1) + (impressionKeysMapping[key] || key);
|
|
810
|
-
return
|
|
633
|
+
return __assign(__assign({}, mappedImpression), (_a = {}, _a[newKey] = impression[key], _a));
|
|
811
634
|
}, {});
|
|
812
635
|
};
|
|
813
636
|
var productKeysMappingValues = keysOf(productKeysMapping).map(function (key) { return productKeysMapping[key]; });
|
|
@@ -816,8 +639,8 @@ var productActionsKeysMappingValues = keysOf(productActionsKeysMapping).map(func
|
|
|
816
639
|
var transactionActionsKeysMappingValues = keysOf(transactionActionsKeysMapping).map(function (key) { return transactionActionsKeysMapping[key]; });
|
|
817
640
|
var reviewKeysMappingValues = keysOf(reviewActionsKeysMapping).map(function (key) { return reviewActionsKeysMapping[key]; });
|
|
818
641
|
var quoteKeysMappingValues = keysOf(quoteActionsKeysMapping).map(function (key) { return quoteActionsKeysMapping[key]; });
|
|
819
|
-
var productSubKeysMatchGroup =
|
|
820
|
-
var impressionSubKeysMatchGroup =
|
|
642
|
+
var productSubKeysMatchGroup = __spreadArrays(productKeysMappingValues, ['custom']).join('|');
|
|
643
|
+
var impressionSubKeysMatchGroup = __spreadArrays(impressionKeysMappingValues, ['custom']).join('|');
|
|
821
644
|
var productPrefixMatchGroup = '(pr[0-9]+)';
|
|
822
645
|
var impressionPrefixMatchGroup = '(il[0-9]+pi[0-9]+)';
|
|
823
646
|
var productKeyRegex = new RegExp("^" + productPrefixMatchGroup + "(" + productSubKeysMatchGroup + ")$");
|
|
@@ -826,7 +649,7 @@ var productActionsKeyRegex = new RegExp("^(" + productActionsKeysMappingValues.j
|
|
|
826
649
|
var transactionActionsKeyRegex = new RegExp("^(" + transactionActionsKeysMappingValues.join('|') + ")$");
|
|
827
650
|
var customProductKeyRegex = new RegExp("^" + productPrefixMatchGroup + "custom$");
|
|
828
651
|
var customImpressionKeyRegex = new RegExp("^" + impressionPrefixMatchGroup + "custom$");
|
|
829
|
-
var coveoCommerceExtensionKeysRegex = new RegExp("^(" +
|
|
652
|
+
var coveoCommerceExtensionKeysRegex = new RegExp("^(" + __spreadArrays(coveoCommerceExtensionKeys, reviewKeysMappingValues, quoteKeysMappingValues).join('|') + ")$");
|
|
830
653
|
var isProductKey = function (key) { return productKeyRegex.test(key); };
|
|
831
654
|
var isImpressionKey = function (key) { return impressionKeyRegex.test(key); };
|
|
832
655
|
var isProductActionsKey = function (key) { return productActionsKeyRegex.test(key); };
|
|
@@ -879,41 +702,41 @@ var coveoExtensionsKeys = [
|
|
|
879
702
|
'permanentId',
|
|
880
703
|
'contentLocale',
|
|
881
704
|
];
|
|
882
|
-
var baseMeasurementProtocolKeysMapping =
|
|
705
|
+
var baseMeasurementProtocolKeysMapping = __assign(__assign(__assign(__assign({}, globalParamKeysMapping), eventKeysMapping), contextInformationMapping), coveoExtensionsKeys.reduce(function (all, key) {
|
|
883
706
|
var _a;
|
|
884
|
-
return (
|
|
707
|
+
return (__assign(__assign({}, all), (_a = {}, _a[key] = key, _a)));
|
|
885
708
|
}, {}));
|
|
886
709
|
|
|
887
|
-
var measurementProtocolKeysMapping =
|
|
710
|
+
var measurementProtocolKeysMapping = __assign(__assign({}, baseMeasurementProtocolKeysMapping), serviceActionsKeysMapping);
|
|
888
711
|
var convertKeysToMeasurementProtocol = function (params) {
|
|
889
712
|
var keysMappingForAction = (!!params.action && commerceActionKeysMappingPerAction[params.action]) || {};
|
|
890
713
|
return keysOf(params).reduce(function (mappedKeys, key) {
|
|
891
714
|
var _a;
|
|
892
715
|
var newKey = keysMappingForAction[key] || measurementProtocolKeysMapping[key] || key;
|
|
893
|
-
return
|
|
716
|
+
return __assign(__assign({}, mappedKeys), (_a = {}, _a[newKey] = params[key], _a));
|
|
894
717
|
}, {});
|
|
895
718
|
};
|
|
896
719
|
var measurementProtocolKeysMappingValues = keysOf(measurementProtocolKeysMapping).map(function (key) { return measurementProtocolKeysMapping[key]; });
|
|
897
720
|
var isKnownMeasurementProtocolKey = function (key) { return measurementProtocolKeysMappingValues.indexOf(key) !== -1; };
|
|
898
721
|
var isCustomKey = function (key) { return key === 'custom'; };
|
|
899
722
|
var isMeasurementProtocolKey = function (key) {
|
|
900
|
-
return
|
|
723
|
+
return __spreadArrays(isCommerceKey, isServiceKey, [isKnownMeasurementProtocolKey, isCustomKey]).some(function (test) { return test(key); });
|
|
901
724
|
};
|
|
902
725
|
var convertCustomMeasurementProtocolKeys = function (data) {
|
|
903
726
|
return keysOf(data).reduce(function (all, current) {
|
|
904
727
|
var _a;
|
|
905
728
|
var match = getFirstCustomMeasurementProtocolKeyMatch(current);
|
|
906
729
|
if (match) {
|
|
907
|
-
return
|
|
730
|
+
return __assign(__assign({}, all), convertCustomObject(match, data[current]));
|
|
908
731
|
}
|
|
909
732
|
else {
|
|
910
|
-
return
|
|
733
|
+
return __assign(__assign({}, all), (_a = {}, _a[current] = data[current], _a));
|
|
911
734
|
}
|
|
912
735
|
}, {});
|
|
913
736
|
};
|
|
914
737
|
var getFirstCustomMeasurementProtocolKeyMatch = function (key) {
|
|
915
738
|
var matchedKey = undefined;
|
|
916
|
-
|
|
739
|
+
__spreadArrays(isCustomCommerceKey).every(function (regex) {
|
|
917
740
|
var _a;
|
|
918
741
|
matchedKey = (_a = regex.exec(key)) === null || _a === void 0 ? void 0 : _a[1];
|
|
919
742
|
return !Boolean(matchedKey);
|
|
@@ -923,7 +746,7 @@ var getFirstCustomMeasurementProtocolKeyMatch = function (key) {
|
|
|
923
746
|
var convertCustomObject = function (prefix, customData) {
|
|
924
747
|
return keysOf(customData).reduce(function (allCustom, currentCustomKey) {
|
|
925
748
|
var _a;
|
|
926
|
-
return (
|
|
749
|
+
return (__assign(__assign({}, allCustom), (_a = {}, _a["" + prefix + currentCustomKey] = customData[currentCustomKey], _a)));
|
|
927
750
|
}, {});
|
|
928
751
|
};
|
|
929
752
|
|
|
@@ -932,9 +755,9 @@ var AnalyticsBeaconClient = (function () {
|
|
|
932
755
|
this.opts = opts;
|
|
933
756
|
}
|
|
934
757
|
AnalyticsBeaconClient.prototype.sendEvent = function (eventType, payload) {
|
|
935
|
-
return
|
|
758
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
936
759
|
var _a, baseUrl, preprocessRequest, parsedRequestData, paramsFragments, defaultOptions, _b, url, body, _c, _d;
|
|
937
|
-
return
|
|
760
|
+
return __generator(this, function (_e) {
|
|
938
761
|
switch (_e.label) {
|
|
939
762
|
case 0:
|
|
940
763
|
if (!navigator.sendBeacon) {
|
|
@@ -951,7 +774,7 @@ var AnalyticsBeaconClient = (function () {
|
|
|
951
774
|
type: 'application/x-www-form-urlencoded',
|
|
952
775
|
}),
|
|
953
776
|
};
|
|
954
|
-
_c = [
|
|
777
|
+
_c = [__assign({}, defaultOptions)];
|
|
955
778
|
if (!preprocessRequest) return [3, 3];
|
|
956
779
|
return [4, preprocessRequest(defaultOptions, 'analyticsBeacon')];
|
|
957
780
|
case 2:
|
|
@@ -961,7 +784,7 @@ var AnalyticsBeaconClient = (function () {
|
|
|
961
784
|
_d = {};
|
|
962
785
|
_e.label = 4;
|
|
963
786
|
case 4:
|
|
964
|
-
_b =
|
|
787
|
+
_b = __assign.apply(void 0, _c.concat([(_d)])), url = _b.url, body = _b.body;
|
|
965
788
|
console.log("Sending beacon for \"" + eventType + "\" with: ", JSON.stringify(payload));
|
|
966
789
|
navigator.sendBeacon(url, body);
|
|
967
790
|
return [2];
|
|
@@ -972,12 +795,12 @@ var AnalyticsBeaconClient = (function () {
|
|
|
972
795
|
AnalyticsBeaconClient.prototype.encodeForEventType = function (eventType, payload) {
|
|
973
796
|
return this.isEventTypeLegacy(eventType)
|
|
974
797
|
? this.encodeForLegacyType(eventType, payload)
|
|
975
|
-
: this.encodeForFormUrlEncoded(
|
|
798
|
+
: this.encodeForFormUrlEncoded(__assign({ access_token: this.opts.token }, payload));
|
|
976
799
|
};
|
|
977
800
|
AnalyticsBeaconClient.prototype.getQueryParamsForEventType = function (eventType) {
|
|
978
|
-
return
|
|
801
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
979
802
|
var _a, token, visitorIdProvider, visitorId;
|
|
980
|
-
return
|
|
803
|
+
return __generator(this, function (_b) {
|
|
981
804
|
switch (_b.label) {
|
|
982
805
|
case 0:
|
|
983
806
|
_a = this.opts, token = _a.token, visitorIdProvider = _a.visitorIdProvider;
|
|
@@ -1020,8 +843,8 @@ var NoopAnalyticsClient = (function () {
|
|
|
1020
843
|
function NoopAnalyticsClient() {
|
|
1021
844
|
}
|
|
1022
845
|
NoopAnalyticsClient.prototype.sendEvent = function (_, __) {
|
|
1023
|
-
return
|
|
1024
|
-
return
|
|
846
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
847
|
+
return __generator(this, function (_a) {
|
|
1025
848
|
return [2, Promise.resolve()];
|
|
1026
849
|
});
|
|
1027
850
|
});
|
|
@@ -1029,6 +852,8 @@ var NoopAnalyticsClient = (function () {
|
|
|
1029
852
|
return NoopAnalyticsClient;
|
|
1030
853
|
}());
|
|
1031
854
|
|
|
855
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
856
|
+
|
|
1032
857
|
var nodePonyfill = {exports: {}};
|
|
1033
858
|
|
|
1034
859
|
var lib$1 = {exports: {}};
|
|
@@ -78905,7 +78730,7 @@ var require$$1 = [
|
|
|
78905
78730
|
]
|
|
78906
78731
|
];
|
|
78907
78732
|
|
|
78908
|
-
var punycode = require$$0__default[
|
|
78733
|
+
var punycode = require$$0__default["default"];
|
|
78909
78734
|
var mappingTable = require$$1;
|
|
78910
78735
|
|
|
78911
78736
|
var PROCESSING_OPTIONS = {
|
|
@@ -79097,7 +78922,7 @@ tr46.toUnicode = function(domain_name, useSTD3) {
|
|
|
79097
78922
|
tr46.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
|
|
79098
78923
|
|
|
79099
78924
|
(function (module) {
|
|
79100
|
-
const punycode = require$$0__default[
|
|
78925
|
+
const punycode = require$$0__default["default"];
|
|
79101
78926
|
const tr46$1 = tr46;
|
|
79102
78927
|
|
|
79103
78928
|
const specialSchemes = {
|
|
@@ -80807,12 +80632,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
80807
80632
|
|
|
80808
80633
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
80809
80634
|
|
|
80810
|
-
var Stream = _interopDefault(require$$0__default$1[
|
|
80811
|
-
var http = _interopDefault(require$$1__default[
|
|
80812
|
-
var Url = _interopDefault(require$$2__default[
|
|
80635
|
+
var Stream = _interopDefault(require$$0__default$1["default"]);
|
|
80636
|
+
var http = _interopDefault(require$$1__default["default"]);
|
|
80637
|
+
var Url = _interopDefault(require$$2__default["default"]);
|
|
80813
80638
|
var whatwgUrl = _interopDefault(publicApi);
|
|
80814
|
-
var https = _interopDefault(require$$4__default[
|
|
80815
|
-
var zlib = _interopDefault(require$$5__default[
|
|
80639
|
+
var https = _interopDefault(require$$4__default["default"]);
|
|
80640
|
+
var zlib = _interopDefault(require$$5__default["default"]);
|
|
80816
80641
|
|
|
80817
80642
|
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
|
80818
80643
|
|
|
@@ -80963,7 +80788,7 @@ FetchError.prototype.name = 'FetchError';
|
|
|
80963
80788
|
|
|
80964
80789
|
let convert;
|
|
80965
80790
|
try {
|
|
80966
|
-
convert = require$$6__default[
|
|
80791
|
+
convert = require$$6__default["default"].convert;
|
|
80967
80792
|
} catch (e) {}
|
|
80968
80793
|
|
|
80969
80794
|
const INTERNALS = Symbol('Body internals');
|
|
@@ -82530,9 +82355,9 @@ var AnalyticsFetchClient = (function () {
|
|
|
82530
82355
|
this.opts = opts;
|
|
82531
82356
|
}
|
|
82532
82357
|
AnalyticsFetchClient.prototype.sendEvent = function (eventType, payload) {
|
|
82533
|
-
return
|
|
82358
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82534
82359
|
var _a, baseUrl, visitorIdProvider, preprocessRequest, visitorIdParam, _b, defaultOptions, _c, url, fetchData, _d, _e, response, visit;
|
|
82535
|
-
return
|
|
82360
|
+
return __generator(this, function (_f) {
|
|
82536
82361
|
switch (_f.label) {
|
|
82537
82362
|
case 0:
|
|
82538
82363
|
_a = this.opts, baseUrl = _a.baseUrl, visitorIdProvider = _a.visitorIdProvider, preprocessRequest = _a.preprocessRequest;
|
|
@@ -82554,7 +82379,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82554
82379
|
method: 'POST',
|
|
82555
82380
|
body: JSON.stringify(payload),
|
|
82556
82381
|
};
|
|
82557
|
-
_d = [
|
|
82382
|
+
_d = [__assign({}, defaultOptions)];
|
|
82558
82383
|
if (!preprocessRequest) return [3, 5];
|
|
82559
82384
|
return [4, preprocessRequest(defaultOptions, 'analyticsFetch')];
|
|
82560
82385
|
case 4:
|
|
@@ -82564,7 +82389,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82564
82389
|
_e = {};
|
|
82565
82390
|
_f.label = 6;
|
|
82566
82391
|
case 6:
|
|
82567
|
-
_c =
|
|
82392
|
+
_c = __assign.apply(void 0, _d.concat([(_e)])), url = _c.url, fetchData = __rest(_c, ["url"]);
|
|
82568
82393
|
return [4, nodePonyfill.exports.fetch(url, fetchData)];
|
|
82569
82394
|
case 7:
|
|
82570
82395
|
response = _f.sent();
|
|
@@ -82592,9 +82417,9 @@ var AnalyticsFetchClient = (function () {
|
|
|
82592
82417
|
return [EventType.click, EventType.custom, EventType.search, EventType.view].indexOf(eventType) !== -1;
|
|
82593
82418
|
};
|
|
82594
82419
|
AnalyticsFetchClient.prototype.getVisitorIdParam = function () {
|
|
82595
|
-
return
|
|
82420
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82596
82421
|
var visitorIdProvider, visitorId;
|
|
82597
|
-
return
|
|
82422
|
+
return __generator(this, function (_a) {
|
|
82598
82423
|
switch (_a.label) {
|
|
82599
82424
|
case 0:
|
|
82600
82425
|
visitorIdProvider = this.opts.visitorIdProvider;
|
|
@@ -82608,7 +82433,7 @@ var AnalyticsFetchClient = (function () {
|
|
|
82608
82433
|
};
|
|
82609
82434
|
AnalyticsFetchClient.prototype.getHeaders = function () {
|
|
82610
82435
|
var token = this.opts.token;
|
|
82611
|
-
return
|
|
82436
|
+
return __assign(__assign({}, (token ? { Authorization: "Bearer " + token } : {})), { 'Content-Type': "application/json" });
|
|
82612
82437
|
};
|
|
82613
82438
|
return AnalyticsFetchClient;
|
|
82614
82439
|
}());
|
|
@@ -82673,9 +82498,9 @@ function doNotTrack() {
|
|
|
82673
82498
|
}
|
|
82674
82499
|
|
|
82675
82500
|
var donottrack = /*#__PURE__*/Object.freeze({
|
|
82676
|
-
|
|
82677
|
-
|
|
82678
|
-
|
|
82501
|
+
__proto__: null,
|
|
82502
|
+
doNotTrack: doNotTrack,
|
|
82503
|
+
'default': doNotTrack
|
|
82679
82504
|
});
|
|
82680
82505
|
|
|
82681
82506
|
var Version = 'v15';
|
|
@@ -82689,7 +82514,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82689
82514
|
if (!opts) {
|
|
82690
82515
|
throw new Error('You have to pass options to this constructor');
|
|
82691
82516
|
}
|
|
82692
|
-
this.options =
|
|
82517
|
+
this.options = __assign(__assign({}, this.defaultOptions), opts);
|
|
82693
82518
|
this.visitorId = '';
|
|
82694
82519
|
this.bufferedRequests = [];
|
|
82695
82520
|
this.beforeSendHooks = [enhanceViewEvent, addDefaultValues].concat(this.options.beforeSendHooks);
|
|
@@ -82717,14 +82542,14 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82717
82542
|
afterSendHooks: [],
|
|
82718
82543
|
};
|
|
82719
82544
|
},
|
|
82720
|
-
enumerable:
|
|
82545
|
+
enumerable: false,
|
|
82721
82546
|
configurable: true
|
|
82722
82547
|
});
|
|
82723
82548
|
CoveoAnalyticsClient.prototype.initRuntime = function (clientsOptions) {
|
|
82724
82549
|
var _this = this;
|
|
82725
82550
|
if (hasWindow() && hasDocument()) {
|
|
82726
82551
|
return new BrowserRuntime(clientsOptions, function () {
|
|
82727
|
-
var copy =
|
|
82552
|
+
var copy = __spreadArrays(_this.bufferedRequests);
|
|
82728
82553
|
_this.bufferedRequests = [];
|
|
82729
82554
|
return copy;
|
|
82730
82555
|
});
|
|
@@ -82738,13 +82563,13 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82738
82563
|
get: function () {
|
|
82739
82564
|
return this.runtime.storage;
|
|
82740
82565
|
},
|
|
82741
|
-
enumerable:
|
|
82566
|
+
enumerable: false,
|
|
82742
82567
|
configurable: true
|
|
82743
82568
|
});
|
|
82744
82569
|
CoveoAnalyticsClient.prototype.determineVisitorId = function () {
|
|
82745
|
-
return
|
|
82570
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82746
82571
|
var err_1;
|
|
82747
|
-
return
|
|
82572
|
+
return __generator(this, function (_a) {
|
|
82748
82573
|
switch (_a.label) {
|
|
82749
82574
|
case 0:
|
|
82750
82575
|
_a.trys.push([0, 2, , 3]);
|
|
@@ -82760,9 +82585,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82760
82585
|
});
|
|
82761
82586
|
};
|
|
82762
82587
|
CoveoAnalyticsClient.prototype.getCurrentVisitorId = function () {
|
|
82763
|
-
return
|
|
82588
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82764
82589
|
var id;
|
|
82765
|
-
return
|
|
82590
|
+
return __generator(this, function (_a) {
|
|
82766
82591
|
switch (_a.label) {
|
|
82767
82592
|
case 0:
|
|
82768
82593
|
if (!!this.visitorId) return [3, 3];
|
|
@@ -82779,8 +82604,8 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82779
82604
|
});
|
|
82780
82605
|
};
|
|
82781
82606
|
CoveoAnalyticsClient.prototype.setCurrentVisitorId = function (visitorId) {
|
|
82782
|
-
return
|
|
82783
|
-
return
|
|
82607
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82608
|
+
return __generator(this, function (_a) {
|
|
82784
82609
|
switch (_a.label) {
|
|
82785
82610
|
case 0:
|
|
82786
82611
|
this.visitorId = visitorId;
|
|
@@ -82797,10 +82622,10 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82797
82622
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
82798
82623
|
payload[_i - 1] = arguments[_i];
|
|
82799
82624
|
}
|
|
82800
|
-
return
|
|
82801
|
-
return
|
|
82625
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82626
|
+
return __generator(this, function (_a) {
|
|
82802
82627
|
switch (_a.label) {
|
|
82803
|
-
case 0: return [4, this.resolveParameters.apply(this,
|
|
82628
|
+
case 0: return [4, this.resolveParameters.apply(this, __spreadArrays([eventType], payload))];
|
|
82804
82629
|
case 1: return [2, _a.sent()];
|
|
82805
82630
|
}
|
|
82806
82631
|
});
|
|
@@ -82811,11 +82636,11 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82811
82636
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
82812
82637
|
payload[_i - 1] = arguments[_i];
|
|
82813
82638
|
}
|
|
82814
|
-
return
|
|
82639
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82815
82640
|
var parametersToSend;
|
|
82816
|
-
return
|
|
82641
|
+
return __generator(this, function (_a) {
|
|
82817
82642
|
switch (_a.label) {
|
|
82818
|
-
case 0: return [4, this.resolveParameters.apply(this,
|
|
82643
|
+
case 0: return [4, this.resolveParameters.apply(this, __spreadArrays([eventType], payload))];
|
|
82819
82644
|
case 1:
|
|
82820
82645
|
parametersToSend = _a.sent();
|
|
82821
82646
|
return [4, this.resolvePayloadForParameters(eventType, parametersToSend)];
|
|
@@ -82836,7 +82661,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82836
82661
|
this.visitorId = visitorId;
|
|
82837
82662
|
this.storage.setItem('visitorId', visitorId);
|
|
82838
82663
|
},
|
|
82839
|
-
enumerable:
|
|
82664
|
+
enumerable: false,
|
|
82840
82665
|
configurable: true
|
|
82841
82666
|
});
|
|
82842
82667
|
CoveoAnalyticsClient.prototype.resolveParameters = function (eventType) {
|
|
@@ -82844,10 +82669,10 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82844
82669
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
82845
82670
|
payload[_i - 1] = arguments[_i];
|
|
82846
82671
|
}
|
|
82847
|
-
return
|
|
82672
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82848
82673
|
var _a, _b, variableLengthArgumentsNames, _c, addVisitorIdParameter, _d, usesMeasurementProtocol, processVariableArgumentNamesStep, addVisitorIdStep, setAnonymousUserStep, processBeforeSendHooksStep, parametersToSend;
|
|
82849
82674
|
var _this = this;
|
|
82850
|
-
return
|
|
82675
|
+
return __generator(this, function (_e) {
|
|
82851
82676
|
switch (_e.label) {
|
|
82852
82677
|
case 0:
|
|
82853
82678
|
_a = this.eventTypeMapping[eventType] || {}, _b = _a.variableLengthArgumentsNames, variableLengthArgumentsNames = _b === void 0 ? [] : _b, _c = _a.addVisitorIdParameter, addVisitorIdParameter = _c === void 0 ? false : _c, _d = _a.usesMeasurementProtocol, usesMeasurementProtocol = _d === void 0 ? false : _d;
|
|
@@ -82856,12 +82681,12 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82856
82681
|
? _this.parseVariableArgumentsPayload(variableLengthArgumentsNames, currentPayload)
|
|
82857
82682
|
: currentPayload[0];
|
|
82858
82683
|
};
|
|
82859
|
-
addVisitorIdStep = function (currentPayload) { return
|
|
82684
|
+
addVisitorIdStep = function (currentPayload) { return __awaiter(_this, void 0, void 0, function () {
|
|
82860
82685
|
var _a, _b, _c;
|
|
82861
|
-
return
|
|
82686
|
+
return __generator(this, function (_d) {
|
|
82862
82687
|
switch (_d.label) {
|
|
82863
82688
|
case 0:
|
|
82864
|
-
_a = [
|
|
82689
|
+
_a = [__assign({}, currentPayload)];
|
|
82865
82690
|
_b = {};
|
|
82866
82691
|
if (!addVisitorIdParameter) return [3, 2];
|
|
82867
82692
|
return [4, this.getCurrentVisitorId()];
|
|
@@ -82871,7 +82696,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82871
82696
|
case 2:
|
|
82872
82697
|
_c = '';
|
|
82873
82698
|
_d.label = 3;
|
|
82874
|
-
case 3: return [2, (
|
|
82699
|
+
case 3: return [2, (__assign.apply(void 0, _a.concat([(_b.visitorId = _c, _b)])))];
|
|
82875
82700
|
}
|
|
82876
82701
|
});
|
|
82877
82702
|
}); };
|
|
@@ -82879,9 +82704,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82879
82704
|
return usesMeasurementProtocol ? _this.ensureAnonymousUserWhenUsingApiKey(currentPayload) : currentPayload;
|
|
82880
82705
|
};
|
|
82881
82706
|
processBeforeSendHooksStep = function (currentPayload) {
|
|
82882
|
-
return _this.beforeSendHooks.reduce(function (promisePayload, current) { return
|
|
82707
|
+
return _this.beforeSendHooks.reduce(function (promisePayload, current) { return __awaiter(_this, void 0, void 0, function () {
|
|
82883
82708
|
var payload;
|
|
82884
|
-
return
|
|
82709
|
+
return __generator(this, function (_a) {
|
|
82885
82710
|
switch (_a.label) {
|
|
82886
82711
|
case 0: return [4, promisePayload];
|
|
82887
82712
|
case 1:
|
|
@@ -82897,9 +82722,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82897
82722
|
addVisitorIdStep,
|
|
82898
82723
|
setAnonymousUserStep,
|
|
82899
82724
|
processBeforeSendHooksStep,
|
|
82900
|
-
].reduce(function (payloadPromise, step) { return
|
|
82725
|
+
].reduce(function (payloadPromise, step) { return __awaiter(_this, void 0, void 0, function () {
|
|
82901
82726
|
var payload;
|
|
82902
|
-
return
|
|
82727
|
+
return __generator(this, function (_a) {
|
|
82903
82728
|
switch (_a.label) {
|
|
82904
82729
|
case 0: return [4, payloadPromise];
|
|
82905
82730
|
case 1:
|
|
@@ -82917,10 +82742,10 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82917
82742
|
});
|
|
82918
82743
|
};
|
|
82919
82744
|
CoveoAnalyticsClient.prototype.resolvePayloadForParameters = function (eventType, parameters) {
|
|
82920
|
-
return
|
|
82745
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82921
82746
|
var _a, usesMeasurementProtocol, cleanPayloadStep, validateParams, processMeasurementProtocolConversionStep, removeUnknownParameters, processCustomParameters, payloadToSend;
|
|
82922
82747
|
var _this = this;
|
|
82923
|
-
return
|
|
82748
|
+
return __generator(this, function (_b) {
|
|
82924
82749
|
switch (_b.label) {
|
|
82925
82750
|
case 0:
|
|
82926
82751
|
_a = (this.eventTypeMapping[eventType] || {}).usesMeasurementProtocol, usesMeasurementProtocol = _a === void 0 ? false : _a;
|
|
@@ -82943,9 +82768,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82943
82768
|
processMeasurementProtocolConversionStep,
|
|
82944
82769
|
removeUnknownParameters,
|
|
82945
82770
|
processCustomParameters,
|
|
82946
|
-
].reduce(function (payloadPromise, step) { return
|
|
82771
|
+
].reduce(function (payloadPromise, step) { return __awaiter(_this, void 0, void 0, function () {
|
|
82947
82772
|
var payload;
|
|
82948
|
-
return
|
|
82773
|
+
return __generator(this, function (_a) {
|
|
82949
82774
|
switch (_a.label) {
|
|
82950
82775
|
case 0: return [4, payloadPromise];
|
|
82951
82776
|
case 1:
|
|
@@ -82967,13 +82792,13 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82967
82792
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
82968
82793
|
payload[_i - 1] = arguments[_i];
|
|
82969
82794
|
}
|
|
82970
|
-
return
|
|
82795
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82971
82796
|
var _a, eventTypeToSend, parametersToSend, payloadToSend;
|
|
82972
|
-
return
|
|
82797
|
+
return __generator(this, function (_b) {
|
|
82973
82798
|
switch (_b.label) {
|
|
82974
82799
|
case 0:
|
|
82975
82800
|
_a = (this.eventTypeMapping[eventType] || {}).newEventType, eventTypeToSend = _a === void 0 ? eventType : _a;
|
|
82976
|
-
return [4, this.resolveParameters.apply(this,
|
|
82801
|
+
return [4, this.resolveParameters.apply(this, __spreadArrays([eventType], payload))];
|
|
82977
82802
|
case 1:
|
|
82978
82803
|
parametersToSend = _b.sent();
|
|
82979
82804
|
return [4, this.resolvePayloadForParameters(eventType, parametersToSend)];
|
|
@@ -82999,9 +82824,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
82999
82824
|
return new Promise(function (resolve) { return setTimeout(resolve, 0); });
|
|
83000
82825
|
};
|
|
83001
82826
|
CoveoAnalyticsClient.prototype.sendFromBufferWithFetch = function () {
|
|
83002
|
-
return
|
|
82827
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83003
82828
|
var popped, eventType, payload;
|
|
83004
|
-
return
|
|
82829
|
+
return __generator(this, function (_a) {
|
|
83005
82830
|
popped = this.bufferedRequests.shift();
|
|
83006
82831
|
if (popped) {
|
|
83007
82832
|
eventType = popped.eventType, payload = popped.payload;
|
|
@@ -83017,37 +82842,37 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83017
82842
|
store.clear();
|
|
83018
82843
|
};
|
|
83019
82844
|
CoveoAnalyticsClient.prototype.sendSearchEvent = function (request) {
|
|
83020
|
-
return
|
|
83021
|
-
return
|
|
82845
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82846
|
+
return __generator(this, function (_a) {
|
|
83022
82847
|
return [2, this.sendEvent(EventType.search, request)];
|
|
83023
82848
|
});
|
|
83024
82849
|
});
|
|
83025
82850
|
};
|
|
83026
82851
|
CoveoAnalyticsClient.prototype.sendClickEvent = function (request) {
|
|
83027
|
-
return
|
|
83028
|
-
return
|
|
82852
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82853
|
+
return __generator(this, function (_a) {
|
|
83029
82854
|
return [2, this.sendEvent(EventType.click, request)];
|
|
83030
82855
|
});
|
|
83031
82856
|
});
|
|
83032
82857
|
};
|
|
83033
82858
|
CoveoAnalyticsClient.prototype.sendCustomEvent = function (request) {
|
|
83034
|
-
return
|
|
83035
|
-
return
|
|
82859
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82860
|
+
return __generator(this, function (_a) {
|
|
83036
82861
|
return [2, this.sendEvent(EventType.custom, request)];
|
|
83037
82862
|
});
|
|
83038
82863
|
});
|
|
83039
82864
|
};
|
|
83040
82865
|
CoveoAnalyticsClient.prototype.sendViewEvent = function (request) {
|
|
83041
|
-
return
|
|
83042
|
-
return
|
|
82866
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82867
|
+
return __generator(this, function (_a) {
|
|
83043
82868
|
return [2, this.sendEvent(EventType.view, request)];
|
|
83044
82869
|
});
|
|
83045
82870
|
});
|
|
83046
82871
|
};
|
|
83047
82872
|
CoveoAnalyticsClient.prototype.getVisit = function () {
|
|
83048
|
-
return
|
|
82873
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83049
82874
|
var response, visit;
|
|
83050
|
-
return
|
|
82875
|
+
return __generator(this, function (_a) {
|
|
83051
82876
|
switch (_a.label) {
|
|
83052
82877
|
case 0: return [4, fetch(this.baseUrl + "/analytics/visit")];
|
|
83053
82878
|
case 1:
|
|
@@ -83062,9 +82887,9 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83062
82887
|
});
|
|
83063
82888
|
};
|
|
83064
82889
|
CoveoAnalyticsClient.prototype.getHealth = function () {
|
|
83065
|
-
return
|
|
82890
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83066
82891
|
var response;
|
|
83067
|
-
return
|
|
82892
|
+
return __generator(this, function (_a) {
|
|
83068
82893
|
switch (_a.label) {
|
|
83069
82894
|
case 0: return [4, fetch(this.baseUrl + "/analytics/monitoring/health")];
|
|
83070
82895
|
case 1:
|
|
@@ -83092,7 +82917,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83092
82917
|
parsedArguments[fieldsOrder[i]] = currentArgument;
|
|
83093
82918
|
}
|
|
83094
82919
|
else if (typeof currentArgument === 'object') {
|
|
83095
|
-
return
|
|
82920
|
+
return __assign(__assign({}, parsedArguments), currentArgument);
|
|
83096
82921
|
}
|
|
83097
82922
|
}
|
|
83098
82923
|
return parsedArguments;
|
|
@@ -83112,7 +82937,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83112
82937
|
.filter(function (key) { return _this.isKeyAllowedEmpty(eventType, key) || isNotEmptyValue(payload[key]); })
|
|
83113
82938
|
.reduce(function (newPayload, key) {
|
|
83114
82939
|
var _a;
|
|
83115
|
-
return (
|
|
82940
|
+
return (__assign(__assign({}, newPayload), (_a = {}, _a[key] = payload[key], _a)));
|
|
83116
82941
|
}, {});
|
|
83117
82942
|
};
|
|
83118
82943
|
CoveoAnalyticsClient.prototype.removeUnknownParameters = function (payload) {
|
|
@@ -83127,25 +82952,25 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83127
82952
|
})
|
|
83128
82953
|
.reduce(function (newPayload, key) {
|
|
83129
82954
|
var _a;
|
|
83130
|
-
return (
|
|
82955
|
+
return (__assign(__assign({}, newPayload), (_a = {}, _a[key] = payload[key], _a)));
|
|
83131
82956
|
}, {});
|
|
83132
82957
|
return newPayload;
|
|
83133
82958
|
};
|
|
83134
82959
|
CoveoAnalyticsClient.prototype.processCustomParameters = function (payload) {
|
|
83135
|
-
var custom = payload.custom, rest =
|
|
82960
|
+
var custom = payload.custom, rest = __rest(payload, ["custom"]);
|
|
83136
82961
|
var lowercasedCustom = this.lowercaseKeys(custom);
|
|
83137
82962
|
var newPayload = convertCustomMeasurementProtocolKeys(rest);
|
|
83138
|
-
return
|
|
82963
|
+
return __assign(__assign({}, lowercasedCustom), newPayload);
|
|
83139
82964
|
};
|
|
83140
82965
|
CoveoAnalyticsClient.prototype.lowercaseKeys = function (custom) {
|
|
83141
82966
|
var keys = Object.keys(custom || {});
|
|
83142
82967
|
return keys.reduce(function (all, key) {
|
|
83143
82968
|
var _a;
|
|
83144
|
-
return (
|
|
82969
|
+
return (__assign(__assign({}, all), (_a = {}, _a[key.toLowerCase()] = custom[key], _a)));
|
|
83145
82970
|
}, {});
|
|
83146
82971
|
};
|
|
83147
82972
|
CoveoAnalyticsClient.prototype.validateParams = function (payload) {
|
|
83148
|
-
var anonymizeIp = payload.anonymizeIp, rest =
|
|
82973
|
+
var anonymizeIp = payload.anonymizeIp, rest = __rest(payload, ["anonymizeIp"]);
|
|
83149
82974
|
if (anonymizeIp !== undefined) {
|
|
83150
82975
|
if (['0', 'false', 'undefined', 'null', '{}', '[]', ''].indexOf(("" + anonymizeIp).toLowerCase()) == -1) {
|
|
83151
82976
|
rest['anonymizeIp'] = 1;
|
|
@@ -83154,7 +82979,7 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83154
82979
|
return rest;
|
|
83155
82980
|
};
|
|
83156
82981
|
CoveoAnalyticsClient.prototype.ensureAnonymousUserWhenUsingApiKey = function (payload) {
|
|
83157
|
-
var userId = payload.userId, rest =
|
|
82982
|
+
var userId = payload.userId, rest = __rest(payload, ["userId"]);
|
|
83158
82983
|
if (isApiKey(this.options.token) && !userId) {
|
|
83159
82984
|
rest['userId'] = 'anonymous';
|
|
83160
82985
|
return rest;
|
|
@@ -83169,18 +82994,18 @@ var CoveoAnalyticsClient = (function () {
|
|
|
83169
82994
|
var endpointIsCoveoProxy = endpoint.indexOf('.cloud.coveo.com') !== -1;
|
|
83170
82995
|
return "" + endpoint + (endpointIsCoveoProxy ? '' : '/rest') + "/" + version;
|
|
83171
82996
|
},
|
|
83172
|
-
enumerable:
|
|
82997
|
+
enumerable: false,
|
|
83173
82998
|
configurable: true
|
|
83174
82999
|
});
|
|
83175
83000
|
return CoveoAnalyticsClient;
|
|
83176
83001
|
}());
|
|
83177
83002
|
|
|
83178
83003
|
var analytics = /*#__PURE__*/Object.freeze({
|
|
83179
|
-
|
|
83180
|
-
|
|
83181
|
-
|
|
83182
|
-
|
|
83183
|
-
|
|
83004
|
+
__proto__: null,
|
|
83005
|
+
Version: Version,
|
|
83006
|
+
Endpoints: Endpoints,
|
|
83007
|
+
CoveoAnalyticsClient: CoveoAnalyticsClient,
|
|
83008
|
+
'default': CoveoAnalyticsClient
|
|
83184
83009
|
});
|
|
83185
83010
|
|
|
83186
83011
|
var getFormattedLocation = function (location) {
|
|
@@ -83213,7 +83038,7 @@ var BasePlugin = (function () {
|
|
|
83213
83038
|
this.actionData = {};
|
|
83214
83039
|
};
|
|
83215
83040
|
BasePlugin.prototype.getLocationInformation = function (eventType, payload) {
|
|
83216
|
-
return
|
|
83041
|
+
return __assign({ hitType: eventType }, this.getNextValues(eventType, payload));
|
|
83217
83042
|
};
|
|
83218
83043
|
BasePlugin.prototype.updateLocationInformation = function (eventType, payload) {
|
|
83219
83044
|
this.updateLocationForNextPageView(eventType, payload);
|
|
@@ -83235,7 +83060,7 @@ var BasePlugin = (function () {
|
|
|
83235
83060
|
time: Date.now().toString(),
|
|
83236
83061
|
eventId: this.uuidGenerator(),
|
|
83237
83062
|
};
|
|
83238
|
-
return
|
|
83063
|
+
return __assign(__assign(__assign(__assign({}, eventContext), screenContext), navigatorContext), documentContext);
|
|
83239
83064
|
};
|
|
83240
83065
|
BasePlugin.prototype.updateLocationForNextPageView = function (eventType, payload) {
|
|
83241
83066
|
var _a = this.getNextValues(eventType, payload), pageViewId = _a.pageViewId, referrer = _a.referrer, location = _a.location;
|
|
@@ -83271,10 +83096,10 @@ var BasePlugin = (function () {
|
|
|
83271
83096
|
return BasePlugin;
|
|
83272
83097
|
}());
|
|
83273
83098
|
|
|
83274
|
-
var ECPluginEventTypes =
|
|
83099
|
+
var ECPluginEventTypes = __assign({}, BasePluginEventTypes);
|
|
83275
83100
|
var allECEventTypes = Object.keys(ECPluginEventTypes).map(function (key) { return ECPluginEventTypes[key]; });
|
|
83276
83101
|
var ECPlugin = (function (_super) {
|
|
83277
|
-
|
|
83102
|
+
__extends(ECPlugin, _super);
|
|
83278
83103
|
function ECPlugin(_a) {
|
|
83279
83104
|
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ? uuidv4 : _b;
|
|
83280
83105
|
var _this = _super.call(this, { client: client, uuidGenerator: uuidGenerator }) || this;
|
|
@@ -83336,18 +83161,18 @@ var ECPlugin = (function (_super) {
|
|
|
83336
83161
|
});
|
|
83337
83162
|
};
|
|
83338
83163
|
ECPlugin.prototype.addECDataToPayload = function (eventType, payload) {
|
|
83339
|
-
var ecPayload =
|
|
83164
|
+
var ecPayload = __assign(__assign(__assign(__assign({}, this.getLocationInformation(eventType, payload)), this.getDefaultContextInformation(eventType)), (this.action ? { action: this.action } : {})), (this.actionData || {}));
|
|
83340
83165
|
var productPayload = this.getProductPayload();
|
|
83341
83166
|
var impressionPayload = this.getImpressionPayload();
|
|
83342
83167
|
this.clearData();
|
|
83343
|
-
return
|
|
83168
|
+
return __assign(__assign(__assign(__assign({}, impressionPayload), productPayload), ecPayload), payload);
|
|
83344
83169
|
};
|
|
83345
83170
|
ECPlugin.prototype.getProductPayload = function () {
|
|
83346
83171
|
var _this = this;
|
|
83347
83172
|
return this.products
|
|
83348
83173
|
.map(function (product) { return _this.assureProductValidity(product); })
|
|
83349
83174
|
.reduce(function (newPayload, product, index) {
|
|
83350
|
-
return
|
|
83175
|
+
return __assign(__assign({}, newPayload), convertProductToMeasurementProtocol(product, index));
|
|
83351
83176
|
}, {});
|
|
83352
83177
|
};
|
|
83353
83178
|
ECPlugin.prototype.getImpressionPayload = function () {
|
|
@@ -83355,17 +83180,17 @@ var ECPlugin = (function (_super) {
|
|
|
83355
83180
|
var impressionsByList = this.getImpressionsByList();
|
|
83356
83181
|
return impressionsByList
|
|
83357
83182
|
.map(function (_a) {
|
|
83358
|
-
var impressions = _a.impressions, rest =
|
|
83359
|
-
return (
|
|
83183
|
+
var impressions = _a.impressions, rest = __rest(_a, ["impressions"]);
|
|
83184
|
+
return (__assign(__assign({}, rest), { impressions: impressions.map(function (baseImpression) {
|
|
83360
83185
|
return _this.assureBaseImpressionValidity(baseImpression);
|
|
83361
83186
|
}) }));
|
|
83362
83187
|
})
|
|
83363
83188
|
.reduce(function (newPayload, impressionList, index) {
|
|
83364
|
-
return
|
|
83189
|
+
return __assign(__assign({}, newPayload), convertImpressionListToMeasurementProtocol(impressionList, index, 'pi'));
|
|
83365
83190
|
}, {});
|
|
83366
83191
|
};
|
|
83367
83192
|
ECPlugin.prototype.assureProductValidity = function (product) {
|
|
83368
|
-
var position = product.position, productRest =
|
|
83193
|
+
var position = product.position, productRest = __rest(product, ["position"]);
|
|
83369
83194
|
if (position !== undefined && position < 1) {
|
|
83370
83195
|
console.warn("The position for product '" + (product.name || product.id) + "' must be greater " + "than 0 when provided.");
|
|
83371
83196
|
return productRest;
|
|
@@ -83373,7 +83198,7 @@ var ECPlugin = (function (_super) {
|
|
|
83373
83198
|
return product;
|
|
83374
83199
|
};
|
|
83375
83200
|
ECPlugin.prototype.assureBaseImpressionValidity = function (baseImpression) {
|
|
83376
|
-
var position = baseImpression.position, baseImpressionRest =
|
|
83201
|
+
var position = baseImpression.position, baseImpressionRest = __rest(baseImpression, ["position"]);
|
|
83377
83202
|
if (position !== undefined && position < 1) {
|
|
83378
83203
|
console.warn("The position for impression '" + (baseImpression.name || baseImpression.id) + "'" +
|
|
83379
83204
|
" must be greater than 0 when provided.");
|
|
@@ -83383,7 +83208,7 @@ var ECPlugin = (function (_super) {
|
|
|
83383
83208
|
};
|
|
83384
83209
|
ECPlugin.prototype.getImpressionsByList = function () {
|
|
83385
83210
|
return this.impressions.reduce(function (lists, impression) {
|
|
83386
|
-
var listName = impression.list, baseImpression =
|
|
83211
|
+
var listName = impression.list, baseImpression = __rest(impression, ["list"]);
|
|
83387
83212
|
var list = lists.find(function (list) { return list.listName === listName; });
|
|
83388
83213
|
if (list) {
|
|
83389
83214
|
list.impressions.push(baseImpression);
|
|
@@ -83399,10 +83224,10 @@ var ECPlugin = (function (_super) {
|
|
|
83399
83224
|
}(BasePlugin));
|
|
83400
83225
|
var EC = ECPlugin;
|
|
83401
83226
|
|
|
83402
|
-
var SVCPluginEventTypes =
|
|
83227
|
+
var SVCPluginEventTypes = __assign({}, BasePluginEventTypes);
|
|
83403
83228
|
var allSVCEventTypes = Object.keys(SVCPluginEventTypes).map(function (key) { return SVCPluginEventTypes[key]; });
|
|
83404
83229
|
var SVCPlugin = (function (_super) {
|
|
83405
|
-
|
|
83230
|
+
__extends(SVCPlugin, _super);
|
|
83406
83231
|
function SVCPlugin(_a) {
|
|
83407
83232
|
var client = _a.client, _b = _a.uuidGenerator, uuidGenerator = _b === void 0 ? uuidv4 : _b;
|
|
83408
83233
|
var _this = _super.call(this, { client: client, uuidGenerator: uuidGenerator }) || this;
|
|
@@ -83460,10 +83285,10 @@ var SVCPlugin = (function (_super) {
|
|
|
83460
83285
|
};
|
|
83461
83286
|
SVCPlugin.prototype.addSVCDataToPayload = function (eventType, payload) {
|
|
83462
83287
|
var _a;
|
|
83463
|
-
var svcPayload =
|
|
83288
|
+
var svcPayload = __assign(__assign(__assign(__assign({}, this.getLocationInformation(eventType, payload)), this.getDefaultContextInformation(eventType)), (this.action ? { svcAction: this.action } : {})), (Object.keys((_a = this.actionData) !== null && _a !== void 0 ? _a : {}).length > 0 ? { svcActionData: this.actionData } : {}));
|
|
83464
83289
|
var ticketPayload = this.getTicketPayload();
|
|
83465
83290
|
this.clearData();
|
|
83466
|
-
return
|
|
83291
|
+
return __assign(__assign(__assign({}, ticketPayload), svcPayload), payload);
|
|
83467
83292
|
};
|
|
83468
83293
|
SVCPlugin.prototype.getTicketPayload = function () {
|
|
83469
83294
|
return convertTicketToMeasurementProtocol(this.ticket);
|
|
@@ -83542,7 +83367,7 @@ var CoveoUA = (function () {
|
|
|
83542
83367
|
this.getPluginKeys(optionsOrEndpoint).forEach(function (pluginKey) {
|
|
83543
83368
|
return _this.plugins.require(pluginKey, pluginOptions_1);
|
|
83544
83369
|
});
|
|
83545
|
-
this.client.registerBeforeSendEventHook(function (eventType, payload) { return (
|
|
83370
|
+
this.client.registerBeforeSendEventHook(function (eventType, payload) { return (__assign(__assign({}, payload), _this.params)); });
|
|
83546
83371
|
}
|
|
83547
83372
|
else {
|
|
83548
83373
|
throw new Error("You must pass either your token or a valid object when you call 'init'");
|
|
@@ -83601,7 +83426,7 @@ var CoveoUA = (function () {
|
|
|
83601
83426
|
if (!event) {
|
|
83602
83427
|
throw new Error("You must provide an event type when calling \"send\".");
|
|
83603
83428
|
}
|
|
83604
|
-
return (_a = this.client).sendEvent.apply(_a,
|
|
83429
|
+
return (_a = this.client).sendEvent.apply(_a, __spreadArrays([event.toLowerCase()], payload));
|
|
83605
83430
|
};
|
|
83606
83431
|
CoveoUA.prototype.onLoad = function (callback) {
|
|
83607
83432
|
if (typeof callback == 'undefined') {
|
|
@@ -83616,7 +83441,7 @@ var CoveoUA = (function () {
|
|
|
83616
83441
|
if (!this.client) {
|
|
83617
83442
|
throw new Error("You must call init before requiring a plugin");
|
|
83618
83443
|
}
|
|
83619
|
-
this.plugins.require(name,
|
|
83444
|
+
this.plugins.require(name, __assign(__assign({}, options), { client: this.client }));
|
|
83620
83445
|
};
|
|
83621
83446
|
CoveoUA.prototype.callPlugin = function (pluginName, fn) {
|
|
83622
83447
|
var _a;
|
|
@@ -83624,7 +83449,7 @@ var CoveoUA = (function () {
|
|
|
83624
83449
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
83625
83450
|
args[_i - 2] = arguments[_i];
|
|
83626
83451
|
}
|
|
83627
|
-
(_a = this.plugins).execute.apply(_a,
|
|
83452
|
+
(_a = this.plugins).execute.apply(_a, __spreadArrays([pluginName, fn], args));
|
|
83628
83453
|
};
|
|
83629
83454
|
CoveoUA.prototype.reset = function () {
|
|
83630
83455
|
this.client = undefined;
|
|
@@ -83643,7 +83468,7 @@ var handleOneAnalyticsEvent = function (command) {
|
|
|
83643
83468
|
var _a = /^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/.exec(command); _a[1]; var pluginName = _a[2], fn = _a[3];
|
|
83644
83469
|
var actionFunction = coveoua[fn];
|
|
83645
83470
|
if (pluginName && fn) {
|
|
83646
|
-
return coveoua.callPlugin.apply(coveoua,
|
|
83471
|
+
return coveoua.callPlugin.apply(coveoua, __spreadArrays([pluginName, fn], params));
|
|
83647
83472
|
}
|
|
83648
83473
|
else if (actionFunction) {
|
|
83649
83474
|
return actionFunction.apply(coveoua, params);
|
|
@@ -83664,12 +83489,12 @@ var handleOneAnalyticsEvent = function (command) {
|
|
|
83664
83489
|
};
|
|
83665
83490
|
|
|
83666
83491
|
var simpleanalytics = /*#__PURE__*/Object.freeze({
|
|
83667
|
-
|
|
83668
|
-
|
|
83669
|
-
|
|
83670
|
-
|
|
83671
|
-
|
|
83672
|
-
|
|
83492
|
+
__proto__: null,
|
|
83493
|
+
CoveoUA: CoveoUA,
|
|
83494
|
+
coveoua: coveoua,
|
|
83495
|
+
getCurrentClient: getCurrentClient,
|
|
83496
|
+
handleOneAnalyticsEvent: handleOneAnalyticsEvent,
|
|
83497
|
+
'default': handleOneAnalyticsEvent
|
|
83673
83498
|
});
|
|
83674
83499
|
|
|
83675
83500
|
var _a;
|
|
@@ -83837,7 +83662,7 @@ function formatOmniboxMetadata(meta) {
|
|
|
83837
83662
|
? meta.partialQueries
|
|
83838
83663
|
: formatArrayForCoveoCustomData(meta.partialQueries);
|
|
83839
83664
|
var suggestions = typeof meta.suggestions === 'string' ? meta.suggestions : formatArrayForCoveoCustomData(meta.suggestions);
|
|
83840
|
-
return
|
|
83665
|
+
return __assign(__assign({}, meta), { partialQueries: partialQueries,
|
|
83841
83666
|
suggestions: suggestions });
|
|
83842
83667
|
}
|
|
83843
83668
|
|
|
@@ -83934,7 +83759,7 @@ var CoveoSearchPageClient = (function () {
|
|
|
83934
83759
|
return this.logCustomEvent(SearchPageEvents.triggerQuery, meta);
|
|
83935
83760
|
};
|
|
83936
83761
|
CoveoSearchPageClient.prototype.logTriggerRedirect = function (meta) {
|
|
83937
|
-
var allMeta =
|
|
83762
|
+
var allMeta = __assign(__assign({}, meta), { query: this.provider.getSearchEventRequestPayload().queryText });
|
|
83938
83763
|
return this.logCustomEvent(SearchPageEvents.triggerRedirect, allMeta);
|
|
83939
83764
|
};
|
|
83940
83765
|
CoveoSearchPageClient.prototype.logPagerResize = function (meta) {
|
|
@@ -83986,8 +83811,8 @@ var CoveoSearchPageClient = (function () {
|
|
|
83986
83811
|
return this.logCustomEvent(SearchPageEvents.queryError, meta);
|
|
83987
83812
|
};
|
|
83988
83813
|
CoveoSearchPageClient.prototype.logQueryErrorBack = function () {
|
|
83989
|
-
return
|
|
83990
|
-
return
|
|
83814
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83815
|
+
return __generator(this, function (_a) {
|
|
83991
83816
|
switch (_a.label) {
|
|
83992
83817
|
case 0: return [4, this.logCustomEvent(SearchPageEvents.queryErrorBack)];
|
|
83993
83818
|
case 1:
|
|
@@ -83998,8 +83823,8 @@ var CoveoSearchPageClient = (function () {
|
|
|
83998
83823
|
});
|
|
83999
83824
|
};
|
|
84000
83825
|
CoveoSearchPageClient.prototype.logQueryErrorRetry = function () {
|
|
84001
|
-
return
|
|
84002
|
-
return
|
|
83826
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83827
|
+
return __generator(this, function (_a) {
|
|
84003
83828
|
switch (_a.label) {
|
|
84004
83829
|
case 0: return [4, this.logCustomEvent(SearchPageEvents.queryErrorRetry)];
|
|
84005
83830
|
case 1:
|
|
@@ -84010,8 +83835,8 @@ var CoveoSearchPageClient = (function () {
|
|
|
84010
83835
|
});
|
|
84011
83836
|
};
|
|
84012
83837
|
CoveoSearchPageClient.prototype.logQueryErrorClear = function () {
|
|
84013
|
-
return
|
|
84014
|
-
return
|
|
83838
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83839
|
+
return __generator(this, function (_a) {
|
|
84015
83840
|
switch (_a.label) {
|
|
84016
83841
|
case 0: return [4, this.logCustomEvent(SearchPageEvents.queryErrorClear)];
|
|
84017
83842
|
case 1:
|
|
@@ -84067,32 +83892,32 @@ var CoveoSearchPageClient = (function () {
|
|
|
84067
83892
|
return this.logSearchEvent(SearchPageEvents.noResultsBack);
|
|
84068
83893
|
};
|
|
84069
83894
|
CoveoSearchPageClient.prototype.logCustomEvent = function (event, metadata) {
|
|
84070
|
-
return
|
|
83895
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84071
83896
|
var customData, payload, _a;
|
|
84072
|
-
return
|
|
83897
|
+
return __generator(this, function (_b) {
|
|
84073
83898
|
switch (_b.label) {
|
|
84074
83899
|
case 0:
|
|
84075
|
-
customData =
|
|
83900
|
+
customData = __assign(__assign({}, this.provider.getBaseMetadata()), metadata);
|
|
84076
83901
|
_a = [{}];
|
|
84077
83902
|
return [4, this.getBaseCustomEventRequest(customData)];
|
|
84078
83903
|
case 1:
|
|
84079
|
-
payload =
|
|
83904
|
+
payload = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { eventType: CustomEventsTypes[event], eventValue: event }]);
|
|
84080
83905
|
return [2, this.coveoAnalyticsClient.sendCustomEvent(payload)];
|
|
84081
83906
|
}
|
|
84082
83907
|
});
|
|
84083
83908
|
});
|
|
84084
83909
|
};
|
|
84085
83910
|
CoveoSearchPageClient.prototype.logCustomEventWithType = function (eventValue, eventType, metadata) {
|
|
84086
|
-
return
|
|
83911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84087
83912
|
var customData, payload, _a;
|
|
84088
|
-
return
|
|
83913
|
+
return __generator(this, function (_b) {
|
|
84089
83914
|
switch (_b.label) {
|
|
84090
83915
|
case 0:
|
|
84091
|
-
customData =
|
|
83916
|
+
customData = __assign(__assign({}, this.provider.getBaseMetadata()), metadata);
|
|
84092
83917
|
_a = [{}];
|
|
84093
83918
|
return [4, this.getBaseCustomEventRequest(customData)];
|
|
84094
83919
|
case 1:
|
|
84095
|
-
payload =
|
|
83920
|
+
payload = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { eventType: eventType,
|
|
84096
83921
|
eventValue: eventValue }]);
|
|
84097
83922
|
return [2, this.coveoAnalyticsClient.sendCustomEvent(payload)];
|
|
84098
83923
|
}
|
|
@@ -84100,9 +83925,9 @@ var CoveoSearchPageClient = (function () {
|
|
|
84100
83925
|
});
|
|
84101
83926
|
};
|
|
84102
83927
|
CoveoSearchPageClient.prototype.logSearchEvent = function (event, metadata) {
|
|
84103
|
-
return
|
|
83928
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84104
83929
|
var _a, _b;
|
|
84105
|
-
return
|
|
83930
|
+
return __generator(this, function (_c) {
|
|
84106
83931
|
switch (_c.label) {
|
|
84107
83932
|
case 0:
|
|
84108
83933
|
_b = (_a = this.coveoAnalyticsClient).sendSearchEvent;
|
|
@@ -84113,57 +83938,57 @@ var CoveoSearchPageClient = (function () {
|
|
|
84113
83938
|
});
|
|
84114
83939
|
};
|
|
84115
83940
|
CoveoSearchPageClient.prototype.logClickEvent = function (event, info, identifier, metadata) {
|
|
84116
|
-
return
|
|
83941
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84117
83942
|
var payload, _a;
|
|
84118
|
-
return
|
|
83943
|
+
return __generator(this, function (_b) {
|
|
84119
83944
|
switch (_b.label) {
|
|
84120
83945
|
case 0:
|
|
84121
|
-
_a = [
|
|
84122
|
-
return [4, this.getBaseEventRequest(
|
|
83946
|
+
_a = [__assign({}, info)];
|
|
83947
|
+
return [4, this.getBaseEventRequest(__assign(__assign({}, identifier), metadata))];
|
|
84123
83948
|
case 1:
|
|
84124
|
-
payload =
|
|
83949
|
+
payload = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { searchQueryUid: this.provider.getSearchUID(), queryPipeline: this.provider.getPipeline(), actionCause: event }]);
|
|
84125
83950
|
return [2, this.coveoAnalyticsClient.sendClickEvent(payload)];
|
|
84126
83951
|
}
|
|
84127
83952
|
});
|
|
84128
83953
|
});
|
|
84129
83954
|
};
|
|
84130
83955
|
CoveoSearchPageClient.prototype.getBaseSearchEventRequest = function (event, metadata) {
|
|
84131
|
-
return
|
|
83956
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84132
83957
|
var _a;
|
|
84133
|
-
return
|
|
83958
|
+
return __generator(this, function (_b) {
|
|
84134
83959
|
switch (_b.label) {
|
|
84135
83960
|
case 0:
|
|
84136
83961
|
_a = [{}];
|
|
84137
83962
|
return [4, this.getBaseEventRequest(metadata)];
|
|
84138
|
-
case 1: return [2,
|
|
83963
|
+
case 1: return [2, __assign.apply(void 0, [__assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), this.provider.getSearchEventRequestPayload()]), { searchQueryUid: this.provider.getSearchUID(), queryPipeline: this.provider.getPipeline(), actionCause: event }])];
|
|
84139
83964
|
}
|
|
84140
83965
|
});
|
|
84141
83966
|
});
|
|
84142
83967
|
};
|
|
84143
83968
|
CoveoSearchPageClient.prototype.getBaseCustomEventRequest = function (metadata) {
|
|
84144
|
-
return
|
|
83969
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84145
83970
|
var _a;
|
|
84146
|
-
return
|
|
83971
|
+
return __generator(this, function (_b) {
|
|
84147
83972
|
switch (_b.label) {
|
|
84148
83973
|
case 0:
|
|
84149
83974
|
_a = [{}];
|
|
84150
83975
|
return [4, this.getBaseEventRequest(metadata)];
|
|
84151
|
-
case 1: return [2,
|
|
83976
|
+
case 1: return [2, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), { lastSearchQueryUid: this.provider.getSearchUID() }])];
|
|
84152
83977
|
}
|
|
84153
83978
|
});
|
|
84154
83979
|
});
|
|
84155
83980
|
};
|
|
84156
83981
|
CoveoSearchPageClient.prototype.getBaseEventRequest = function (metadata) {
|
|
84157
|
-
return
|
|
83982
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84158
83983
|
var customData, _a, _b;
|
|
84159
|
-
return
|
|
83984
|
+
return __generator(this, function (_c) {
|
|
84160
83985
|
switch (_c.label) {
|
|
84161
83986
|
case 0:
|
|
84162
|
-
customData =
|
|
84163
|
-
_a = [
|
|
83987
|
+
customData = __assign(__assign({}, this.provider.getBaseMetadata()), metadata);
|
|
83988
|
+
_a = [__assign({}, this.getOrigins())];
|
|
84164
83989
|
_b = { customData: customData, language: this.provider.getLanguage(), facetState: this.provider.getFacetState ? this.provider.getFacetState() : [], anonymous: this.provider.getIsAnonymous() };
|
|
84165
83990
|
return [4, this.getClientId()];
|
|
84166
|
-
case 1: return [2,
|
|
83991
|
+
case 1: return [2, __assign.apply(void 0, _a.concat([(_b.clientId = _c.sent(), _b)]))];
|
|
84167
83992
|
}
|
|
84168
83993
|
});
|
|
84169
83994
|
});
|
|
@@ -84209,9 +84034,10 @@ var CaseCancelledReasons;
|
|
|
84209
84034
|
})(CaseCancelledReasons || (CaseCancelledReasons = {}));
|
|
84210
84035
|
|
|
84211
84036
|
var CaseAssistClient = (function () {
|
|
84212
|
-
function CaseAssistClient(options) {
|
|
84037
|
+
function CaseAssistClient(options, provider) {
|
|
84213
84038
|
var _a;
|
|
84214
84039
|
this.options = options;
|
|
84040
|
+
this.provider = provider;
|
|
84215
84041
|
var analyticsEnabled = (_a = options.enableAnalytics) !== null && _a !== void 0 ? _a : true;
|
|
84216
84042
|
this.coveoAnalyticsClient = analyticsEnabled ? new CoveoAnalyticsClient(options) : new NoopAnalytics();
|
|
84217
84043
|
this.svc = new SVCPlugin({ client: this.coveoAnalyticsClient });
|
|
@@ -84250,12 +84076,14 @@ var CaseAssistClient = (function () {
|
|
|
84250
84076
|
return this.sendClickEvent();
|
|
84251
84077
|
};
|
|
84252
84078
|
CaseAssistClient.prototype.logRateDocumentSuggestion = function (meta) {
|
|
84253
|
-
this.svc.setAction(CaseAssistActions.suggestionRate,
|
|
84079
|
+
this.svc.setAction(CaseAssistActions.suggestionRate, __assign({ rate: meta.rating }, meta.suggestion));
|
|
84254
84080
|
this.svc.setTicket(meta.ticket);
|
|
84255
84081
|
return this.sendClickEvent();
|
|
84256
84082
|
};
|
|
84257
84083
|
CaseAssistClient.prototype.logMoveToNextCaseStep = function (meta) {
|
|
84258
|
-
this.svc.setAction(CaseAssistActions.nextCaseStep
|
|
84084
|
+
this.svc.setAction(CaseAssistActions.nextCaseStep, {
|
|
84085
|
+
stage: meta === null || meta === void 0 ? void 0 : meta.stage,
|
|
84086
|
+
});
|
|
84259
84087
|
this.svc.setTicket(meta.ticket);
|
|
84260
84088
|
return this.sendClickEvent();
|
|
84261
84089
|
};
|
|
@@ -84279,10 +84107,18 @@ var CaseAssistClient = (function () {
|
|
|
84279
84107
|
return this.sendClickEvent();
|
|
84280
84108
|
};
|
|
84281
84109
|
CaseAssistClient.prototype.sendFlowStartEvent = function () {
|
|
84282
|
-
return this.coveoAnalyticsClient.sendEvent('event', 'svc', CaseAssistEvents.flowStart
|
|
84110
|
+
return this.coveoAnalyticsClient.sendEvent('event', 'svc', CaseAssistEvents.flowStart, this.provider
|
|
84111
|
+
? {
|
|
84112
|
+
searchHub: this.provider.getOriginLevel1(),
|
|
84113
|
+
}
|
|
84114
|
+
: null);
|
|
84283
84115
|
};
|
|
84284
84116
|
CaseAssistClient.prototype.sendClickEvent = function () {
|
|
84285
|
-
return this.coveoAnalyticsClient.sendEvent('event', 'svc', CaseAssistEvents.click
|
|
84117
|
+
return this.coveoAnalyticsClient.sendEvent('event', 'svc', CaseAssistEvents.click, this.provider
|
|
84118
|
+
? {
|
|
84119
|
+
searchHub: this.provider.getOriginLevel1(),
|
|
84120
|
+
}
|
|
84121
|
+
: null);
|
|
84286
84122
|
};
|
|
84287
84123
|
return CaseAssistClient;
|
|
84288
84124
|
}());
|