@ada-support/embed2 1.0.59 → 1.0.63
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/npm-entry/businessEvents/businessEvent.d.ts +3 -3
- package/dist/npm-entry/businessEvents/types.d.ts +2 -11
- package/dist/npm-entry/campaigns/types.d.ts +1 -18
- package/dist/npm-entry/client/store/mutations/index.d.ts +1 -1
- package/dist/npm-entry/{campaigns → common/helpers}/TriggerConditionEvaluator.d.ts +1 -1
- package/dist/npm-entry/common/helpers/isRTL.d.ts +1 -1
- package/dist/npm-entry/common/types/helpers.d.ts +18 -0
- package/dist/npm-entry/common/types/http.d.ts +0 -1
- package/dist/npm-entry/index.js +763 -132
- package/dist/npm-entry/services/logger/index.d.ts +3 -0
- package/package.json +5 -2
- package/dist/npm-entry/businessEvents/TriggerConditionEvaluator.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TrackEventParams } from "common/types";
|
|
2
|
-
import { StartOptions } from "common/types/store-state";
|
|
3
|
-
import { BusinessEvent } from "./types";
|
|
1
|
+
import type { TrackEventParams } from "common/types";
|
|
2
|
+
import type { StartOptions } from "common/types/store-state";
|
|
3
|
+
import type { BusinessEvent } from "./types";
|
|
4
4
|
export declare function trackEventImpl(adaSettings: StartOptions, chatterToken: string, params: TrackEventParams): void;
|
|
5
5
|
export declare const getEventsToTrigger: (businessEvents: BusinessEvent[]) => BusinessEvent[];
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
type: "url-match";
|
|
3
|
-
conditions_any: [
|
|
4
|
-
{
|
|
5
|
-
type: "ends-with" | "contains" | "equals" | "regex";
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
];
|
|
9
|
-
}
|
|
10
|
-
export declare type TriggerCondition = URLMatchTriggerCondition;
|
|
1
|
+
import type { URLMatchTriggerCondition } from "common/types/helpers";
|
|
11
2
|
export interface BusinessEvent {
|
|
12
3
|
event_key: string;
|
|
13
4
|
value: number;
|
|
14
|
-
trigger_conditions:
|
|
5
|
+
trigger_conditions: URLMatchTriggerCondition[];
|
|
15
6
|
}
|
|
16
7
|
export interface BusinessEventsResponse {
|
|
17
8
|
business_events: BusinessEvent[];
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TriggerCondition } from "common/types/helpers";
|
|
2
2
|
export declare type GoalEvent = unknown;
|
|
3
|
-
export interface URLMatchTriggerCondition {
|
|
4
|
-
type: "url-match";
|
|
5
|
-
conditions_any: [
|
|
6
|
-
{
|
|
7
|
-
type: "ends-with" | "contains" | "equals" | "regex";
|
|
8
|
-
value: string;
|
|
9
|
-
}
|
|
10
|
-
];
|
|
11
|
-
}
|
|
12
|
-
export interface DateTimeTriggerCondition {
|
|
13
|
-
type: "datetime";
|
|
14
|
-
timezone: string;
|
|
15
|
-
condition: {
|
|
16
|
-
operator: "before-exclusive" | "after-inclusive";
|
|
17
|
-
datetime: string;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
3
|
export declare type CampaignFrequency = "every-time" | "once-per-session" | "once-per-user";
|
|
21
4
|
export interface MarketingCampaign {
|
|
22
5
|
_id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTimeTriggerCondition, TriggerCondition, URLMatchTriggerCondition } from "
|
|
1
|
+
import type { DateTimeTriggerCondition, TriggerCondition, URLMatchTriggerCondition } from "common/types/helpers";
|
|
2
2
|
export declare const evalUrlMatchTriggerCondition: (triggerCondition: URLMatchTriggerCondition, url: string) => boolean;
|
|
3
3
|
export declare const evalDatetimeTriggerCondition: (triggerCondition: DateTimeTriggerCondition, currentDateTime: Date) => boolean;
|
|
4
4
|
export declare const evalTriggerCondition: (triggerCondition: TriggerCondition) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StoreState } from "common/types/store-state";
|
|
1
|
+
import type { StoreState } from "common/types/store-state";
|
|
2
2
|
export declare const isRTLLanguage: (language: StoreState["language"] | undefined) => boolean;
|
|
3
3
|
export declare const isRTL: (client: StoreState["client"] | undefined, language: StoreState["language"] | undefined) => boolean;
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
export declare type PartialRecord<K extends keyof any, T> = {
|
|
2
2
|
[P in K]?: T;
|
|
3
3
|
};
|
|
4
|
+
export declare type TriggerCondition = URLMatchTriggerCondition | DateTimeTriggerCondition;
|
|
5
|
+
export interface URLMatchTriggerCondition {
|
|
6
|
+
type: "url-match";
|
|
7
|
+
conditions_any: [
|
|
8
|
+
{
|
|
9
|
+
type: "ends-with" | "contains" | "equals" | "regex";
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
export interface DateTimeTriggerCondition {
|
|
15
|
+
type: "datetime";
|
|
16
|
+
timezone: string;
|
|
17
|
+
condition: {
|
|
18
|
+
operator: "before-exclusive" | "after-inclusive";
|
|
19
|
+
datetime: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -570,7 +570,7 @@ var browserPerformanceTimeOrigin = (function () {
|
|
|
570
570
|
|
|
571
571
|
/***/ }),
|
|
572
572
|
|
|
573
|
-
/***/
|
|
573
|
+
/***/ 5265:
|
|
574
574
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
575
575
|
|
|
576
576
|
"use strict";
|
|
@@ -8788,7 +8788,7 @@ var client = new error_tracker_BrowserClient({
|
|
|
8788
8788
|
return event;
|
|
8789
8789
|
},
|
|
8790
8790
|
environment: "production",
|
|
8791
|
-
release: "1.0.
|
|
8791
|
+
release: "1.0.63-1d1b0f6",
|
|
8792
8792
|
sampleRate: 0.25,
|
|
8793
8793
|
autoSessionTracking: false,
|
|
8794
8794
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -9488,7 +9488,7 @@ function getEmbedURL(_ref) {
|
|
|
9488
9488
|
polyfillVersionString = "legacy";
|
|
9489
9489
|
}
|
|
9490
9490
|
|
|
9491
|
-
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "
|
|
9491
|
+
return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "1d1b0f6", "/index.html");
|
|
9492
9492
|
}
|
|
9493
9493
|
/**
|
|
9494
9494
|
* Generate the Chat / API URL
|
|
@@ -10201,7 +10201,38 @@ var ends_with_default = /*#__PURE__*/__webpack_require__.n(ends_with);
|
|
|
10201
10201
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js
|
|
10202
10202
|
var slice = __webpack_require__(3649);
|
|
10203
10203
|
var slice_default = /*#__PURE__*/__webpack_require__.n(slice);
|
|
10204
|
-
|
|
10204
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
|
|
10205
|
+
var trim = __webpack_require__(5843);
|
|
10206
|
+
var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
|
|
10207
|
+
;// CONCATENATED MODULE: ./src/common/helpers/get-intro-for-url.ts
|
|
10208
|
+
|
|
10209
|
+
|
|
10210
|
+
function getProcessedPath(path) {
|
|
10211
|
+
var regex = /^http(s)?:\/\/(www.)?/;
|
|
10212
|
+
return trim_default()(path).call(path).replace(regex, "");
|
|
10213
|
+
}
|
|
10214
|
+
function getPathSearchRegex(path) {
|
|
10215
|
+
var params = path.split("?");
|
|
10216
|
+
|
|
10217
|
+
if (params.length > 1) {
|
|
10218
|
+
var _context;
|
|
10219
|
+
|
|
10220
|
+
var escapedParams = encodeURI(params[1]);
|
|
10221
|
+
return new RegExp(concat_default()(_context = "^".concat(params[0], "\\?")).call(_context, escapedParams, "$"));
|
|
10222
|
+
}
|
|
10223
|
+
|
|
10224
|
+
var newPath = path.replace("*", ".*");
|
|
10225
|
+
return new RegExp("^".concat(newPath, "$"));
|
|
10226
|
+
}
|
|
10227
|
+
function doesUrlMatchPath(url, path) {
|
|
10228
|
+
var processedUrl = getProcessedPath(url);
|
|
10229
|
+
var processedPath = getProcessedPath(path);
|
|
10230
|
+
var pathRegex = getPathSearchRegex(processedPath);
|
|
10231
|
+
var matches = pathRegex.exec(processedUrl);
|
|
10232
|
+
return matches !== null;
|
|
10233
|
+
}
|
|
10234
|
+
;// CONCATENATED MODULE: ./src/common/helpers/TriggerConditionEvaluator.ts
|
|
10235
|
+
|
|
10205
10236
|
|
|
10206
10237
|
|
|
10207
10238
|
|
|
@@ -10233,7 +10264,9 @@ var evalUrlMatchTriggerCondition = function evalUrlMatchTriggerCondition(trigger
|
|
|
10233
10264
|
return includes_default()(url).call(url, condition.value);
|
|
10234
10265
|
|
|
10235
10266
|
case "equals":
|
|
10236
|
-
|
|
10267
|
+
{
|
|
10268
|
+
return doesUrlMatchPath(urlWithoutQueryParams, condition.value);
|
|
10269
|
+
}
|
|
10237
10270
|
|
|
10238
10271
|
case "regex":
|
|
10239
10272
|
{
|
|
@@ -10247,11 +10280,29 @@ var evalUrlMatchTriggerCondition = function evalUrlMatchTriggerCondition(trigger
|
|
|
10247
10280
|
}
|
|
10248
10281
|
});
|
|
10249
10282
|
};
|
|
10283
|
+
var evalDatetimeTriggerCondition = function evalDatetimeTriggerCondition(triggerCondition, currentDateTime) {
|
|
10284
|
+
var conditionDatetime = new Date(triggerCondition.condition.datetime);
|
|
10285
|
+
|
|
10286
|
+
switch (triggerCondition.condition.operator) {
|
|
10287
|
+
case "before-exclusive":
|
|
10288
|
+
return currentDateTime < conditionDatetime;
|
|
10289
|
+
|
|
10290
|
+
case "after-inclusive":
|
|
10291
|
+
return currentDateTime >= conditionDatetime;
|
|
10292
|
+
// If an unknown comparator is found, ignore the trigger condition - do not block campaign
|
|
10293
|
+
|
|
10294
|
+
default:
|
|
10295
|
+
return true;
|
|
10296
|
+
}
|
|
10297
|
+
};
|
|
10250
10298
|
var evalTriggerCondition = function evalTriggerCondition(triggerCondition) {
|
|
10251
10299
|
switch (triggerCondition.type) {
|
|
10252
10300
|
case "url-match":
|
|
10253
10301
|
return evalUrlMatchTriggerCondition(triggerCondition, window.location.href);
|
|
10254
|
-
|
|
10302
|
+
|
|
10303
|
+
case "datetime":
|
|
10304
|
+
return evalDatetimeTriggerCondition(triggerCondition, new Date());
|
|
10305
|
+
// If an unknown trigger type is found, ignore the trigger condition - do not block campaign
|
|
10255
10306
|
|
|
10256
10307
|
default:
|
|
10257
10308
|
return true;
|
|
@@ -10346,113 +10397,6 @@ var get_browser_language_getBrowserLanguage = function getBrowserLanguage() {
|
|
|
10346
10397
|
;// CONCATENATED MODULE: ./src/services/helpers.ts
|
|
10347
10398
|
var NO_OP_FUNCTION = function NO_OP_FUNCTION() {// Do nothing
|
|
10348
10399
|
};
|
|
10349
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime-corejs3/core-js-stable/instance/trim.js
|
|
10350
|
-
var trim = __webpack_require__(5843);
|
|
10351
|
-
var trim_default = /*#__PURE__*/__webpack_require__.n(trim);
|
|
10352
|
-
;// CONCATENATED MODULE: ./src/common/helpers/get-intro-for-url.ts
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
function getProcessedPath(path) {
|
|
10356
|
-
var regex = /^http(s)?:\/\/(www.)?/;
|
|
10357
|
-
return trim_default()(path).call(path).replace(regex, "");
|
|
10358
|
-
}
|
|
10359
|
-
function getPathSearchRegex(path) {
|
|
10360
|
-
var params = path.split("?");
|
|
10361
|
-
|
|
10362
|
-
if (params.length > 1) {
|
|
10363
|
-
var _context;
|
|
10364
|
-
|
|
10365
|
-
var escapedParams = encodeURI(params[1]);
|
|
10366
|
-
return new RegExp(concat_default()(_context = "^".concat(params[0], "\\?")).call(_context, escapedParams, "$"));
|
|
10367
|
-
}
|
|
10368
|
-
|
|
10369
|
-
var newPath = path.replace("*", ".*");
|
|
10370
|
-
return new RegExp("^".concat(newPath, "$"));
|
|
10371
|
-
}
|
|
10372
|
-
function doesUrlMatchPath(url, path) {
|
|
10373
|
-
var processedUrl = getProcessedPath(url);
|
|
10374
|
-
var processedPath = getProcessedPath(path);
|
|
10375
|
-
var pathRegex = getPathSearchRegex(processedPath);
|
|
10376
|
-
var matches = pathRegex.exec(processedUrl);
|
|
10377
|
-
return matches !== null;
|
|
10378
|
-
}
|
|
10379
|
-
;// CONCATENATED MODULE: ./src/campaigns/TriggerConditionEvaluator.ts
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
var TriggerConditionEvaluator_stripTrailingSlash = function stripTrailingSlash(url) {
|
|
10386
|
-
return ends_with_default()(url).call(url, "/") ? slice_default()(url).call(url, 0, -1) : url;
|
|
10387
|
-
};
|
|
10388
|
-
|
|
10389
|
-
var TriggerConditionEvaluator_evalUrlMatchTriggerCondition = function evalUrlMatchTriggerCondition(triggerCondition, url) {
|
|
10390
|
-
/**
|
|
10391
|
-
* Behaviour
|
|
10392
|
-
* regex Regex match (as per javascript string .match) over the whole string including
|
|
10393
|
-
* query params
|
|
10394
|
-
* ends-with Match only the URL without query params. Match including trailing slashes
|
|
10395
|
-
* contains Match substring including query params
|
|
10396
|
-
* equals Matches the exact URL, without query params
|
|
10397
|
-
*/
|
|
10398
|
-
var urlWithoutQueryParams = url.split("?")[0];
|
|
10399
|
-
return triggerCondition.conditions_any.some(function (condition) {
|
|
10400
|
-
switch (condition.type) {
|
|
10401
|
-
case "ends-with":
|
|
10402
|
-
{
|
|
10403
|
-
var _context;
|
|
10404
|
-
|
|
10405
|
-
return ends_with_default()(urlWithoutQueryParams).call(urlWithoutQueryParams, condition.value) || ends_with_default()(_context = TriggerConditionEvaluator_stripTrailingSlash(urlWithoutQueryParams)).call(_context, condition.value);
|
|
10406
|
-
}
|
|
10407
|
-
|
|
10408
|
-
case "contains":
|
|
10409
|
-
return includes_default()(url).call(url, condition.value);
|
|
10410
|
-
|
|
10411
|
-
case "equals":
|
|
10412
|
-
{
|
|
10413
|
-
return doesUrlMatchPath(urlWithoutQueryParams, condition.value);
|
|
10414
|
-
}
|
|
10415
|
-
|
|
10416
|
-
case "regex":
|
|
10417
|
-
{
|
|
10418
|
-
var rx = new RegExp(condition.value);
|
|
10419
|
-
return Boolean(rx.exec(url));
|
|
10420
|
-
}
|
|
10421
|
-
// If an unknown URL match type is found, ignore it - one of the others will have to match
|
|
10422
|
-
|
|
10423
|
-
default:
|
|
10424
|
-
return false;
|
|
10425
|
-
}
|
|
10426
|
-
});
|
|
10427
|
-
};
|
|
10428
|
-
var evalDatetimeTriggerCondition = function evalDatetimeTriggerCondition(triggerCondition, currentDateTime) {
|
|
10429
|
-
var conditionDatetime = new Date(triggerCondition.condition.datetime);
|
|
10430
|
-
|
|
10431
|
-
switch (triggerCondition.condition.operator) {
|
|
10432
|
-
case "before-exclusive":
|
|
10433
|
-
return currentDateTime < conditionDatetime;
|
|
10434
|
-
|
|
10435
|
-
case "after-inclusive":
|
|
10436
|
-
return currentDateTime >= conditionDatetime;
|
|
10437
|
-
// If an unknown comparator is found, ignore the trigger condition - do not block campaign
|
|
10438
|
-
|
|
10439
|
-
default:
|
|
10440
|
-
return true;
|
|
10441
|
-
}
|
|
10442
|
-
};
|
|
10443
|
-
var TriggerConditionEvaluator_evalTriggerCondition = function evalTriggerCondition(triggerCondition) {
|
|
10444
|
-
switch (triggerCondition.type) {
|
|
10445
|
-
case "url-match":
|
|
10446
|
-
return TriggerConditionEvaluator_evalUrlMatchTriggerCondition(triggerCondition, window.location.href);
|
|
10447
|
-
|
|
10448
|
-
case "datetime":
|
|
10449
|
-
return evalDatetimeTriggerCondition(triggerCondition, new Date());
|
|
10450
|
-
// If an unknown trigger type is found, ignore the trigger condition - do not block campaign
|
|
10451
|
-
|
|
10452
|
-
default:
|
|
10453
|
-
return true;
|
|
10454
|
-
}
|
|
10455
|
-
};
|
|
10456
10400
|
;// CONCATENATED MODULE: ./src/campaigns/campaign.ts
|
|
10457
10401
|
|
|
10458
10402
|
|
|
@@ -10627,7 +10571,7 @@ var getCampaignToTrigger = function getCampaignToTrigger(adaSettings, marketingC
|
|
|
10627
10571
|
}
|
|
10628
10572
|
|
|
10629
10573
|
var conditionsMet = campaign.trigger_conditions.every(function (tc) {
|
|
10630
|
-
return
|
|
10574
|
+
return evalTriggerCondition(tc);
|
|
10631
10575
|
});
|
|
10632
10576
|
var doesPassFrequencyCheck = ignoreFrequency || !campaignShownWithinFrequency(campaign, handle);
|
|
10633
10577
|
return conditionsMet && doesPassFrequencyCheck;
|
|
@@ -11030,7 +10974,7 @@ var isRTLLanguage = function isRTLLanguage(language) {
|
|
|
11030
10974
|
};
|
|
11031
10975
|
var isRTL = function isRTL(client, language) {
|
|
11032
10976
|
var rtlLanguageBool = isRTLLanguage(language) || isRTLLanguage(getBrowserLanguage());
|
|
11033
|
-
var featureFlagsBool = (client === null || client === void 0 ? void 0 : client.features.chat_ui_v2) &&
|
|
10977
|
+
var featureFlagsBool = (client === null || client === void 0 ? void 0 : client.features.chat_ui_v2) && client.features.translations;
|
|
11034
10978
|
return featureFlagsBool && rtlLanguageBool || false;
|
|
11035
10979
|
};
|
|
11036
10980
|
;// CONCATENATED MODULE: ./src/common/helpers/getAlignment.ts
|
|
@@ -11687,7 +11631,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
|
|
|
11687
11631
|
this.bindChatEventHandlers();
|
|
11688
11632
|
this.handleScrollLock(); // We use this log to track number of chat impressions (times when users see chat iFrame render first time).
|
|
11689
11633
|
|
|
11690
|
-
(0,services_logger/* log */.
|
|
11634
|
+
(0,services_logger/* log */.cM)("Chat frame mount", {
|
|
11691
11635
|
handle: handle,
|
|
11692
11636
|
embedSettings: adaSettings
|
|
11693
11637
|
}); // Delay to allow inline css animation to work.
|
|
@@ -12900,7 +12844,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
12900
12844
|
// that a user might engage with another campaign on another page path
|
|
12901
12845
|
|
|
12902
12846
|
|
|
12903
|
-
if (
|
|
12847
|
+
if (wasCampaignShownButNowClosed) {
|
|
12904
12848
|
setState({
|
|
12905
12849
|
wasCampaignShownButNowClosed: false
|
|
12906
12850
|
});
|
|
@@ -13466,7 +13410,7 @@ var Container = /*#__PURE__*/function (_Component) {
|
|
|
13466
13410
|
newClient = new Client(clientResponse.client);
|
|
13467
13411
|
|
|
13468
13412
|
if (!newClient.features.chat_ui_v2) {
|
|
13469
|
-
(0,services_logger/* log */.
|
|
13413
|
+
(0,services_logger/* log */.cM)("Clients on old UI", {
|
|
13470
13414
|
clientHandle: newClient.handle
|
|
13471
13415
|
});
|
|
13472
13416
|
}
|
|
@@ -14368,7 +14312,7 @@ window.__AdaEmbedConstructor = Embed;
|
|
|
14368
14312
|
/* harmony export */ });
|
|
14369
14313
|
var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(97|(9[8-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
|
|
14370
14314
|
var isProduction = "production" === "production";
|
|
14371
|
-
var embed2Version = "
|
|
14315
|
+
var embed2Version = "1d1b0f6";
|
|
14372
14316
|
|
|
14373
14317
|
/***/ }),
|
|
14374
14318
|
|
|
@@ -14625,8 +14569,9 @@ function httpRequest(obj) {
|
|
|
14625
14569
|
|
|
14626
14570
|
"use strict";
|
|
14627
14571
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14628
|
-
/* harmony export */ "
|
|
14572
|
+
/* harmony export */ "cM": function() { return /* binding */ log; }
|
|
14629
14573
|
/* harmony export */ });
|
|
14574
|
+
/* unused harmony exports DEFAULT_LOG_SAMPLE_RATE, shouldLog */
|
|
14630
14575
|
/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2149);
|
|
14631
14576
|
/* harmony import */ var _babel_runtime_corejs3_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3938);
|
|
14632
14577
|
/* harmony import */ var _babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3109);
|
|
@@ -14647,7 +14592,9 @@ function httpRequest(obj) {
|
|
|
14647
14592
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_8__);
|
|
14648
14593
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3978);
|
|
14649
14594
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9__);
|
|
14650
|
-
/* harmony import */ var
|
|
14595
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(773);
|
|
14596
|
+
/* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_11__);
|
|
14597
|
+
/* harmony import */ var common_helpers_http__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9392);
|
|
14651
14598
|
|
|
14652
14599
|
|
|
14653
14600
|
|
|
@@ -14665,23 +14612,23 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14665
14612
|
|
|
14666
14613
|
|
|
14667
14614
|
|
|
14615
|
+
|
|
14668
14616
|
var DEFAULT_LOG_SAMPLE_RATE = 0.01; // 1% of logs will go through
|
|
14669
14617
|
|
|
14670
14618
|
var DD_BASE_URL = "https://browser-http-intake.logs.datadoghq.com/v1/input/";
|
|
14671
|
-
var DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1";
|
|
14619
|
+
var DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1"; // We need memoization to ensure consistency of logs
|
|
14672
14620
|
|
|
14673
|
-
var shouldLog = function
|
|
14674
|
-
if (!DD_TOKEN || sampleRate
|
|
14621
|
+
var shouldLog = lodash_memoize__WEBPACK_IMPORTED_MODULE_11___default()(function (sampleRate) {
|
|
14622
|
+
if (!DD_TOKEN || sampleRate === 0) {
|
|
14675
14623
|
return false;
|
|
14676
14624
|
}
|
|
14677
14625
|
|
|
14678
14626
|
return Math.random() < (sampleRate || DEFAULT_LOG_SAMPLE_RATE);
|
|
14679
|
-
};
|
|
14627
|
+
});
|
|
14680
14628
|
/**
|
|
14681
14629
|
* Sends log to Datadog
|
|
14682
14630
|
*/
|
|
14683
14631
|
|
|
14684
|
-
|
|
14685
14632
|
function log(_x, _x2, _x3) {
|
|
14686
14633
|
return _log.apply(this, arguments);
|
|
14687
14634
|
}
|
|
@@ -14701,18 +14648,19 @@ function _log() {
|
|
|
14701
14648
|
|
|
14702
14649
|
case 2:
|
|
14703
14650
|
_context.next = 4;
|
|
14704
|
-
return (0,
|
|
14651
|
+
return (0,common_helpers_http__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
|
|
14705
14652
|
url: "".concat(DD_BASE_URL).concat(DD_TOKEN, "?ddsource=browser&ddtags=version:1.5.0"),
|
|
14706
14653
|
method: "POST",
|
|
14707
14654
|
body: _babel_runtime_corejs3_core_js_stable_json_stringify__WEBPACK_IMPORTED_MODULE_10___default()(_objectSpread(_objectSpread({
|
|
14708
14655
|
message: message
|
|
14709
14656
|
}, extra), {}, {
|
|
14657
|
+
sampleRate: (options === null || options === void 0 ? void 0 : options.sampleRate) || DEFAULT_LOG_SAMPLE_RATE,
|
|
14710
14658
|
service: "embed",
|
|
14711
14659
|
env: "production",
|
|
14712
14660
|
embedVersion: 2,
|
|
14713
|
-
version: "1.0.
|
|
14661
|
+
version: "1.0.63",
|
|
14714
14662
|
isNpm: true,
|
|
14715
|
-
commitHash: "
|
|
14663
|
+
commitHash: "1d1b0f6"
|
|
14716
14664
|
}))
|
|
14717
14665
|
});
|
|
14718
14666
|
|
|
@@ -23723,6 +23671,689 @@ function toNumber(value) {
|
|
|
23723
23671
|
module.exports = debounce;
|
|
23724
23672
|
|
|
23725
23673
|
|
|
23674
|
+
/***/ }),
|
|
23675
|
+
|
|
23676
|
+
/***/ 773:
|
|
23677
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
23678
|
+
|
|
23679
|
+
/**
|
|
23680
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
23681
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
23682
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
23683
|
+
* Released under MIT license <https://lodash.com/license>
|
|
23684
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
23685
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
23686
|
+
*/
|
|
23687
|
+
|
|
23688
|
+
/** Used as the `TypeError` message for "Functions" methods. */
|
|
23689
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
23690
|
+
|
|
23691
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
23692
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
23693
|
+
|
|
23694
|
+
/** `Object#toString` result references. */
|
|
23695
|
+
var funcTag = '[object Function]',
|
|
23696
|
+
genTag = '[object GeneratorFunction]';
|
|
23697
|
+
|
|
23698
|
+
/**
|
|
23699
|
+
* Used to match `RegExp`
|
|
23700
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
23701
|
+
*/
|
|
23702
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
23703
|
+
|
|
23704
|
+
/** Used to detect host constructors (Safari). */
|
|
23705
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
23706
|
+
|
|
23707
|
+
/** Detect free variable `global` from Node.js. */
|
|
23708
|
+
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
|
|
23709
|
+
|
|
23710
|
+
/** Detect free variable `self`. */
|
|
23711
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
23712
|
+
|
|
23713
|
+
/** Used as a reference to the global object. */
|
|
23714
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
23715
|
+
|
|
23716
|
+
/**
|
|
23717
|
+
* Gets the value at `key` of `object`.
|
|
23718
|
+
*
|
|
23719
|
+
* @private
|
|
23720
|
+
* @param {Object} [object] The object to query.
|
|
23721
|
+
* @param {string} key The key of the property to get.
|
|
23722
|
+
* @returns {*} Returns the property value.
|
|
23723
|
+
*/
|
|
23724
|
+
function getValue(object, key) {
|
|
23725
|
+
return object == null ? undefined : object[key];
|
|
23726
|
+
}
|
|
23727
|
+
|
|
23728
|
+
/**
|
|
23729
|
+
* Checks if `value` is a host object in IE < 9.
|
|
23730
|
+
*
|
|
23731
|
+
* @private
|
|
23732
|
+
* @param {*} value The value to check.
|
|
23733
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
23734
|
+
*/
|
|
23735
|
+
function isHostObject(value) {
|
|
23736
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
23737
|
+
// despite having improperly defined `toString` methods.
|
|
23738
|
+
var result = false;
|
|
23739
|
+
if (value != null && typeof value.toString != 'function') {
|
|
23740
|
+
try {
|
|
23741
|
+
result = !!(value + '');
|
|
23742
|
+
} catch (e) {}
|
|
23743
|
+
}
|
|
23744
|
+
return result;
|
|
23745
|
+
}
|
|
23746
|
+
|
|
23747
|
+
/** Used for built-in method references. */
|
|
23748
|
+
var arrayProto = Array.prototype,
|
|
23749
|
+
funcProto = Function.prototype,
|
|
23750
|
+
objectProto = Object.prototype;
|
|
23751
|
+
|
|
23752
|
+
/** Used to detect overreaching core-js shims. */
|
|
23753
|
+
var coreJsData = root['__core-js_shared__'];
|
|
23754
|
+
|
|
23755
|
+
/** Used to detect methods masquerading as native. */
|
|
23756
|
+
var maskSrcKey = (function() {
|
|
23757
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
23758
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
23759
|
+
}());
|
|
23760
|
+
|
|
23761
|
+
/** Used to resolve the decompiled source of functions. */
|
|
23762
|
+
var funcToString = funcProto.toString;
|
|
23763
|
+
|
|
23764
|
+
/** Used to check objects for own properties. */
|
|
23765
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
23766
|
+
|
|
23767
|
+
/**
|
|
23768
|
+
* Used to resolve the
|
|
23769
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
23770
|
+
* of values.
|
|
23771
|
+
*/
|
|
23772
|
+
var objectToString = objectProto.toString;
|
|
23773
|
+
|
|
23774
|
+
/** Used to detect if a method is native. */
|
|
23775
|
+
var reIsNative = RegExp('^' +
|
|
23776
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
23777
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
23778
|
+
);
|
|
23779
|
+
|
|
23780
|
+
/** Built-in value references. */
|
|
23781
|
+
var splice = arrayProto.splice;
|
|
23782
|
+
|
|
23783
|
+
/* Built-in method references that are verified to be native. */
|
|
23784
|
+
var Map = getNative(root, 'Map'),
|
|
23785
|
+
nativeCreate = getNative(Object, 'create');
|
|
23786
|
+
|
|
23787
|
+
/**
|
|
23788
|
+
* Creates a hash object.
|
|
23789
|
+
*
|
|
23790
|
+
* @private
|
|
23791
|
+
* @constructor
|
|
23792
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
23793
|
+
*/
|
|
23794
|
+
function Hash(entries) {
|
|
23795
|
+
var index = -1,
|
|
23796
|
+
length = entries ? entries.length : 0;
|
|
23797
|
+
|
|
23798
|
+
this.clear();
|
|
23799
|
+
while (++index < length) {
|
|
23800
|
+
var entry = entries[index];
|
|
23801
|
+
this.set(entry[0], entry[1]);
|
|
23802
|
+
}
|
|
23803
|
+
}
|
|
23804
|
+
|
|
23805
|
+
/**
|
|
23806
|
+
* Removes all key-value entries from the hash.
|
|
23807
|
+
*
|
|
23808
|
+
* @private
|
|
23809
|
+
* @name clear
|
|
23810
|
+
* @memberOf Hash
|
|
23811
|
+
*/
|
|
23812
|
+
function hashClear() {
|
|
23813
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
23814
|
+
}
|
|
23815
|
+
|
|
23816
|
+
/**
|
|
23817
|
+
* Removes `key` and its value from the hash.
|
|
23818
|
+
*
|
|
23819
|
+
* @private
|
|
23820
|
+
* @name delete
|
|
23821
|
+
* @memberOf Hash
|
|
23822
|
+
* @param {Object} hash The hash to modify.
|
|
23823
|
+
* @param {string} key The key of the value to remove.
|
|
23824
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
23825
|
+
*/
|
|
23826
|
+
function hashDelete(key) {
|
|
23827
|
+
return this.has(key) && delete this.__data__[key];
|
|
23828
|
+
}
|
|
23829
|
+
|
|
23830
|
+
/**
|
|
23831
|
+
* Gets the hash value for `key`.
|
|
23832
|
+
*
|
|
23833
|
+
* @private
|
|
23834
|
+
* @name get
|
|
23835
|
+
* @memberOf Hash
|
|
23836
|
+
* @param {string} key The key of the value to get.
|
|
23837
|
+
* @returns {*} Returns the entry value.
|
|
23838
|
+
*/
|
|
23839
|
+
function hashGet(key) {
|
|
23840
|
+
var data = this.__data__;
|
|
23841
|
+
if (nativeCreate) {
|
|
23842
|
+
var result = data[key];
|
|
23843
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
23844
|
+
}
|
|
23845
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
23846
|
+
}
|
|
23847
|
+
|
|
23848
|
+
/**
|
|
23849
|
+
* Checks if a hash value for `key` exists.
|
|
23850
|
+
*
|
|
23851
|
+
* @private
|
|
23852
|
+
* @name has
|
|
23853
|
+
* @memberOf Hash
|
|
23854
|
+
* @param {string} key The key of the entry to check.
|
|
23855
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
23856
|
+
*/
|
|
23857
|
+
function hashHas(key) {
|
|
23858
|
+
var data = this.__data__;
|
|
23859
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
23860
|
+
}
|
|
23861
|
+
|
|
23862
|
+
/**
|
|
23863
|
+
* Sets the hash `key` to `value`.
|
|
23864
|
+
*
|
|
23865
|
+
* @private
|
|
23866
|
+
* @name set
|
|
23867
|
+
* @memberOf Hash
|
|
23868
|
+
* @param {string} key The key of the value to set.
|
|
23869
|
+
* @param {*} value The value to set.
|
|
23870
|
+
* @returns {Object} Returns the hash instance.
|
|
23871
|
+
*/
|
|
23872
|
+
function hashSet(key, value) {
|
|
23873
|
+
var data = this.__data__;
|
|
23874
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
23875
|
+
return this;
|
|
23876
|
+
}
|
|
23877
|
+
|
|
23878
|
+
// Add methods to `Hash`.
|
|
23879
|
+
Hash.prototype.clear = hashClear;
|
|
23880
|
+
Hash.prototype['delete'] = hashDelete;
|
|
23881
|
+
Hash.prototype.get = hashGet;
|
|
23882
|
+
Hash.prototype.has = hashHas;
|
|
23883
|
+
Hash.prototype.set = hashSet;
|
|
23884
|
+
|
|
23885
|
+
/**
|
|
23886
|
+
* Creates an list cache object.
|
|
23887
|
+
*
|
|
23888
|
+
* @private
|
|
23889
|
+
* @constructor
|
|
23890
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
23891
|
+
*/
|
|
23892
|
+
function ListCache(entries) {
|
|
23893
|
+
var index = -1,
|
|
23894
|
+
length = entries ? entries.length : 0;
|
|
23895
|
+
|
|
23896
|
+
this.clear();
|
|
23897
|
+
while (++index < length) {
|
|
23898
|
+
var entry = entries[index];
|
|
23899
|
+
this.set(entry[0], entry[1]);
|
|
23900
|
+
}
|
|
23901
|
+
}
|
|
23902
|
+
|
|
23903
|
+
/**
|
|
23904
|
+
* Removes all key-value entries from the list cache.
|
|
23905
|
+
*
|
|
23906
|
+
* @private
|
|
23907
|
+
* @name clear
|
|
23908
|
+
* @memberOf ListCache
|
|
23909
|
+
*/
|
|
23910
|
+
function listCacheClear() {
|
|
23911
|
+
this.__data__ = [];
|
|
23912
|
+
}
|
|
23913
|
+
|
|
23914
|
+
/**
|
|
23915
|
+
* Removes `key` and its value from the list cache.
|
|
23916
|
+
*
|
|
23917
|
+
* @private
|
|
23918
|
+
* @name delete
|
|
23919
|
+
* @memberOf ListCache
|
|
23920
|
+
* @param {string} key The key of the value to remove.
|
|
23921
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
23922
|
+
*/
|
|
23923
|
+
function listCacheDelete(key) {
|
|
23924
|
+
var data = this.__data__,
|
|
23925
|
+
index = assocIndexOf(data, key);
|
|
23926
|
+
|
|
23927
|
+
if (index < 0) {
|
|
23928
|
+
return false;
|
|
23929
|
+
}
|
|
23930
|
+
var lastIndex = data.length - 1;
|
|
23931
|
+
if (index == lastIndex) {
|
|
23932
|
+
data.pop();
|
|
23933
|
+
} else {
|
|
23934
|
+
splice.call(data, index, 1);
|
|
23935
|
+
}
|
|
23936
|
+
return true;
|
|
23937
|
+
}
|
|
23938
|
+
|
|
23939
|
+
/**
|
|
23940
|
+
* Gets the list cache value for `key`.
|
|
23941
|
+
*
|
|
23942
|
+
* @private
|
|
23943
|
+
* @name get
|
|
23944
|
+
* @memberOf ListCache
|
|
23945
|
+
* @param {string} key The key of the value to get.
|
|
23946
|
+
* @returns {*} Returns the entry value.
|
|
23947
|
+
*/
|
|
23948
|
+
function listCacheGet(key) {
|
|
23949
|
+
var data = this.__data__,
|
|
23950
|
+
index = assocIndexOf(data, key);
|
|
23951
|
+
|
|
23952
|
+
return index < 0 ? undefined : data[index][1];
|
|
23953
|
+
}
|
|
23954
|
+
|
|
23955
|
+
/**
|
|
23956
|
+
* Checks if a list cache value for `key` exists.
|
|
23957
|
+
*
|
|
23958
|
+
* @private
|
|
23959
|
+
* @name has
|
|
23960
|
+
* @memberOf ListCache
|
|
23961
|
+
* @param {string} key The key of the entry to check.
|
|
23962
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
23963
|
+
*/
|
|
23964
|
+
function listCacheHas(key) {
|
|
23965
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
23966
|
+
}
|
|
23967
|
+
|
|
23968
|
+
/**
|
|
23969
|
+
* Sets the list cache `key` to `value`.
|
|
23970
|
+
*
|
|
23971
|
+
* @private
|
|
23972
|
+
* @name set
|
|
23973
|
+
* @memberOf ListCache
|
|
23974
|
+
* @param {string} key The key of the value to set.
|
|
23975
|
+
* @param {*} value The value to set.
|
|
23976
|
+
* @returns {Object} Returns the list cache instance.
|
|
23977
|
+
*/
|
|
23978
|
+
function listCacheSet(key, value) {
|
|
23979
|
+
var data = this.__data__,
|
|
23980
|
+
index = assocIndexOf(data, key);
|
|
23981
|
+
|
|
23982
|
+
if (index < 0) {
|
|
23983
|
+
data.push([key, value]);
|
|
23984
|
+
} else {
|
|
23985
|
+
data[index][1] = value;
|
|
23986
|
+
}
|
|
23987
|
+
return this;
|
|
23988
|
+
}
|
|
23989
|
+
|
|
23990
|
+
// Add methods to `ListCache`.
|
|
23991
|
+
ListCache.prototype.clear = listCacheClear;
|
|
23992
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
23993
|
+
ListCache.prototype.get = listCacheGet;
|
|
23994
|
+
ListCache.prototype.has = listCacheHas;
|
|
23995
|
+
ListCache.prototype.set = listCacheSet;
|
|
23996
|
+
|
|
23997
|
+
/**
|
|
23998
|
+
* Creates a map cache object to store key-value pairs.
|
|
23999
|
+
*
|
|
24000
|
+
* @private
|
|
24001
|
+
* @constructor
|
|
24002
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
24003
|
+
*/
|
|
24004
|
+
function MapCache(entries) {
|
|
24005
|
+
var index = -1,
|
|
24006
|
+
length = entries ? entries.length : 0;
|
|
24007
|
+
|
|
24008
|
+
this.clear();
|
|
24009
|
+
while (++index < length) {
|
|
24010
|
+
var entry = entries[index];
|
|
24011
|
+
this.set(entry[0], entry[1]);
|
|
24012
|
+
}
|
|
24013
|
+
}
|
|
24014
|
+
|
|
24015
|
+
/**
|
|
24016
|
+
* Removes all key-value entries from the map.
|
|
24017
|
+
*
|
|
24018
|
+
* @private
|
|
24019
|
+
* @name clear
|
|
24020
|
+
* @memberOf MapCache
|
|
24021
|
+
*/
|
|
24022
|
+
function mapCacheClear() {
|
|
24023
|
+
this.__data__ = {
|
|
24024
|
+
'hash': new Hash,
|
|
24025
|
+
'map': new (Map || ListCache),
|
|
24026
|
+
'string': new Hash
|
|
24027
|
+
};
|
|
24028
|
+
}
|
|
24029
|
+
|
|
24030
|
+
/**
|
|
24031
|
+
* Removes `key` and its value from the map.
|
|
24032
|
+
*
|
|
24033
|
+
* @private
|
|
24034
|
+
* @name delete
|
|
24035
|
+
* @memberOf MapCache
|
|
24036
|
+
* @param {string} key The key of the value to remove.
|
|
24037
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
24038
|
+
*/
|
|
24039
|
+
function mapCacheDelete(key) {
|
|
24040
|
+
return getMapData(this, key)['delete'](key);
|
|
24041
|
+
}
|
|
24042
|
+
|
|
24043
|
+
/**
|
|
24044
|
+
* Gets the map value for `key`.
|
|
24045
|
+
*
|
|
24046
|
+
* @private
|
|
24047
|
+
* @name get
|
|
24048
|
+
* @memberOf MapCache
|
|
24049
|
+
* @param {string} key The key of the value to get.
|
|
24050
|
+
* @returns {*} Returns the entry value.
|
|
24051
|
+
*/
|
|
24052
|
+
function mapCacheGet(key) {
|
|
24053
|
+
return getMapData(this, key).get(key);
|
|
24054
|
+
}
|
|
24055
|
+
|
|
24056
|
+
/**
|
|
24057
|
+
* Checks if a map value for `key` exists.
|
|
24058
|
+
*
|
|
24059
|
+
* @private
|
|
24060
|
+
* @name has
|
|
24061
|
+
* @memberOf MapCache
|
|
24062
|
+
* @param {string} key The key of the entry to check.
|
|
24063
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
24064
|
+
*/
|
|
24065
|
+
function mapCacheHas(key) {
|
|
24066
|
+
return getMapData(this, key).has(key);
|
|
24067
|
+
}
|
|
24068
|
+
|
|
24069
|
+
/**
|
|
24070
|
+
* Sets the map `key` to `value`.
|
|
24071
|
+
*
|
|
24072
|
+
* @private
|
|
24073
|
+
* @name set
|
|
24074
|
+
* @memberOf MapCache
|
|
24075
|
+
* @param {string} key The key of the value to set.
|
|
24076
|
+
* @param {*} value The value to set.
|
|
24077
|
+
* @returns {Object} Returns the map cache instance.
|
|
24078
|
+
*/
|
|
24079
|
+
function mapCacheSet(key, value) {
|
|
24080
|
+
getMapData(this, key).set(key, value);
|
|
24081
|
+
return this;
|
|
24082
|
+
}
|
|
24083
|
+
|
|
24084
|
+
// Add methods to `MapCache`.
|
|
24085
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
24086
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
24087
|
+
MapCache.prototype.get = mapCacheGet;
|
|
24088
|
+
MapCache.prototype.has = mapCacheHas;
|
|
24089
|
+
MapCache.prototype.set = mapCacheSet;
|
|
24090
|
+
|
|
24091
|
+
/**
|
|
24092
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
24093
|
+
*
|
|
24094
|
+
* @private
|
|
24095
|
+
* @param {Array} array The array to inspect.
|
|
24096
|
+
* @param {*} key The key to search for.
|
|
24097
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
24098
|
+
*/
|
|
24099
|
+
function assocIndexOf(array, key) {
|
|
24100
|
+
var length = array.length;
|
|
24101
|
+
while (length--) {
|
|
24102
|
+
if (eq(array[length][0], key)) {
|
|
24103
|
+
return length;
|
|
24104
|
+
}
|
|
24105
|
+
}
|
|
24106
|
+
return -1;
|
|
24107
|
+
}
|
|
24108
|
+
|
|
24109
|
+
/**
|
|
24110
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
24111
|
+
*
|
|
24112
|
+
* @private
|
|
24113
|
+
* @param {*} value The value to check.
|
|
24114
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
24115
|
+
* else `false`.
|
|
24116
|
+
*/
|
|
24117
|
+
function baseIsNative(value) {
|
|
24118
|
+
if (!isObject(value) || isMasked(value)) {
|
|
24119
|
+
return false;
|
|
24120
|
+
}
|
|
24121
|
+
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
|
24122
|
+
return pattern.test(toSource(value));
|
|
24123
|
+
}
|
|
24124
|
+
|
|
24125
|
+
/**
|
|
24126
|
+
* Gets the data for `map`.
|
|
24127
|
+
*
|
|
24128
|
+
* @private
|
|
24129
|
+
* @param {Object} map The map to query.
|
|
24130
|
+
* @param {string} key The reference key.
|
|
24131
|
+
* @returns {*} Returns the map data.
|
|
24132
|
+
*/
|
|
24133
|
+
function getMapData(map, key) {
|
|
24134
|
+
var data = map.__data__;
|
|
24135
|
+
return isKeyable(key)
|
|
24136
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
24137
|
+
: data.map;
|
|
24138
|
+
}
|
|
24139
|
+
|
|
24140
|
+
/**
|
|
24141
|
+
* Gets the native function at `key` of `object`.
|
|
24142
|
+
*
|
|
24143
|
+
* @private
|
|
24144
|
+
* @param {Object} object The object to query.
|
|
24145
|
+
* @param {string} key The key of the method to get.
|
|
24146
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
24147
|
+
*/
|
|
24148
|
+
function getNative(object, key) {
|
|
24149
|
+
var value = getValue(object, key);
|
|
24150
|
+
return baseIsNative(value) ? value : undefined;
|
|
24151
|
+
}
|
|
24152
|
+
|
|
24153
|
+
/**
|
|
24154
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
24155
|
+
*
|
|
24156
|
+
* @private
|
|
24157
|
+
* @param {*} value The value to check.
|
|
24158
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
24159
|
+
*/
|
|
24160
|
+
function isKeyable(value) {
|
|
24161
|
+
var type = typeof value;
|
|
24162
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
24163
|
+
? (value !== '__proto__')
|
|
24164
|
+
: (value === null);
|
|
24165
|
+
}
|
|
24166
|
+
|
|
24167
|
+
/**
|
|
24168
|
+
* Checks if `func` has its source masked.
|
|
24169
|
+
*
|
|
24170
|
+
* @private
|
|
24171
|
+
* @param {Function} func The function to check.
|
|
24172
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
24173
|
+
*/
|
|
24174
|
+
function isMasked(func) {
|
|
24175
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
24176
|
+
}
|
|
24177
|
+
|
|
24178
|
+
/**
|
|
24179
|
+
* Converts `func` to its source code.
|
|
24180
|
+
*
|
|
24181
|
+
* @private
|
|
24182
|
+
* @param {Function} func The function to process.
|
|
24183
|
+
* @returns {string} Returns the source code.
|
|
24184
|
+
*/
|
|
24185
|
+
function toSource(func) {
|
|
24186
|
+
if (func != null) {
|
|
24187
|
+
try {
|
|
24188
|
+
return funcToString.call(func);
|
|
24189
|
+
} catch (e) {}
|
|
24190
|
+
try {
|
|
24191
|
+
return (func + '');
|
|
24192
|
+
} catch (e) {}
|
|
24193
|
+
}
|
|
24194
|
+
return '';
|
|
24195
|
+
}
|
|
24196
|
+
|
|
24197
|
+
/**
|
|
24198
|
+
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
24199
|
+
* provided, it determines the cache key for storing the result based on the
|
|
24200
|
+
* arguments provided to the memoized function. By default, the first argument
|
|
24201
|
+
* provided to the memoized function is used as the map cache key. The `func`
|
|
24202
|
+
* is invoked with the `this` binding of the memoized function.
|
|
24203
|
+
*
|
|
24204
|
+
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
24205
|
+
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
24206
|
+
* constructor with one whose instances implement the
|
|
24207
|
+
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
24208
|
+
* method interface of `delete`, `get`, `has`, and `set`.
|
|
24209
|
+
*
|
|
24210
|
+
* @static
|
|
24211
|
+
* @memberOf _
|
|
24212
|
+
* @since 0.1.0
|
|
24213
|
+
* @category Function
|
|
24214
|
+
* @param {Function} func The function to have its output memoized.
|
|
24215
|
+
* @param {Function} [resolver] The function to resolve the cache key.
|
|
24216
|
+
* @returns {Function} Returns the new memoized function.
|
|
24217
|
+
* @example
|
|
24218
|
+
*
|
|
24219
|
+
* var object = { 'a': 1, 'b': 2 };
|
|
24220
|
+
* var other = { 'c': 3, 'd': 4 };
|
|
24221
|
+
*
|
|
24222
|
+
* var values = _.memoize(_.values);
|
|
24223
|
+
* values(object);
|
|
24224
|
+
* // => [1, 2]
|
|
24225
|
+
*
|
|
24226
|
+
* values(other);
|
|
24227
|
+
* // => [3, 4]
|
|
24228
|
+
*
|
|
24229
|
+
* object.a = 2;
|
|
24230
|
+
* values(object);
|
|
24231
|
+
* // => [1, 2]
|
|
24232
|
+
*
|
|
24233
|
+
* // Modify the result cache.
|
|
24234
|
+
* values.cache.set(object, ['a', 'b']);
|
|
24235
|
+
* values(object);
|
|
24236
|
+
* // => ['a', 'b']
|
|
24237
|
+
*
|
|
24238
|
+
* // Replace `_.memoize.Cache`.
|
|
24239
|
+
* _.memoize.Cache = WeakMap;
|
|
24240
|
+
*/
|
|
24241
|
+
function memoize(func, resolver) {
|
|
24242
|
+
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
|
24243
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
24244
|
+
}
|
|
24245
|
+
var memoized = function() {
|
|
24246
|
+
var args = arguments,
|
|
24247
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
24248
|
+
cache = memoized.cache;
|
|
24249
|
+
|
|
24250
|
+
if (cache.has(key)) {
|
|
24251
|
+
return cache.get(key);
|
|
24252
|
+
}
|
|
24253
|
+
var result = func.apply(this, args);
|
|
24254
|
+
memoized.cache = cache.set(key, result);
|
|
24255
|
+
return result;
|
|
24256
|
+
};
|
|
24257
|
+
memoized.cache = new (memoize.Cache || MapCache);
|
|
24258
|
+
return memoized;
|
|
24259
|
+
}
|
|
24260
|
+
|
|
24261
|
+
// Assign cache to `_.memoize`.
|
|
24262
|
+
memoize.Cache = MapCache;
|
|
24263
|
+
|
|
24264
|
+
/**
|
|
24265
|
+
* Performs a
|
|
24266
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
24267
|
+
* comparison between two values to determine if they are equivalent.
|
|
24268
|
+
*
|
|
24269
|
+
* @static
|
|
24270
|
+
* @memberOf _
|
|
24271
|
+
* @since 4.0.0
|
|
24272
|
+
* @category Lang
|
|
24273
|
+
* @param {*} value The value to compare.
|
|
24274
|
+
* @param {*} other The other value to compare.
|
|
24275
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
24276
|
+
* @example
|
|
24277
|
+
*
|
|
24278
|
+
* var object = { 'a': 1 };
|
|
24279
|
+
* var other = { 'a': 1 };
|
|
24280
|
+
*
|
|
24281
|
+
* _.eq(object, object);
|
|
24282
|
+
* // => true
|
|
24283
|
+
*
|
|
24284
|
+
* _.eq(object, other);
|
|
24285
|
+
* // => false
|
|
24286
|
+
*
|
|
24287
|
+
* _.eq('a', 'a');
|
|
24288
|
+
* // => true
|
|
24289
|
+
*
|
|
24290
|
+
* _.eq('a', Object('a'));
|
|
24291
|
+
* // => false
|
|
24292
|
+
*
|
|
24293
|
+
* _.eq(NaN, NaN);
|
|
24294
|
+
* // => true
|
|
24295
|
+
*/
|
|
24296
|
+
function eq(value, other) {
|
|
24297
|
+
return value === other || (value !== value && other !== other);
|
|
24298
|
+
}
|
|
24299
|
+
|
|
24300
|
+
/**
|
|
24301
|
+
* Checks if `value` is classified as a `Function` object.
|
|
24302
|
+
*
|
|
24303
|
+
* @static
|
|
24304
|
+
* @memberOf _
|
|
24305
|
+
* @since 0.1.0
|
|
24306
|
+
* @category Lang
|
|
24307
|
+
* @param {*} value The value to check.
|
|
24308
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
24309
|
+
* @example
|
|
24310
|
+
*
|
|
24311
|
+
* _.isFunction(_);
|
|
24312
|
+
* // => true
|
|
24313
|
+
*
|
|
24314
|
+
* _.isFunction(/abc/);
|
|
24315
|
+
* // => false
|
|
24316
|
+
*/
|
|
24317
|
+
function isFunction(value) {
|
|
24318
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
24319
|
+
// in Safari 8-9 which returns 'object' for typed array and other constructors.
|
|
24320
|
+
var tag = isObject(value) ? objectToString.call(value) : '';
|
|
24321
|
+
return tag == funcTag || tag == genTag;
|
|
24322
|
+
}
|
|
24323
|
+
|
|
24324
|
+
/**
|
|
24325
|
+
* Checks if `value` is the
|
|
24326
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
24327
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
24328
|
+
*
|
|
24329
|
+
* @static
|
|
24330
|
+
* @memberOf _
|
|
24331
|
+
* @since 0.1.0
|
|
24332
|
+
* @category Lang
|
|
24333
|
+
* @param {*} value The value to check.
|
|
24334
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
24335
|
+
* @example
|
|
24336
|
+
*
|
|
24337
|
+
* _.isObject({});
|
|
24338
|
+
* // => true
|
|
24339
|
+
*
|
|
24340
|
+
* _.isObject([1, 2, 3]);
|
|
24341
|
+
* // => true
|
|
24342
|
+
*
|
|
24343
|
+
* _.isObject(_.noop);
|
|
24344
|
+
* // => true
|
|
24345
|
+
*
|
|
24346
|
+
* _.isObject(null);
|
|
24347
|
+
* // => false
|
|
24348
|
+
*/
|
|
24349
|
+
function isObject(value) {
|
|
24350
|
+
var type = typeof value;
|
|
24351
|
+
return !!value && (type == 'object' || type == 'function');
|
|
24352
|
+
}
|
|
24353
|
+
|
|
24354
|
+
module.exports = memoize;
|
|
24355
|
+
|
|
24356
|
+
|
|
23726
24357
|
/***/ }),
|
|
23727
24358
|
|
|
23728
24359
|
/***/ 5666:
|
|
@@ -24970,7 +25601,7 @@ function _loadEmbed() {
|
|
|
24970
25601
|
polyfillVersionString = "legacy";
|
|
24971
25602
|
}
|
|
24972
25603
|
|
|
24973
|
-
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "
|
|
25604
|
+
embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "1d1b0f6", "/index.js");
|
|
24974
25605
|
}
|
|
24975
25606
|
|
|
24976
25607
|
clientScriptExists = Boolean( true || // The client script is bundled with npm module
|
|
@@ -25093,7 +25724,7 @@ function createEmbedObject() {
|
|
|
25093
25724
|
embed = null;
|
|
25094
25725
|
});
|
|
25095
25726
|
startEmbedResolve();
|
|
25096
|
-
(0,logger/* log */.
|
|
25727
|
+
(0,logger/* log */.cM)("Embed start", {
|
|
25097
25728
|
handle: adaSettings.handle,
|
|
25098
25729
|
embedSettings: adaSettings,
|
|
25099
25730
|
hostPage: window.location.href
|
|
@@ -25508,7 +26139,7 @@ function createEmbedObject() {
|
|
|
25508
26139
|
}
|
|
25509
26140
|
;// CONCATENATED MODULE: ./src/index-npm.ts
|
|
25510
26141
|
|
|
25511
|
-
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__,
|
|
26142
|
+
Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 5265));
|
|
25512
26143
|
/* harmony default export */ var index_npm = (createEmbedObject());
|
|
25513
26144
|
}();
|
|
25514
26145
|
module.exports = __webpack_exports__;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.63",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:modern": "NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
11
11
|
"build:npm-types": "tsc --project tsconfig.npm.json --declaration --outDir dist/npm-entry --emitDeclarationOnly --allowJs false --checkJs false",
|
|
12
12
|
"build:npm": "./npm-build.sh",
|
|
13
|
-
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings
|
|
13
|
+
"lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 74",
|
|
14
14
|
"lint:fix": "yarn lint --fix",
|
|
15
15
|
"deploy-legacy": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=legacy npx webpack --config webpack.prod.ts",
|
|
16
16
|
"deploy-modern": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@types/jest": "^27.0.2",
|
|
60
60
|
"@types/json-stable-stringify": "^1.0.33",
|
|
61
61
|
"@types/lodash.debounce": "^4.0.6",
|
|
62
|
+
"@types/lodash.memoize": "^4.1.6",
|
|
62
63
|
"@types/node": "^16.7.1",
|
|
63
64
|
"@types/uniqid": "^5.3.2",
|
|
64
65
|
"@types/webpack": "^5.28.0",
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"eslint-plugin-chai-friendly": "^0.7.2",
|
|
74
75
|
"eslint-plugin-compat": "^3.13.0",
|
|
75
76
|
"eslint-plugin-cypress": "^2.11.3",
|
|
77
|
+
"eslint-plugin-sonarjs": "^0.11.0",
|
|
76
78
|
"husky": "^7.0.0",
|
|
77
79
|
"jest": "^27.3.1",
|
|
78
80
|
"jest-localstorage-mock": "^2.4.0",
|
|
@@ -108,6 +110,7 @@
|
|
|
108
110
|
"html-webpack-plugin": "^5.5.0",
|
|
109
111
|
"json-stable-stringify": "^1.0.1",
|
|
110
112
|
"lodash.debounce": "^4.0.8",
|
|
113
|
+
"lodash.memoize": "^4.1.2",
|
|
111
114
|
"preact": "10.4.5",
|
|
112
115
|
"typescript": "^4.5.5",
|
|
113
116
|
"uniqid": "^5.3.0",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerCondition, URLMatchTriggerCondition } from "./types";
|
|
2
|
-
export declare const evalUrlMatchTriggerCondition: (triggerCondition: URLMatchTriggerCondition, url: string) => boolean;
|
|
3
|
-
export declare const evalTriggerCondition: (triggerCondition: TriggerCondition) => boolean;
|