@c15t/scripts 2.0.1 → 2.2.0-canary-20260727202135

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.
Files changed (182) hide show
  1. package/AGENTS.md +62 -0
  2. package/README.md +41 -29
  3. package/dist/e2e-test-utils.cjs +51 -10
  4. package/dist/e2e-test-utils.js +37 -3
  5. package/dist/engine/compile.cjs +9 -5
  6. package/dist/engine/runtime.cjs +111 -17
  7. package/dist/engine/runtime.js +102 -12
  8. package/dist/registry.cjs +423 -0
  9. package/dist/registry.js +372 -0
  10. package/dist/resolve.cjs +9 -5
  11. package/dist/types.cjs +32 -10
  12. package/dist/types.js +10 -1
  13. package/dist/vendors/_shared/attributes.cjs +55 -0
  14. package/dist/vendors/_shared/attributes.js +14 -0
  15. package/dist/vendors/_shared/google-consent.cjs +69 -0
  16. package/dist/vendors/_shared/google-consent.js +27 -0
  17. package/dist/vendors/_shared/install-builders.cjs +59 -0
  18. package/dist/vendors/_shared/install-builders.js +21 -0
  19. package/dist/vendors/_shared/script-url.cjs +78 -0
  20. package/dist/vendors/_shared/script-url.js +28 -0
  21. package/dist/{linkedin-insights.cjs → vendors/ads-and-pixels/linkedin-insights.cjs} +11 -7
  22. package/dist/{linkedin-insights.js → vendors/ads-and-pixels/linkedin-insights.js} +2 -2
  23. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +206 -0
  24. package/dist/vendors/ads-and-pixels/meta-pixel.js +153 -0
  25. package/dist/{microsoft-uet.cjs → vendors/ads-and-pixels/microsoft-uet.cjs} +42 -21
  26. package/dist/{microsoft-uet.js → vendors/ads-and-pixels/microsoft-uet.js} +31 -14
  27. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +151 -0
  28. package/dist/vendors/ads-and-pixels/reddit-pixel.js +107 -0
  29. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +131 -0
  30. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +87 -0
  31. package/dist/{tiktok-pixel.cjs → vendors/ads-and-pixels/tiktok-pixel.cjs} +11 -7
  32. package/dist/{tiktok-pixel.js → vendors/ads-and-pixels/tiktok-pixel.js} +2 -2
  33. package/dist/{x-pixel.cjs → vendors/ads-and-pixels/x-pixel.cjs} +15 -8
  34. package/dist/{x-pixel.js → vendors/ads-and-pixels/x-pixel.js} +6 -3
  35. package/dist/vendors/analytics/adobe-analytics.cjs +90 -0
  36. package/dist/vendors/analytics/adobe-analytics.js +49 -0
  37. package/dist/vendors/analytics/ahrefs-analytics.cjs +68 -0
  38. package/dist/vendors/analytics/ahrefs-analytics.js +27 -0
  39. package/dist/vendors/analytics/amplitude.cjs +193 -0
  40. package/dist/vendors/analytics/amplitude.js +134 -0
  41. package/dist/vendors/analytics/clearbit.cjs +69 -0
  42. package/dist/vendors/analytics/clearbit.js +28 -0
  43. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +73 -0
  44. package/dist/vendors/analytics/cloudflare-web-analytics.js +32 -0
  45. package/dist/{databuddy.cjs → vendors/analytics/databuddy.cjs} +14 -10
  46. package/dist/{databuddy.js → vendors/analytics/databuddy.js} +3 -3
  47. package/dist/vendors/analytics/fathom-analytics.cjs +76 -0
  48. package/dist/vendors/analytics/fathom-analytics.js +35 -0
  49. package/dist/{google-tag.cjs → vendors/analytics/google-tag.cjs} +18 -35
  50. package/dist/{google-tag.js → vendors/analytics/google-tag.js} +7 -28
  51. package/dist/vendors/analytics/heap.cjs +181 -0
  52. package/dist/vendors/analytics/heap.js +134 -0
  53. package/dist/vendors/analytics/hightouch.cjs +153 -0
  54. package/dist/vendors/analytics/hightouch.js +109 -0
  55. package/dist/vendors/analytics/hotjar.cjs +85 -0
  56. package/dist/vendors/analytics/hotjar.js +44 -0
  57. package/dist/vendors/analytics/logrocket.cjs +99 -0
  58. package/dist/vendors/analytics/logrocket.js +58 -0
  59. package/dist/vendors/analytics/matomo-analytics.cjs +232 -0
  60. package/dist/vendors/analytics/matomo-analytics.js +191 -0
  61. package/dist/vendors/analytics/microsoft-clarity.cjs +138 -0
  62. package/dist/vendors/analytics/microsoft-clarity.js +97 -0
  63. package/dist/vendors/analytics/mixpanel-analytics.cjs +134 -0
  64. package/dist/vendors/analytics/mixpanel-analytics.js +93 -0
  65. package/dist/vendors/analytics/pirsch.cjs +108 -0
  66. package/dist/vendors/analytics/pirsch.js +67 -0
  67. package/dist/vendors/analytics/plausible-analytics.cjs +122 -0
  68. package/dist/vendors/analytics/plausible-analytics.js +81 -0
  69. package/dist/vendors/analytics/posthog.cjs +204 -0
  70. package/dist/vendors/analytics/posthog.js +163 -0
  71. package/dist/vendors/analytics/promptwatch.cjs +70 -0
  72. package/dist/vendors/analytics/promptwatch.js +29 -0
  73. package/dist/vendors/analytics/rudderstack.cjs +227 -0
  74. package/dist/vendors/analytics/rudderstack.js +183 -0
  75. package/dist/vendors/analytics/rybbit-analytics.cjs +104 -0
  76. package/dist/vendors/analytics/rybbit-analytics.js +63 -0
  77. package/dist/vendors/analytics/segment.cjs +97 -0
  78. package/dist/vendors/analytics/segment.js +56 -0
  79. package/dist/vendors/analytics/umami-analytics.cjs +80 -0
  80. package/dist/vendors/analytics/umami-analytics.js +39 -0
  81. package/dist/vendors/analytics/vercel-analytics.cjs +94 -0
  82. package/dist/vendors/analytics/vercel-analytics.js +53 -0
  83. package/dist/vendors/functional/crisp.cjs +143 -0
  84. package/dist/vendors/functional/crisp.js +102 -0
  85. package/dist/vendors/functional/intercom.cjs +89 -0
  86. package/dist/vendors/functional/intercom.js +45 -0
  87. package/dist/{google-tag-manager.cjs → vendors/tag-managers/google-tag-manager.cjs} +17 -34
  88. package/dist/{google-tag-manager.js → vendors/tag-managers/google-tag-manager.js} +6 -27
  89. package/dist-types/__tests__/helpers.d.ts +141 -0
  90. package/dist-types/engine/runtime.d.ts +1 -1
  91. package/dist-types/registry.d.ts +440 -0
  92. package/dist-types/types.d.ts +53 -2
  93. package/dist-types/vendors/_shared/attributes.d.ts +35 -0
  94. package/dist-types/vendors/_shared/google-consent.d.ts +47 -0
  95. package/dist-types/vendors/_shared/install-builders.d.ts +30 -0
  96. package/dist-types/vendors/_shared/script-url.d.ts +75 -0
  97. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +92 -0
  98. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +289 -0
  99. package/dist-types/{microsoft-uet.d.ts → vendors/ads-and-pixels/microsoft-uet.d.ts} +45 -34
  100. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +211 -0
  101. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +171 -0
  102. package/dist-types/{tiktok-pixel.d.ts → vendors/ads-and-pixels/tiktok-pixel.d.ts} +48 -33
  103. package/dist-types/{x-pixel.d.ts → vendors/ads-and-pixels/x-pixel.d.ts} +34 -17
  104. package/dist-types/vendors/analytics/adobe-analytics.d.ts +75 -0
  105. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +62 -0
  106. package/dist-types/vendors/analytics/amplitude.d.ts +234 -0
  107. package/dist-types/vendors/analytics/clearbit.d.ts +60 -0
  108. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +67 -0
  109. package/dist-types/{databuddy.d.ts → vendors/analytics/databuddy.d.ts} +25 -25
  110. package/dist-types/vendors/analytics/fathom-analytics.d.ts +90 -0
  111. package/dist-types/{google-tag.d.ts → vendors/analytics/google-tag.d.ts} +21 -24
  112. package/dist-types/vendors/analytics/heap.d.ts +316 -0
  113. package/dist-types/vendors/analytics/hightouch.d.ts +285 -0
  114. package/dist-types/vendors/analytics/hotjar.d.ts +73 -0
  115. package/dist-types/vendors/analytics/logrocket.d.ts +101 -0
  116. package/dist-types/vendors/analytics/matomo-analytics.d.ts +41 -0
  117. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +98 -0
  118. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +113 -0
  119. package/dist-types/vendors/analytics/pirsch.d.ts +96 -0
  120. package/dist-types/vendors/analytics/plausible-analytics.d.ts +122 -0
  121. package/dist-types/vendors/analytics/posthog.d.ts +154 -0
  122. package/dist-types/vendors/analytics/promptwatch.d.ts +36 -0
  123. package/dist-types/vendors/analytics/rudderstack.d.ts +330 -0
  124. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +82 -0
  125. package/dist-types/vendors/analytics/segment.d.ts +158 -0
  126. package/dist-types/vendors/analytics/umami-analytics.d.ts +93 -0
  127. package/dist-types/vendors/analytics/vercel-analytics.d.ts +66 -0
  128. package/dist-types/vendors/functional/crisp.d.ts +78 -0
  129. package/dist-types/vendors/functional/intercom.d.ts +135 -0
  130. package/dist-types/{google-tag-manager.d.ts → vendors/tag-managers/google-tag-manager.d.ts} +22 -25
  131. package/docs/README.md +62 -0
  132. package/docs/frameworks/javascript/script-loader.md +354 -0
  133. package/docs/frameworks/next/script-loader.md +499 -0
  134. package/docs/frameworks/react/script-loader.md +553 -0
  135. package/docs/integrations/adobe-analytics.md +160 -0
  136. package/docs/integrations/ahrefs-analytics.md +157 -0
  137. package/docs/integrations/amplitude.md +230 -0
  138. package/docs/integrations/building-integrations.md +239 -0
  139. package/docs/integrations/clearbit.md +130 -0
  140. package/docs/integrations/cloudflare-web-analytics.md +126 -0
  141. package/docs/integrations/crisp.md +140 -0
  142. package/docs/integrations/databuddy.md +205 -0
  143. package/docs/integrations/fathom-analytics.md +150 -0
  144. package/docs/integrations/google-maps.md +263 -0
  145. package/docs/integrations/google-tag-manager.md +154 -0
  146. package/docs/integrations/google-tag.md +134 -0
  147. package/docs/integrations/heap.md +219 -0
  148. package/docs/integrations/hightouch.md +199 -0
  149. package/docs/integrations/hotjar.md +143 -0
  150. package/docs/integrations/intercom.md +144 -0
  151. package/docs/integrations/linkedin-insights.md +161 -0
  152. package/docs/integrations/logrocket.md +175 -0
  153. package/docs/integrations/matomo-analytics.md +171 -0
  154. package/docs/integrations/meta-pixel.md +412 -0
  155. package/docs/integrations/microsoft-clarity.md +173 -0
  156. package/docs/integrations/microsoft-uet.md +156 -0
  157. package/docs/integrations/mixpanel-analytics.md +130 -0
  158. package/docs/integrations/overview.md +149 -0
  159. package/docs/integrations/pirsch.md +142 -0
  160. package/docs/integrations/plausible-analytics.md +154 -0
  161. package/docs/integrations/posthog.md +258 -0
  162. package/docs/integrations/promptwatch.md +121 -0
  163. package/docs/integrations/reddit-pixel.md +241 -0
  164. package/docs/integrations/rudderstack.md +271 -0
  165. package/docs/integrations/rybbit-analytics.md +143 -0
  166. package/docs/integrations/segment.md +146 -0
  167. package/docs/integrations/snapchat-pixel.md +163 -0
  168. package/docs/integrations/tiktok-pixel.md +123 -0
  169. package/docs/integrations/umami-analytics.md +148 -0
  170. package/docs/integrations/vercel-analytics.md +141 -0
  171. package/docs/integrations/x-pixel.md +157 -0
  172. package/docs/integrations/youtube.md +193 -0
  173. package/docs/shared/react/guides/script-loader.md +309 -0
  174. package/package.json +223 -8
  175. package/readme.json +8 -4
  176. package/dist/meta-pixel.cjs +0 -129
  177. package/dist/meta-pixel.js +0 -89
  178. package/dist/posthog.cjs +0 -137
  179. package/dist/posthog.js +0 -100
  180. package/dist-types/linkedin-insights.d.ts +0 -79
  181. package/dist-types/meta-pixel.d.ts +0 -185
  182. package/dist-types/posthog.d.ts +0 -112
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ vercelAnalytics: ()=>vercelAnalytics,
32
+ vercelAnalyticsManifest: ()=>vercelAnalyticsManifest
33
+ });
34
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
36
+ const vercelAnalyticsManifest = {
37
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
38
+ vendor: 'vercel-analytics',
39
+ category: 'measurement',
40
+ bootstrap: [
41
+ {
42
+ type: 'setGlobal',
43
+ name: 'vaq',
44
+ value: [],
45
+ ifUndefined: true
46
+ },
47
+ {
48
+ type: 'defineStubFunction',
49
+ name: 'va',
50
+ queue: {
51
+ global: 'vaq'
52
+ },
53
+ queueFormat: 'array',
54
+ ifUndefined: true
55
+ }
56
+ ],
57
+ install: [
58
+ {
59
+ type: 'loadScript',
60
+ src: "{{scriptUrl}}",
61
+ defer: true,
62
+ attributes: {
63
+ 'data-sdkn': 'c15t',
64
+ 'data-dsn': '{{dsn}}',
65
+ 'data-disable-auto-track': '{{disableAutoTrackAttribute}}',
66
+ 'data-endpoint': '{{endpoint}}'
67
+ }
68
+ }
69
+ ]
70
+ };
71
+ function getVercelScriptUrl(options) {
72
+ if (options.scriptUrl) return options.scriptUrl;
73
+ if ('development' === options.mode || options.debug) return "https://va.vercel-scripts.com/v1/script.debug.js";
74
+ return "https://va.vercel-scripts.com/v1/script.js";
75
+ }
76
+ function vercelAnalytics(options = {}) {
77
+ let disableAutoTrackAttribute;
78
+ if (options.disableAutoTrack) disableAutoTrackAttribute = '1';
79
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(vercelAnalyticsManifest, {
80
+ scriptUrl: getVercelScriptUrl(options),
81
+ dsn: options.dsn,
82
+ endpoint: options.endpoint,
83
+ disableAutoTrackAttribute
84
+ });
85
+ }
86
+ exports.vercelAnalytics = __webpack_exports__.vercelAnalytics;
87
+ exports.vercelAnalyticsManifest = __webpack_exports__.vercelAnalyticsManifest;
88
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
89
+ "vercelAnalytics",
90
+ "vercelAnalyticsManifest"
91
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
92
+ Object.defineProperty(exports, '__esModule', {
93
+ value: true
94
+ });
@@ -0,0 +1,53 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const vercelAnalyticsManifest = {
4
+ ...vendorManifestContract,
5
+ vendor: 'vercel-analytics',
6
+ category: 'measurement',
7
+ bootstrap: [
8
+ {
9
+ type: 'setGlobal',
10
+ name: 'vaq',
11
+ value: [],
12
+ ifUndefined: true
13
+ },
14
+ {
15
+ type: 'defineStubFunction',
16
+ name: 'va',
17
+ queue: {
18
+ global: 'vaq'
19
+ },
20
+ queueFormat: 'array',
21
+ ifUndefined: true
22
+ }
23
+ ],
24
+ install: [
25
+ {
26
+ type: 'loadScript',
27
+ src: "{{scriptUrl}}",
28
+ defer: true,
29
+ attributes: {
30
+ 'data-sdkn': 'c15t',
31
+ 'data-dsn': '{{dsn}}',
32
+ 'data-disable-auto-track': '{{disableAutoTrackAttribute}}',
33
+ 'data-endpoint': '{{endpoint}}'
34
+ }
35
+ }
36
+ ]
37
+ };
38
+ function getVercelScriptUrl(options) {
39
+ if (options.scriptUrl) return options.scriptUrl;
40
+ if ('development' === options.mode || options.debug) return "https://va.vercel-scripts.com/v1/script.debug.js";
41
+ return "https://va.vercel-scripts.com/v1/script.js";
42
+ }
43
+ function vercelAnalytics(options = {}) {
44
+ let disableAutoTrackAttribute;
45
+ if (options.disableAutoTrack) disableAutoTrackAttribute = '1';
46
+ return resolveManifest(vercelAnalyticsManifest, {
47
+ scriptUrl: getVercelScriptUrl(options),
48
+ dsn: options.dsn,
49
+ endpoint: options.endpoint,
50
+ disableAutoTrackAttribute
51
+ });
52
+ }
53
+ export { vercelAnalytics, vercelAnalyticsManifest };
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ crisp: ()=>crisp,
32
+ crispManifest: ()=>crispManifest
33
+ });
34
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
36
+ const crispManifest = {
37
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
38
+ vendor: 'crisp',
39
+ category: 'functionality',
40
+ install: [
41
+ {
42
+ type: 'setGlobal',
43
+ name: '$crisp',
44
+ value: [],
45
+ ifUndefined: false
46
+ },
47
+ {
48
+ type: 'setGlobal',
49
+ name: 'CRISP_WEBSITE_ID',
50
+ value: '{{websiteId}}',
51
+ ifUndefined: false
52
+ },
53
+ {
54
+ type: 'loadScript',
55
+ src: "{{scriptSrc}}",
56
+ async: true
57
+ }
58
+ ]
59
+ };
60
+ function createCrispManifest(options) {
61
+ const install = [
62
+ {
63
+ type: 'setGlobal',
64
+ name: '$crisp',
65
+ value: [],
66
+ ifUndefined: false
67
+ },
68
+ {
69
+ type: 'setGlobal',
70
+ name: 'CRISP_WEBSITE_ID',
71
+ value: '{{websiteId}}',
72
+ ifUndefined: false
73
+ }
74
+ ];
75
+ if (void 0 !== options.locale || void 0 !== options.sessionMerge) install.push({
76
+ type: 'setGlobal',
77
+ name: 'CRISP_RUNTIME_CONFIG',
78
+ value: {
79
+ ...void 0 !== options.locale ? {
80
+ locale: '{{locale}}'
81
+ } : {},
82
+ ...void 0 !== options.sessionMerge ? {
83
+ session_merge: '{{sessionMerge}}'
84
+ } : {}
85
+ },
86
+ ifUndefined: false
87
+ });
88
+ if (options.cookieDomain) install.push({
89
+ type: 'setGlobal',
90
+ name: 'CRISP_COOKIE_DOMAIN',
91
+ value: '{{cookieDomain}}',
92
+ ifUndefined: false
93
+ });
94
+ if (void 0 !== options.cookieExpiry) install.push({
95
+ type: 'setGlobal',
96
+ name: 'CRISP_COOKIE_EXPIRE',
97
+ value: '{{cookieExpiry}}',
98
+ ifUndefined: false
99
+ });
100
+ if (options.tokenId) install.push({
101
+ type: 'setGlobal',
102
+ name: 'CRISP_TOKEN_ID',
103
+ value: '{{tokenId}}',
104
+ ifUndefined: false
105
+ });
106
+ if (options.safeMode) install.push({
107
+ type: 'pushToQueue',
108
+ queue: '$crisp',
109
+ value: [
110
+ 'safe',
111
+ true
112
+ ]
113
+ });
114
+ install.push({
115
+ type: 'loadScript',
116
+ src: "{{scriptSrc}}",
117
+ async: true
118
+ });
119
+ return {
120
+ ...crispManifest,
121
+ install
122
+ };
123
+ }
124
+ function crisp(options) {
125
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(createCrispManifest(options), {
126
+ websiteId: options.websiteId,
127
+ locale: options.locale,
128
+ cookieDomain: options.cookieDomain,
129
+ cookieExpiry: options.cookieExpiry,
130
+ tokenId: options.tokenId,
131
+ sessionMerge: options.sessionMerge,
132
+ scriptSrc: options.scriptSrc ?? 'https://client.crisp.chat/l.js'
133
+ });
134
+ }
135
+ exports.crisp = __webpack_exports__.crisp;
136
+ exports.crispManifest = __webpack_exports__.crispManifest;
137
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
138
+ "crisp",
139
+ "crispManifest"
140
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
141
+ Object.defineProperty(exports, '__esModule', {
142
+ value: true
143
+ });
@@ -0,0 +1,102 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const crispManifest = {
4
+ ...vendorManifestContract,
5
+ vendor: 'crisp',
6
+ category: 'functionality',
7
+ install: [
8
+ {
9
+ type: 'setGlobal',
10
+ name: '$crisp',
11
+ value: [],
12
+ ifUndefined: false
13
+ },
14
+ {
15
+ type: 'setGlobal',
16
+ name: 'CRISP_WEBSITE_ID',
17
+ value: '{{websiteId}}',
18
+ ifUndefined: false
19
+ },
20
+ {
21
+ type: 'loadScript',
22
+ src: "{{scriptSrc}}",
23
+ async: true
24
+ }
25
+ ]
26
+ };
27
+ function createCrispManifest(options) {
28
+ const install = [
29
+ {
30
+ type: 'setGlobal',
31
+ name: '$crisp',
32
+ value: [],
33
+ ifUndefined: false
34
+ },
35
+ {
36
+ type: 'setGlobal',
37
+ name: 'CRISP_WEBSITE_ID',
38
+ value: '{{websiteId}}',
39
+ ifUndefined: false
40
+ }
41
+ ];
42
+ if (void 0 !== options.locale || void 0 !== options.sessionMerge) install.push({
43
+ type: 'setGlobal',
44
+ name: 'CRISP_RUNTIME_CONFIG',
45
+ value: {
46
+ ...void 0 !== options.locale ? {
47
+ locale: '{{locale}}'
48
+ } : {},
49
+ ...void 0 !== options.sessionMerge ? {
50
+ session_merge: '{{sessionMerge}}'
51
+ } : {}
52
+ },
53
+ ifUndefined: false
54
+ });
55
+ if (options.cookieDomain) install.push({
56
+ type: 'setGlobal',
57
+ name: 'CRISP_COOKIE_DOMAIN',
58
+ value: '{{cookieDomain}}',
59
+ ifUndefined: false
60
+ });
61
+ if (void 0 !== options.cookieExpiry) install.push({
62
+ type: 'setGlobal',
63
+ name: 'CRISP_COOKIE_EXPIRE',
64
+ value: '{{cookieExpiry}}',
65
+ ifUndefined: false
66
+ });
67
+ if (options.tokenId) install.push({
68
+ type: 'setGlobal',
69
+ name: 'CRISP_TOKEN_ID',
70
+ value: '{{tokenId}}',
71
+ ifUndefined: false
72
+ });
73
+ if (options.safeMode) install.push({
74
+ type: 'pushToQueue',
75
+ queue: '$crisp',
76
+ value: [
77
+ 'safe',
78
+ true
79
+ ]
80
+ });
81
+ install.push({
82
+ type: 'loadScript',
83
+ src: "{{scriptSrc}}",
84
+ async: true
85
+ });
86
+ return {
87
+ ...crispManifest,
88
+ install
89
+ };
90
+ }
91
+ function crisp(options) {
92
+ return resolveManifest(createCrispManifest(options), {
93
+ websiteId: options.websiteId,
94
+ locale: options.locale,
95
+ cookieDomain: options.cookieDomain,
96
+ cookieExpiry: options.cookieExpiry,
97
+ tokenId: options.tokenId,
98
+ sessionMerge: options.sessionMerge,
99
+ scriptSrc: options.scriptSrc ?? 'https://client.crisp.chat/l.js'
100
+ });
101
+ }
102
+ export { crisp, crispManifest };
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ INTERCOM_API_BASES: ()=>INTERCOM_API_BASES,
32
+ intercom: ()=>intercom,
33
+ intercomManifest: ()=>intercomManifest
34
+ });
35
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
36
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
37
+ const INTERCOM_API_BASES = {
38
+ us: 'https://api-iam.intercom.io',
39
+ eu: 'https://api-iam.eu.intercom.io',
40
+ au: 'https://api-iam.au.intercom.io'
41
+ };
42
+ const intercomManifest = {
43
+ ...external_types_cjs_namespaceObject.vendorManifestContract,
44
+ vendor: 'intercom',
45
+ category: 'functionality',
46
+ install: [
47
+ {
48
+ type: 'defineStubFunction',
49
+ name: 'Intercom',
50
+ queue: {
51
+ property: 'q'
52
+ },
53
+ queueFormat: 'array',
54
+ ifUndefined: true
55
+ },
56
+ {
57
+ type: 'setGlobal',
58
+ name: 'intercomSettings',
59
+ value: '{{settings}}',
60
+ ifUndefined: false
61
+ },
62
+ {
63
+ type: 'loadScript',
64
+ src: "{{scriptSrc}}",
65
+ async: true
66
+ }
67
+ ]
68
+ };
69
+ function intercom({ appId, apiBase = INTERCOM_API_BASES.us, settings, scriptSrc }) {
70
+ return (0, external_resolve_cjs_namespaceObject.resolveManifest)(intercomManifest, {
71
+ settings: {
72
+ ...settings ?? {},
73
+ app_id: appId,
74
+ api_base: apiBase
75
+ },
76
+ scriptSrc: scriptSrc ?? `https://widget.intercom.io/widget/${appId}`
77
+ });
78
+ }
79
+ exports.INTERCOM_API_BASES = __webpack_exports__.INTERCOM_API_BASES;
80
+ exports.intercom = __webpack_exports__.intercom;
81
+ exports.intercomManifest = __webpack_exports__.intercomManifest;
82
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
83
+ "INTERCOM_API_BASES",
84
+ "intercom",
85
+ "intercomManifest"
86
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
87
+ Object.defineProperty(exports, '__esModule', {
88
+ value: true
89
+ });
@@ -0,0 +1,45 @@
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { vendorManifestContract } from "../../types.js";
3
+ const INTERCOM_API_BASES = {
4
+ us: 'https://api-iam.intercom.io',
5
+ eu: 'https://api-iam.eu.intercom.io',
6
+ au: 'https://api-iam.au.intercom.io'
7
+ };
8
+ const intercomManifest = {
9
+ ...vendorManifestContract,
10
+ vendor: 'intercom',
11
+ category: 'functionality',
12
+ install: [
13
+ {
14
+ type: 'defineStubFunction',
15
+ name: 'Intercom',
16
+ queue: {
17
+ property: 'q'
18
+ },
19
+ queueFormat: 'array',
20
+ ifUndefined: true
21
+ },
22
+ {
23
+ type: 'setGlobal',
24
+ name: 'intercomSettings',
25
+ value: '{{settings}}',
26
+ ifUndefined: false
27
+ },
28
+ {
29
+ type: 'loadScript',
30
+ src: "{{scriptSrc}}",
31
+ async: true
32
+ }
33
+ ]
34
+ };
35
+ function intercom({ appId, apiBase = INTERCOM_API_BASES.us, settings, scriptSrc }) {
36
+ return resolveManifest(intercomManifest, {
37
+ settings: {
38
+ ...settings ?? {},
39
+ app_id: appId,
40
+ api_base: apiBase
41
+ },
42
+ scriptSrc: scriptSrc ?? `https://widget.intercom.io/widget/${appId}`
43
+ });
44
+ }
45
+ export { INTERCOM_API_BASES, intercom, intercomManifest };
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
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
- });
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
9
13
  };
10
14
  })();
11
15
  (()=>{
@@ -24,11 +28,12 @@ var __webpack_require__ = {};
24
28
  var __webpack_exports__ = {};
25
29
  __webpack_require__.r(__webpack_exports__);
26
30
  __webpack_require__.d(__webpack_exports__, {
27
- googleTagManagerManifest: ()=>googleTagManagerManifest,
28
- googleTagManager: ()=>googleTagManager
31
+ googleTagManager: ()=>googleTagManager,
32
+ googleTagManagerManifest: ()=>googleTagManagerManifest
29
33
  });
30
- const external_resolve_cjs_namespaceObject = require("./resolve.cjs");
31
- const external_types_cjs_namespaceObject = require("./types.cjs");
34
+ const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
+ const external_types_cjs_namespaceObject = require("../../types.cjs");
36
+ const google_consent_cjs_namespaceObject = require("../_shared/google-consent.cjs");
32
37
  const googleTagManagerManifest = {
33
38
  ...external_types_cjs_namespaceObject.vendorManifestContract,
34
39
  vendor: 'google-tag-manager',
@@ -53,7 +58,7 @@ const googleTagManagerManifest = {
53
58
  type: 'pushToQueue',
54
59
  queue: 'dataLayer',
55
60
  value: {
56
- 'gtm.start': '{{loadTime}}',
61
+ 'gtm.start': external_types_cjs_namespaceObject.runtimeTimestampValue,
57
62
  event: 'gtm.js'
58
63
  }
59
64
  },
@@ -73,35 +78,13 @@ const googleTagManagerManifest = {
73
78
  ]
74
79
  }
75
80
  ],
76
- consentMapping: {
77
- necessary: [
78
- 'security_storage'
79
- ],
80
- functionality: [
81
- 'functionality_storage'
82
- ],
83
- measurement: [
84
- 'analytics_storage'
85
- ],
86
- marketing: [
87
- 'ad_storage',
88
- 'ad_user_data',
89
- 'ad_personalization'
90
- ],
91
- experience: [
92
- 'personalization_storage'
93
- ]
94
- },
81
+ consentMapping: google_consent_cjs_namespaceObject.GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
95
82
  consentSignal: 'gtag'
96
83
  };
97
84
  function googleTagManager({ id, updateEventName, consentMapping }) {
98
- const manifest = consentMapping ? {
99
- ...googleTagManagerManifest,
100
- consentMapping
101
- } : googleTagManagerManifest;
85
+ const manifest = (0, google_consent_cjs_namespaceObject.withOptionalConsentMapping)(googleTagManagerManifest, consentMapping);
102
86
  const resolved = (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
103
87
  id,
104
- loadTime: Date.now(),
105
88
  updateEventName: updateEventName ?? 'consent-update'
106
89
  });
107
90
  return resolved;
@@ -1,5 +1,6 @@
1
- import { resolveManifest } from "./resolve.js";
2
- import { vendorManifestContract } from "./types.js";
1
+ import { resolveManifest } from "../../resolve.js";
2
+ import { runtimeTimestampValue, vendorManifestContract } from "../../types.js";
3
+ import { GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING, withOptionalConsentMapping } from "../_shared/google-consent.js";
3
4
  const googleTagManagerManifest = {
4
5
  ...vendorManifestContract,
5
6
  vendor: 'google-tag-manager',
@@ -24,7 +25,7 @@ const googleTagManagerManifest = {
24
25
  type: 'pushToQueue',
25
26
  queue: 'dataLayer',
26
27
  value: {
27
- 'gtm.start': '{{loadTime}}',
28
+ 'gtm.start': runtimeTimestampValue,
28
29
  event: 'gtm.js'
29
30
  }
30
31
  },
@@ -44,35 +45,13 @@ const googleTagManagerManifest = {
44
45
  ]
45
46
  }
46
47
  ],
47
- consentMapping: {
48
- necessary: [
49
- 'security_storage'
50
- ],
51
- functionality: [
52
- 'functionality_storage'
53
- ],
54
- measurement: [
55
- 'analytics_storage'
56
- ],
57
- marketing: [
58
- 'ad_storage',
59
- 'ad_user_data',
60
- 'ad_personalization'
61
- ],
62
- experience: [
63
- 'personalization_storage'
64
- ]
65
- },
48
+ consentMapping: GOOGLE_CONSENT_MODE_V2_DEFAULT_MAPPING,
66
49
  consentSignal: 'gtag'
67
50
  };
68
51
  function googleTagManager({ id, updateEventName, consentMapping }) {
69
- const manifest = consentMapping ? {
70
- ...googleTagManagerManifest,
71
- consentMapping
72
- } : googleTagManagerManifest;
52
+ const manifest = withOptionalConsentMapping(googleTagManagerManifest, consentMapping);
73
53
  const resolved = resolveManifest(manifest, {
74
54
  id,
75
- loadTime: Date.now(),
76
55
  updateEventName: updateEventName ?? 'consent-update'
77
56
  });
78
57
  return resolved;