@c15t/scripts 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/e2e-test-utils.cjs +125 -0
- package/dist/e2e-test-utils.js +67 -0
- package/dist/engine/runtime.cjs +19 -9
- package/dist/engine/runtime.js +19 -9
- package/dist/registry.cjs +338 -0
- package/dist/registry.js +292 -0
- package/dist/types.cjs +18 -0
- package/dist/types.js +10 -1
- package/dist/vendors/_shared/attributes.cjs +51 -0
- package/dist/vendors/_shared/attributes.js +14 -0
- package/dist/vendors/_shared/google-consent.cjs +64 -0
- package/dist/vendors/_shared/google-consent.js +27 -0
- package/dist/vendors/_shared/install-builders.cjs +55 -0
- package/dist/vendors/_shared/install-builders.js +21 -0
- package/dist/vendors/_shared/script-url.cjs +74 -0
- package/dist/vendors/_shared/script-url.js +28 -0
- package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +2 -2
- package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
- package/dist/vendors/ads-and-pixels/meta-pixel.cjs +202 -0
- package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
- package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +31 -14
- package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
- package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +147 -0
- package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +127 -0
- package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
- package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +2 -2
- package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
- package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +6 -3
- package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
- package/dist/vendors/analytics/ahrefs-analytics.cjs +64 -0
- package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.cjs +69 -0
- package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
- package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +3 -3
- package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
- package/dist/vendors/analytics/fathom-analytics.cjs +72 -0
- package/dist/vendors/analytics/fathom-analytics.js +35 -0
- package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +7 -28
- package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
- package/dist/vendors/analytics/hotjar.cjs +81 -0
- package/dist/vendors/analytics/hotjar.js +44 -0
- package/dist/vendors/analytics/matomo-analytics.cjs +228 -0
- package/dist/vendors/analytics/matomo-analytics.js +191 -0
- package/dist/vendors/analytics/microsoft-clarity.cjs +110 -0
- package/dist/vendors/analytics/microsoft-clarity.js +73 -0
- package/dist/vendors/analytics/mixpanel-analytics.cjs +119 -0
- package/dist/vendors/analytics/mixpanel-analytics.js +82 -0
- package/dist/vendors/analytics/plausible-analytics.cjs +118 -0
- package/dist/vendors/analytics/plausible-analytics.js +81 -0
- package/dist/{posthog.cjs → vendors/analytics/posthog.cjs} +69 -6
- package/dist/vendors/analytics/posthog.js +163 -0
- package/dist/vendors/analytics/promptwatch.cjs +66 -0
- package/dist/vendors/analytics/promptwatch.js +29 -0
- package/dist/vendors/analytics/rybbit-analytics.cjs +100 -0
- package/dist/vendors/analytics/rybbit-analytics.js +63 -0
- package/dist/vendors/analytics/segment.cjs +93 -0
- package/dist/vendors/analytics/segment.js +56 -0
- package/dist/vendors/analytics/umami-analytics.cjs +76 -0
- package/dist/vendors/analytics/umami-analytics.js +39 -0
- package/dist/vendors/analytics/vercel-analytics.cjs +90 -0
- package/dist/vendors/analytics/vercel-analytics.js +53 -0
- package/dist/vendors/functional/crisp.cjs +139 -0
- package/dist/vendors/functional/crisp.js +102 -0
- package/dist/vendors/functional/intercom.cjs +85 -0
- package/dist/vendors/functional/intercom.js +45 -0
- package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +6 -27
- package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
- package/dist-types/__tests__/helpers.d.ts +141 -0
- package/dist-types/engine/runtime.d.ts +1 -1
- package/dist-types/registry.d.ts +368 -0
- package/dist-types/types.d.ts +13 -0
- package/dist-types/vendors/_shared/attributes.d.ts +35 -0
- package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
- package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
- package/dist-types/vendors/_shared/script-url.d.ts +75 -0
- package/dist-types/{linkedin-insights.d.ts → vendors/ads-and-pixels/linkedin-insights.d.ts} +22 -9
- package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
- package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +21 -10
- package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
- package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
- package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +20 -5
- package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +21 -4
- package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
- package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
- package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
- package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +5 -8
- package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
- package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
- package/dist-types/vendors/analytics/microsoft-clarity.d.ts +86 -0
- package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +101 -0
- package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
- package/dist-types/{posthog.d.ts → vendors/analytics/posthog.d.ts} +47 -5
- package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
- package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
- package/dist-types/vendors/analytics/segment.d.ts +158 -0
- package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
- package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
- package/dist-types/vendors/functional/crisp.d.ts +78 -0
- package/dist-types/vendors/functional/intercom.d.ts +135 -0
- package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +5 -8
- package/package.json +166 -5
- package/dist/meta-pixel.cjs +0 -129
- package/dist/meta-pixel.js +0 -89
- package/dist/posthog.js +0 -100
- package/dist-types/engine.test.d.ts +0 -1
- package/dist-types/helpers.test.d.ts +0 -1
- package/dist-types/meta-pixel.d.ts +0 -185
- /package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
booleanDataAttribute: ()=>booleanDataAttribute,
|
|
28
|
+
listDataAttribute: ()=>listDataAttribute
|
|
29
|
+
});
|
|
30
|
+
function booleanDataAttribute(value) {
|
|
31
|
+
if (void 0 === value) return;
|
|
32
|
+
if (value) return 'true';
|
|
33
|
+
return 'false';
|
|
34
|
+
}
|
|
35
|
+
function listDataAttribute(value) {
|
|
36
|
+
if (void 0 === value) return;
|
|
37
|
+
if (Array.isArray(value)) {
|
|
38
|
+
if (0 === value.length) return;
|
|
39
|
+
return JSON.stringify(value);
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
exports.booleanDataAttribute = __webpack_exports__.booleanDataAttribute;
|
|
44
|
+
exports.listDataAttribute = __webpack_exports__.listDataAttribute;
|
|
45
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
46
|
+
"booleanDataAttribute",
|
|
47
|
+
"listDataAttribute"
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
|
+
Object.defineProperty(exports, '__esModule', {
|
|
50
|
+
value: true
|
|
51
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function booleanDataAttribute(value) {
|
|
2
|
+
if (void 0 === value) return;
|
|
3
|
+
if (value) return 'true';
|
|
4
|
+
return 'false';
|
|
5
|
+
}
|
|
6
|
+
function listDataAttribute(value) {
|
|
7
|
+
if (void 0 === value) return;
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
if (0 === value.length) return;
|
|
10
|
+
return JSON.stringify(value);
|
|
11
|
+
}
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
export { booleanDataAttribute, listDataAttribute };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING: ()=>GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
|
|
28
|
+
withOptionalConsentMapping: ()=>withOptionalConsentMapping
|
|
29
|
+
});
|
|
30
|
+
const GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING = {
|
|
31
|
+
necessary: [
|
|
32
|
+
'security_storage'
|
|
33
|
+
],
|
|
34
|
+
functionality: [
|
|
35
|
+
'functionality_storage'
|
|
36
|
+
],
|
|
37
|
+
measurement: [
|
|
38
|
+
'analytics_storage'
|
|
39
|
+
],
|
|
40
|
+
marketing: [
|
|
41
|
+
'ad_storage',
|
|
42
|
+
'ad_user_data',
|
|
43
|
+
'ad_personalization'
|
|
44
|
+
],
|
|
45
|
+
experience: [
|
|
46
|
+
'personalization_storage'
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
function withOptionalConsentMapping(manifest, consentMapping) {
|
|
50
|
+
if (void 0 === consentMapping) return manifest;
|
|
51
|
+
return {
|
|
52
|
+
...manifest,
|
|
53
|
+
consentMapping
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING = __webpack_exports__.GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING;
|
|
57
|
+
exports.withOptionalConsentMapping = __webpack_exports__.withOptionalConsentMapping;
|
|
58
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
59
|
+
"GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING",
|
|
60
|
+
"withOptionalConsentMapping"
|
|
61
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
62
|
+
Object.defineProperty(exports, '__esModule', {
|
|
63
|
+
value: true
|
|
64
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING = {
|
|
2
|
+
necessary: [
|
|
3
|
+
'security_storage'
|
|
4
|
+
],
|
|
5
|
+
functionality: [
|
|
6
|
+
'functionality_storage'
|
|
7
|
+
],
|
|
8
|
+
measurement: [
|
|
9
|
+
'analytics_storage'
|
|
10
|
+
],
|
|
11
|
+
marketing: [
|
|
12
|
+
'ad_storage',
|
|
13
|
+
'ad_user_data',
|
|
14
|
+
'ad_personalization'
|
|
15
|
+
],
|
|
16
|
+
experience: [
|
|
17
|
+
'personalization_storage'
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
function withOptionalConsentMapping(manifest, consentMapping) {
|
|
21
|
+
if (void 0 === consentMapping) return manifest;
|
|
22
|
+
return {
|
|
23
|
+
...manifest,
|
|
24
|
+
consentMapping
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING, withOptionalConsentMapping };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
buildQueuePixelInstall: ()=>buildQueuePixelInstall
|
|
28
|
+
});
|
|
29
|
+
function buildQueuePixelInstall({ global, initArgs, trackStep, scriptPlaceholder = "{{scriptUrl}}" }) {
|
|
30
|
+
const install = [
|
|
31
|
+
{
|
|
32
|
+
type: 'callGlobal',
|
|
33
|
+
global,
|
|
34
|
+
args: initArgs
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
if (void 0 !== trackStep) install.push({
|
|
38
|
+
type: 'callGlobal',
|
|
39
|
+
global,
|
|
40
|
+
args: trackStep.args
|
|
41
|
+
});
|
|
42
|
+
install.push({
|
|
43
|
+
type: 'loadScript',
|
|
44
|
+
src: scriptPlaceholder,
|
|
45
|
+
async: true
|
|
46
|
+
});
|
|
47
|
+
return install;
|
|
48
|
+
}
|
|
49
|
+
exports.buildQueuePixelInstall = __webpack_exports__.buildQueuePixelInstall;
|
|
50
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
51
|
+
"buildQueuePixelInstall"
|
|
52
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
53
|
+
Object.defineProperty(exports, '__esModule', {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function buildQueuePixelInstall({ global, initArgs, trackStep, scriptPlaceholder = "{{scriptUrl}}" }) {
|
|
2
|
+
const install = [
|
|
3
|
+
{
|
|
4
|
+
type: 'callGlobal',
|
|
5
|
+
global,
|
|
6
|
+
args: initArgs
|
|
7
|
+
}
|
|
8
|
+
];
|
|
9
|
+
if (void 0 !== trackStep) install.push({
|
|
10
|
+
type: 'callGlobal',
|
|
11
|
+
global,
|
|
12
|
+
args: trackStep.args
|
|
13
|
+
});
|
|
14
|
+
install.push({
|
|
15
|
+
type: 'loadScript',
|
|
16
|
+
src: scriptPlaceholder,
|
|
17
|
+
async: true
|
|
18
|
+
});
|
|
19
|
+
return install;
|
|
20
|
+
}
|
|
21
|
+
export { buildQueuePixelInstall };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
joinUrlPath: ()=>joinUrlPath,
|
|
28
|
+
resolveScriptUrl: ()=>resolveScriptUrl,
|
|
29
|
+
stripLeadingSlashes: ()=>stripLeadingSlashes,
|
|
30
|
+
stripTrailingSlashes: ()=>stripTrailingSlashes,
|
|
31
|
+
trimToUndefined: ()=>trimToUndefined
|
|
32
|
+
});
|
|
33
|
+
function trimToUndefined(value) {
|
|
34
|
+
if (void 0 === value) return;
|
|
35
|
+
const trimmed = value.trim();
|
|
36
|
+
if (0 === trimmed.length) return;
|
|
37
|
+
return trimmed;
|
|
38
|
+
}
|
|
39
|
+
function resolveScriptUrl(override, fallback) {
|
|
40
|
+
if (void 0 !== override) return override;
|
|
41
|
+
return fallback;
|
|
42
|
+
}
|
|
43
|
+
function stripLeadingSlashes(value) {
|
|
44
|
+
let index = 0;
|
|
45
|
+
while(index < value.length && 47 === value.charCodeAt(index))index += 1;
|
|
46
|
+
return 0 === index ? value : value.slice(index);
|
|
47
|
+
}
|
|
48
|
+
function stripTrailingSlashes(value) {
|
|
49
|
+
let end = value.length;
|
|
50
|
+
while(end > 0 && 47 === value.charCodeAt(end - 1))end -= 1;
|
|
51
|
+
return end === value.length ? value : value.slice(0, end);
|
|
52
|
+
}
|
|
53
|
+
function joinUrlPath(base, path) {
|
|
54
|
+
const trimmedBase = base.trim();
|
|
55
|
+
const trimmedPath = path.trim();
|
|
56
|
+
if (0 === trimmedBase.length) throw new TypeError(`joinUrlPath requires a non-empty base URL. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
57
|
+
if (0 === trimmedPath.length) throw new TypeError(`joinUrlPath requires a non-empty path. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
58
|
+
return `${stripTrailingSlashes(trimmedBase)}/${stripLeadingSlashes(trimmedPath)}`;
|
|
59
|
+
}
|
|
60
|
+
exports.joinUrlPath = __webpack_exports__.joinUrlPath;
|
|
61
|
+
exports.resolveScriptUrl = __webpack_exports__.resolveScriptUrl;
|
|
62
|
+
exports.stripLeadingSlashes = __webpack_exports__.stripLeadingSlashes;
|
|
63
|
+
exports.stripTrailingSlashes = __webpack_exports__.stripTrailingSlashes;
|
|
64
|
+
exports.trimToUndefined = __webpack_exports__.trimToUndefined;
|
|
65
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
66
|
+
"joinUrlPath",
|
|
67
|
+
"resolveScriptUrl",
|
|
68
|
+
"stripLeadingSlashes",
|
|
69
|
+
"stripTrailingSlashes",
|
|
70
|
+
"trimToUndefined"
|
|
71
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
72
|
+
Object.defineProperty(exports, '__esModule', {
|
|
73
|
+
value: true
|
|
74
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function trimToUndefined(value) {
|
|
2
|
+
if (void 0 === value) return;
|
|
3
|
+
const trimmed = value.trim();
|
|
4
|
+
if (0 === trimmed.length) return;
|
|
5
|
+
return trimmed;
|
|
6
|
+
}
|
|
7
|
+
function resolveScriptUrl(override, fallback) {
|
|
8
|
+
if (void 0 !== override) return override;
|
|
9
|
+
return fallback;
|
|
10
|
+
}
|
|
11
|
+
function stripLeadingSlashes(value) {
|
|
12
|
+
let index = 0;
|
|
13
|
+
while(index < value.length && 47 === value.charCodeAt(index))index += 1;
|
|
14
|
+
return 0 === index ? value : value.slice(index);
|
|
15
|
+
}
|
|
16
|
+
function stripTrailingSlashes(value) {
|
|
17
|
+
let end = value.length;
|
|
18
|
+
while(end > 0 && 47 === value.charCodeAt(end - 1))end -= 1;
|
|
19
|
+
return end === value.length ? value : value.slice(0, end);
|
|
20
|
+
}
|
|
21
|
+
function joinUrlPath(base, path) {
|
|
22
|
+
const trimmedBase = base.trim();
|
|
23
|
+
const trimmedPath = path.trim();
|
|
24
|
+
if (0 === trimmedBase.length) throw new TypeError(`joinUrlPath requires a non-empty base URL. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
25
|
+
if (0 === trimmedPath.length) throw new TypeError(`joinUrlPath requires a non-empty path. Received base=${JSON.stringify(base)}, path=${JSON.stringify(path)}.`);
|
|
26
|
+
return `${stripTrailingSlashes(trimmedBase)}/${stripLeadingSlashes(trimmedPath)}`;
|
|
27
|
+
}
|
|
28
|
+
export { joinUrlPath, resolveScriptUrl, stripLeadingSlashes, stripTrailingSlashes, trimToUndefined };
|
|
@@ -27,8 +27,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
linkedinInsights: ()=>linkedinInsights,
|
|
28
28
|
linkedinInsightsManifest: ()=>linkedinInsightsManifest
|
|
29
29
|
});
|
|
30
|
-
const external_resolve_cjs_namespaceObject = require("
|
|
31
|
-
const external_types_cjs_namespaceObject = require("
|
|
30
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
31
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
32
32
|
const linkedinInsightsManifest = {
|
|
33
33
|
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
34
34
|
vendor: 'linkedin-insights',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveManifest } from "
|
|
2
|
-
import { vendorManifestContract } from "
|
|
1
|
+
import { resolveManifest } from "../../resolve.js";
|
|
2
|
+
import { vendorManifestContract } from "../../types.js";
|
|
3
3
|
const linkedinInsightsManifest = {
|
|
4
4
|
...vendorManifestContract,
|
|
5
5
|
vendor: 'linkedin-insights',
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
metaPixelManifest: ()=>metaPixelManifest,
|
|
28
|
+
metaPixelEvent: ()=>metaPixelEvent,
|
|
29
|
+
metaPixel: ()=>metaPixel,
|
|
30
|
+
metaPixelCustomEvent: ()=>metaPixelCustomEvent,
|
|
31
|
+
metaPixelSingleEvent: ()=>metaPixelSingleEvent,
|
|
32
|
+
metaPixelSingleCustomEvent: ()=>metaPixelSingleCustomEvent
|
|
33
|
+
});
|
|
34
|
+
const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
|
|
35
|
+
const external_types_cjs_namespaceObject = require("../../types.cjs");
|
|
36
|
+
const install_builders_cjs_namespaceObject = require("../_shared/install-builders.cjs");
|
|
37
|
+
const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
|
|
38
|
+
const metaPixelManifest = {
|
|
39
|
+
...external_types_cjs_namespaceObject.vendorManifestContract,
|
|
40
|
+
vendor: 'meta-pixel',
|
|
41
|
+
category: 'marketing',
|
|
42
|
+
persistAfterConsentRevoked: true,
|
|
43
|
+
bootstrap: [
|
|
44
|
+
{
|
|
45
|
+
type: 'defineStubFunction',
|
|
46
|
+
name: 'fbq',
|
|
47
|
+
queue: {
|
|
48
|
+
property: 'queue'
|
|
49
|
+
},
|
|
50
|
+
dispatchProperty: 'callMethod',
|
|
51
|
+
selfReferences: [
|
|
52
|
+
'push'
|
|
53
|
+
],
|
|
54
|
+
aliases: [
|
|
55
|
+
'_fbq'
|
|
56
|
+
],
|
|
57
|
+
properties: {
|
|
58
|
+
loaded: true,
|
|
59
|
+
version: '2.0'
|
|
60
|
+
},
|
|
61
|
+
ifUndefined: true
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
install: [
|
|
65
|
+
{
|
|
66
|
+
type: 'callGlobal',
|
|
67
|
+
global: 'fbq',
|
|
68
|
+
args: [
|
|
69
|
+
'consent',
|
|
70
|
+
'grant'
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'callGlobal',
|
|
75
|
+
global: 'fbq',
|
|
76
|
+
args: [
|
|
77
|
+
'init',
|
|
78
|
+
'{{pixelId}}'
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: 'callGlobal',
|
|
83
|
+
global: 'fbq',
|
|
84
|
+
args: [
|
|
85
|
+
'track',
|
|
86
|
+
'PageView'
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: 'loadScript',
|
|
91
|
+
src: "{{scriptSrc}}",
|
|
92
|
+
async: true
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
onConsentGranted: [
|
|
96
|
+
{
|
|
97
|
+
type: 'callGlobal',
|
|
98
|
+
global: 'fbq',
|
|
99
|
+
args: [
|
|
100
|
+
'consent',
|
|
101
|
+
'grant'
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
onConsentDenied: [
|
|
106
|
+
{
|
|
107
|
+
type: 'callGlobal',
|
|
108
|
+
global: 'fbq',
|
|
109
|
+
args: [
|
|
110
|
+
'consent',
|
|
111
|
+
'revoke'
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
116
|
+
function metaPixel({ pixelId, initOptions, trackPageView = true, dataProcessingOptions, scriptSrc }) {
|
|
117
|
+
const install = buildMetaPixelInstall({
|
|
118
|
+
hasInitOptions: void 0 !== initOptions,
|
|
119
|
+
trackPageView,
|
|
120
|
+
dataProcessingOptions
|
|
121
|
+
});
|
|
122
|
+
const manifest = {
|
|
123
|
+
...metaPixelManifest,
|
|
124
|
+
install
|
|
125
|
+
};
|
|
126
|
+
const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
|
|
127
|
+
pixelId,
|
|
128
|
+
initOptions,
|
|
129
|
+
scriptSrc: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptSrc, 'https://connect.facebook.net/en_US/fbevents.js')
|
|
130
|
+
});
|
|
131
|
+
return resolved;
|
|
132
|
+
}
|
|
133
|
+
function buildMetaPixelInstall({ hasInitOptions, trackPageView, dataProcessingOptions }) {
|
|
134
|
+
const initArgs = [
|
|
135
|
+
'init',
|
|
136
|
+
'{{pixelId}}'
|
|
137
|
+
];
|
|
138
|
+
if (hasInitOptions) initArgs.push('{{initOptions}}');
|
|
139
|
+
const install = (0, install_builders_cjs_namespaceObject.buildQueuePixelInstall)({
|
|
140
|
+
global: 'fbq',
|
|
141
|
+
initArgs,
|
|
142
|
+
trackStep: getMetaPixelPageViewStep(trackPageView),
|
|
143
|
+
scriptPlaceholder: "{{scriptSrc}}"
|
|
144
|
+
});
|
|
145
|
+
if (void 0 !== dataProcessingOptions) install.unshift({
|
|
146
|
+
type: 'callGlobal',
|
|
147
|
+
global: 'fbq',
|
|
148
|
+
args: getMetaPixelDataProcessingArgs(dataProcessingOptions)
|
|
149
|
+
});
|
|
150
|
+
install.unshift({
|
|
151
|
+
type: 'callGlobal',
|
|
152
|
+
global: 'fbq',
|
|
153
|
+
args: [
|
|
154
|
+
'consent',
|
|
155
|
+
'grant'
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
return install;
|
|
159
|
+
}
|
|
160
|
+
function getMetaPixelDataProcessingArgs({ options, country, state }) {
|
|
161
|
+
const args = [
|
|
162
|
+
'dataProcessingOptions',
|
|
163
|
+
options
|
|
164
|
+
];
|
|
165
|
+
if (void 0 !== country || void 0 !== state) args.push(country ?? 0, state ?? 0);
|
|
166
|
+
return args;
|
|
167
|
+
}
|
|
168
|
+
function getMetaPixelPageViewStep(trackPageView) {
|
|
169
|
+
if (trackPageView) return {
|
|
170
|
+
args: [
|
|
171
|
+
'track',
|
|
172
|
+
'PageView'
|
|
173
|
+
]
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function resolveMetaPixelEventOptions(eventOptions) {
|
|
177
|
+
if ('string' == typeof eventOptions) return {
|
|
178
|
+
eventID: eventOptions
|
|
179
|
+
};
|
|
180
|
+
return eventOptions;
|
|
181
|
+
}
|
|
182
|
+
const metaPixelEvent = (eventName, params, eventOptions)=>window.fbq('track', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
183
|
+
const metaPixelCustomEvent = (eventName, params, eventOptions)=>window.fbq('trackCustom', eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
184
|
+
const metaPixelSingleEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingle', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
185
|
+
const metaPixelSingleCustomEvent = (pixelId, eventName, params, eventOptions)=>window.fbq('trackSingleCustom', pixelId, eventName, params, resolveMetaPixelEventOptions(eventOptions));
|
|
186
|
+
exports.metaPixel = __webpack_exports__.metaPixel;
|
|
187
|
+
exports.metaPixelCustomEvent = __webpack_exports__.metaPixelCustomEvent;
|
|
188
|
+
exports.metaPixelEvent = __webpack_exports__.metaPixelEvent;
|
|
189
|
+
exports.metaPixelManifest = __webpack_exports__.metaPixelManifest;
|
|
190
|
+
exports.metaPixelSingleCustomEvent = __webpack_exports__.metaPixelSingleCustomEvent;
|
|
191
|
+
exports.metaPixelSingleEvent = __webpack_exports__.metaPixelSingleEvent;
|
|
192
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
193
|
+
"metaPixel",
|
|
194
|
+
"metaPixelCustomEvent",
|
|
195
|
+
"metaPixelEvent",
|
|
196
|
+
"metaPixelManifest",
|
|
197
|
+
"metaPixelSingleCustomEvent",
|
|
198
|
+
"metaPixelSingleEvent"
|
|
199
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
200
|
+
Object.defineProperty(exports, '__esModule', {
|
|
201
|
+
value: true
|
|
202
|
+
});
|