@c15t/scripts 2.2.0 → 3.0.0-alpha.1

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 (202) hide show
  1. package/AGENTS.md +77 -48
  2. package/README.md +4 -3
  3. package/dist/e2e-test-utils.js +60 -24
  4. package/dist/engine/compile.js +45 -45
  5. package/dist/engine/runtime.js +130 -119
  6. package/dist/registry.js +196 -176
  7. package/dist/resolve.js +12 -12
  8. package/dist/vendors/_shared/attributes.js +5 -5
  9. package/dist/vendors/_shared/google-consent.js +10 -10
  10. package/dist/vendors/_shared/install-builders.js +9 -9
  11. package/dist/vendors/_shared/script-url.js +12 -12
  12. package/dist/vendors/ads-and-pixels/linkedin-insights.js +16 -16
  13. package/dist/vendors/ads-and-pixels/meta-pixel.js +82 -82
  14. package/dist/vendors/ads-and-pixels/microsoft-uet.js +57 -57
  15. package/dist/vendors/ads-and-pixels/openai-pixel.js +88 -0
  16. package/dist/vendors/ads-and-pixels/reddit-pixel.js +39 -39
  17. package/dist/vendors/ads-and-pixels/snapchat-pixel.js +25 -25
  18. package/dist/vendors/ads-and-pixels/tiktok-pixel.js +31 -31
  19. package/dist/vendors/ads-and-pixels/x-pixel.js +17 -17
  20. package/dist/vendors/analytics/adobe-analytics.js +17 -17
  21. package/dist/vendors/analytics/ahrefs-analytics.js +8 -8
  22. package/dist/vendors/analytics/amplitude.js +39 -39
  23. package/dist/vendors/analytics/clearbit.js +11 -11
  24. package/dist/vendors/analytics/cloudflare-web-analytics.js +13 -13
  25. package/dist/vendors/analytics/databuddy.js +45 -45
  26. package/dist/vendors/analytics/fathom-analytics.js +15 -15
  27. package/dist/vendors/analytics/google-tag.js +23 -23
  28. package/dist/vendors/analytics/heap.js +37 -37
  29. package/dist/vendors/analytics/hightouch.js +30 -30
  30. package/dist/vendors/analytics/hotjar.js +14 -14
  31. package/dist/vendors/analytics/logrocket.js +24 -24
  32. package/dist/vendors/analytics/matomo-analytics.js +51 -51
  33. package/dist/vendors/analytics/microsoft-clarity.js +34 -31
  34. package/dist/vendors/analytics/mixpanel-analytics.js +31 -31
  35. package/dist/vendors/analytics/pirsch.js +27 -27
  36. package/dist/vendors/analytics/plausible-analytics.js +24 -24
  37. package/dist/vendors/analytics/posthog.js +84 -79
  38. package/dist/vendors/analytics/promptwatch.js +8 -8
  39. package/dist/vendors/analytics/rudderstack.js +50 -50
  40. package/dist/vendors/analytics/rybbit-analytics.js +30 -30
  41. package/dist/vendors/analytics/segment.js +16 -16
  42. package/dist/vendors/analytics/umami-analytics.js +16 -16
  43. package/dist/vendors/analytics/vercel-analytics.js +22 -22
  44. package/dist/vendors/functional/crisp.js +49 -51
  45. package/dist/vendors/functional/intercom.js +18 -18
  46. package/dist/vendors/tag-managers/cloudflare-zaraz.js +98 -0
  47. package/dist/vendors/tag-managers/google-tag-manager.js +20 -20
  48. package/dist-types/__tests__/helpers.d.ts +11 -11
  49. package/dist-types/engine/compile.d.ts +3 -3
  50. package/dist-types/engine/runtime.d.ts +3 -3
  51. package/dist-types/registry.d.ts +191 -173
  52. package/dist-types/resolve.d.ts +3 -3
  53. package/dist-types/types.d.ts +2 -2
  54. package/dist-types/vendors/_shared/attributes.d.ts +2 -2
  55. package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
  56. package/dist-types/vendors/_shared/install-builders.d.ts +2 -2
  57. package/dist-types/vendors/_shared/script-url.d.ts +6 -6
  58. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
  59. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
  60. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
  61. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
  62. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
  63. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
  64. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
  65. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
  66. package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
  67. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
  68. package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
  69. package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
  70. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
  71. package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
  72. package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
  73. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  74. package/dist-types/vendors/analytics/heap.d.ts +17 -17
  75. package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
  76. package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
  77. package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
  78. package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
  79. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
  80. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
  81. package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
  82. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  83. package/dist-types/vendors/analytics/posthog.d.ts +35 -32
  84. package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
  85. package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
  86. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
  87. package/dist-types/vendors/analytics/segment.d.ts +11 -11
  88. package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
  89. package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
  90. package/dist-types/vendors/functional/crisp.d.ts +9 -9
  91. package/dist-types/vendors/functional/intercom.d.ts +12 -12
  92. package/dist-types/vendors/tag-managers/cloudflare-zaraz.d.ts +39 -0
  93. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
  94. package/docs/README.md +77 -48
  95. package/docs/assets/v3/brand-bar.png +0 -0
  96. package/docs/assets/v3/brand-card.png +0 -0
  97. package/docs/assets/v3/choice-wall.png +0 -0
  98. package/docs/assets/v3/mobile-card.png +0 -0
  99. package/docs/assets/v3/preferences.png +0 -0
  100. package/docs/customization/overview.md +45 -0
  101. package/docs/customization/recipes.md +79 -0
  102. package/docs/customization/slots.md +55 -0
  103. package/docs/customization/tokens.md +76 -0
  104. package/docs/customization/translations.md +49 -0
  105. package/docs/frameworks/javascript/script-loader.md +81 -343
  106. package/docs/frameworks/next/script-loader.md +164 -455
  107. package/docs/frameworks/react/script-loader.md +41 -533
  108. package/docs/guides/consent-state.md +60 -0
  109. package/docs/guides/data-fetching.md +163 -0
  110. package/docs/guides/deployment-modes.md +75 -0
  111. package/docs/guides/troubleshooting.md +68 -0
  112. package/docs/guides/verify-consent.md +62 -0
  113. package/docs/integrations/adobe-analytics.md +239 -105
  114. package/docs/integrations/ahrefs-analytics.md +238 -104
  115. package/docs/integrations/amplitude.md +219 -157
  116. package/docs/integrations/building-integrations.md +36 -223
  117. package/docs/integrations/clear-on-revocation.md +167 -0
  118. package/docs/integrations/clearbit.md +247 -86
  119. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  120. package/docs/integrations/cloudflare-zaraz.md +399 -0
  121. package/docs/integrations/crisp.md +251 -97
  122. package/docs/integrations/databuddy.md +259 -153
  123. package/docs/integrations/fathom-analytics.md +239 -96
  124. package/docs/integrations/google-maps.md +328 -207
  125. package/docs/integrations/google-tag-manager.md +248 -96
  126. package/docs/integrations/google-tag.md +261 -90
  127. package/docs/integrations/granular-consent.md +208 -0
  128. package/docs/integrations/heap.md +222 -149
  129. package/docs/integrations/hightouch.md +225 -131
  130. package/docs/integrations/hotjar.md +239 -90
  131. package/docs/integrations/intercom.md +239 -98
  132. package/docs/integrations/linkedin-insights.md +243 -113
  133. package/docs/integrations/logrocket.md +241 -123
  134. package/docs/integrations/matomo-analytics.md +256 -111
  135. package/docs/integrations/meta-pixel.md +197 -324
  136. package/docs/integrations/microsoft-clarity.md +233 -114
  137. package/docs/integrations/microsoft-uet.md +245 -110
  138. package/docs/integrations/mixpanel-analytics.md +252 -87
  139. package/docs/integrations/openai-pixel.md +441 -0
  140. package/docs/integrations/overview.md +96 -133
  141. package/docs/integrations/pirsch.md +249 -96
  142. package/docs/integrations/plausible-analytics.md +241 -100
  143. package/docs/integrations/posthog.md +353 -214
  144. package/docs/integrations/promptwatch.md +251 -81
  145. package/docs/integrations/reddit-pixel.md +226 -173
  146. package/docs/integrations/rudderstack.md +244 -187
  147. package/docs/integrations/rybbit-analytics.md +244 -91
  148. package/docs/integrations/segment.md +238 -92
  149. package/docs/integrations/snapchat-pixel.md +240 -110
  150. package/docs/integrations/tiktok-pixel.md +249 -81
  151. package/docs/integrations/umami-analytics.md +242 -95
  152. package/docs/integrations/vercel-analytics.md +242 -90
  153. package/docs/integrations/x-pixel.md +238 -104
  154. package/docs/integrations/youtube.md +359 -142
  155. package/docs/upgrade-v3.md +381 -0
  156. package/package.json +90 -78
  157. package/dist/e2e-test-utils.cjs +0 -166
  158. package/dist/engine/compile.cjs +0 -130
  159. package/dist/engine/runtime.cjs +0 -475
  160. package/dist/registry.cjs +0 -423
  161. package/dist/resolve.cjs +0 -71
  162. package/dist/types.cjs +0 -69
  163. package/dist/vendors/_shared/attributes.cjs +0 -55
  164. package/dist/vendors/_shared/google-consent.cjs +0 -69
  165. package/dist/vendors/_shared/install-builders.cjs +0 -59
  166. package/dist/vendors/_shared/script-url.cjs +0 -78
  167. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
  168. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
  169. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
  170. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
  171. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
  172. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
  173. package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
  174. package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
  175. package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
  176. package/dist/vendors/analytics/amplitude.cjs +0 -193
  177. package/dist/vendors/analytics/clearbit.cjs +0 -69
  178. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
  179. package/dist/vendors/analytics/databuddy.cjs +0 -144
  180. package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
  181. package/dist/vendors/analytics/google-tag.cjs +0 -107
  182. package/dist/vendors/analytics/heap.cjs +0 -181
  183. package/dist/vendors/analytics/hightouch.cjs +0 -153
  184. package/dist/vendors/analytics/hotjar.cjs +0 -85
  185. package/dist/vendors/analytics/logrocket.cjs +0 -99
  186. package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
  187. package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
  188. package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
  189. package/dist/vendors/analytics/pirsch.cjs +0 -108
  190. package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
  191. package/dist/vendors/analytics/posthog.cjs +0 -236
  192. package/dist/vendors/analytics/promptwatch.cjs +0 -70
  193. package/dist/vendors/analytics/rudderstack.cjs +0 -227
  194. package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
  195. package/dist/vendors/analytics/segment.cjs +0 -97
  196. package/dist/vendors/analytics/umami-analytics.cjs +0 -80
  197. package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
  198. package/dist/vendors/functional/crisp.cjs +0 -143
  199. package/dist/vendors/functional/intercom.cjs +0 -89
  200. package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
  201. package/docs/shared/react/guides/script-loader.md +0 -311
  202. package/readme.json +0 -19
@@ -1,181 +0,0 @@
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
- DEFAULT_HEAP_CONFIG_BASE_URL: ()=>DEFAULT_HEAP_CONFIG_BASE_URL,
32
- HEAP_QUEUE_METHODS: ()=>HEAP_QUEUE_METHODS,
33
- heap: ()=>heap,
34
- heapManifest: ()=>heapManifest
35
- });
36
- const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
37
- const external_types_cjs_namespaceObject = require("../../types.cjs");
38
- const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
39
- const DEFAULT_HEAP_CONFIG_BASE_URL = 'https://cdn.us.heap-api.com/config';
40
- const HEAP_QUEUE_METHODS = [
41
- 'init',
42
- 'startTracking',
43
- 'stopTracking',
44
- 'track',
45
- 'resetIdentity',
46
- 'identify',
47
- 'identifyHashed',
48
- 'getSessionId',
49
- 'getUserId',
50
- 'getIdentity',
51
- 'addUserProperties',
52
- 'addEventProperties',
53
- 'removeEventProperty',
54
- 'clearEventProperties',
55
- 'addAccountProperties',
56
- 'addAdapter',
57
- 'addTransformer',
58
- 'addTransformerFn',
59
- 'onReady',
60
- 'addPageviewProperties',
61
- 'removePageviewProperty',
62
- 'clearPageviewProperties',
63
- 'trackPageview'
64
- ];
65
- const heapManifest = {
66
- ...external_types_cjs_namespaceObject.vendorManifestContract,
67
- vendor: 'heap',
68
- category: 'measurement',
69
- install: [
70
- {
71
- type: 'setGlobal',
72
- name: 'heapReadyCb',
73
- value: [],
74
- ifUndefined: true
75
- },
76
- {
77
- type: 'setGlobal',
78
- name: 'heap',
79
- value: [],
80
- ifUndefined: true
81
- },
82
- {
83
- type: 'setGlobalPath',
84
- path: [
85
- 'heap',
86
- 'envId'
87
- ],
88
- value: '{{envId}}'
89
- },
90
- {
91
- type: 'setGlobalPath',
92
- path: [
93
- 'heap',
94
- 'appid'
95
- ],
96
- value: '{{envId}}'
97
- },
98
- {
99
- type: 'setGlobalPath',
100
- path: [
101
- 'heap',
102
- 'clientConfig'
103
- ],
104
- value: '{{clientConfig}}'
105
- },
106
- {
107
- type: 'defineQueueMethods',
108
- target: 'heap',
109
- queue: {
110
- global: 'heapReadyCb'
111
- },
112
- queueFormat: 'callback',
113
- methods: [
114
- ...HEAP_QUEUE_METHODS
115
- ]
116
- },
117
- {
118
- type: 'loadScript',
119
- src: "{{scriptUrl}}",
120
- async: true
121
- }
122
- ]
123
- };
124
- function validateEnvId(envId) {
125
- const normalized = 'string' == typeof envId ? envId.trim() : '';
126
- if (0 === normalized.length) throw new Error('heap: missing or invalid envId');
127
- return normalized;
128
- }
129
- function isPlainRecord(value) {
130
- if (null === value || 'object' != typeof value || Array.isArray(value)) return false;
131
- const prototype = Object.getPrototypeOf(value);
132
- return prototype === Object.prototype || null === prototype;
133
- }
134
- function toJsonValue(value, path) {
135
- if (null === value) return null;
136
- if ('string' == typeof value || 'boolean' == typeof value) return value;
137
- if ('number' == typeof value) {
138
- if (Number.isFinite(value)) return value;
139
- throw new TypeError(`heap: clientConfig${path ? `.${path}` : ''} must be a finite number`);
140
- }
141
- if (Array.isArray(value)) return value.map((item, index)=>toJsonValue(item, `${path}[${index}]`));
142
- if (isPlainRecord(value)) {
143
- const result = {};
144
- for (const [key, nestedValue] of Object.entries(value))result[key] = toJsonValue(nestedValue, path ? `${path}.${key}` : key);
145
- return result;
146
- }
147
- throw new TypeError(`heap: clientConfig${path ? `.${path}` : ''} must be JSON-serializable`);
148
- }
149
- function normalizeClientConfig(clientConfig) {
150
- const config = clientConfig ?? {};
151
- const normalized = toJsonValue(config, '');
152
- if (!isPlainRecord(normalized)) throw new TypeError('heap: clientConfig must be a plain object');
153
- return {
154
- ...normalized,
155
- shouldFetchServerConfig: false
156
- };
157
- }
158
- function resolveHeapScriptUrl(envId, scriptUrl) {
159
- return (0, script_url_cjs_namespaceObject.resolveScriptUrl)((0, script_url_cjs_namespaceObject.trimToUndefined)(scriptUrl), (0, script_url_cjs_namespaceObject.joinUrlPath)(DEFAULT_HEAP_CONFIG_BASE_URL, `${envId}/heap_config.js`));
160
- }
161
- function heap({ envId, clientConfig, scriptUrl }) {
162
- const normalizedEnvId = validateEnvId(envId);
163
- return (0, external_resolve_cjs_namespaceObject.resolveManifest)(heapManifest, {
164
- envId: normalizedEnvId,
165
- clientConfig: normalizeClientConfig(clientConfig),
166
- scriptUrl: resolveHeapScriptUrl(normalizedEnvId, scriptUrl)
167
- });
168
- }
169
- exports.DEFAULT_HEAP_CONFIG_BASE_URL = __webpack_exports__.DEFAULT_HEAP_CONFIG_BASE_URL;
170
- exports.HEAP_QUEUE_METHODS = __webpack_exports__.HEAP_QUEUE_METHODS;
171
- exports.heap = __webpack_exports__.heap;
172
- exports.heapManifest = __webpack_exports__.heapManifest;
173
- for(var __rspack_i in __webpack_exports__)if (-1 === [
174
- "DEFAULT_HEAP_CONFIG_BASE_URL",
175
- "HEAP_QUEUE_METHODS",
176
- "heap",
177
- "heapManifest"
178
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
179
- Object.defineProperty(exports, '__esModule', {
180
- value: true
181
- });
@@ -1,153 +0,0 @@
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
- HIGHTOUCH_QUEUE_METHODS: ()=>HIGHTOUCH_QUEUE_METHODS,
32
- hightouch: ()=>hightouch,
33
- hightouchManifest: ()=>hightouchManifest
34
- });
35
- const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
36
- const external_types_cjs_namespaceObject = require("../../types.cjs");
37
- const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
38
- const DEFAULT_HIGHTOUCH_SCRIPT_URL = 'https://cdn.hightouch-events.com/browser/release/v1-latest/events.min.js';
39
- const HIGHTOUCH_QUEUE_METHODS = [
40
- 'trackSubmit',
41
- 'trackClick',
42
- 'trackLink',
43
- 'trackForm',
44
- 'pageview',
45
- 'identify',
46
- 'reset',
47
- 'group',
48
- 'track',
49
- 'ready',
50
- 'alias',
51
- 'debug',
52
- 'page',
53
- 'once',
54
- 'off',
55
- 'on',
56
- 'addSourceMiddleware',
57
- 'addIntegrationMiddleware',
58
- 'setAnonymousId',
59
- 'addDestinationMiddleware',
60
- 'load'
61
- ];
62
- const hightouchManifest = {
63
- ...external_types_cjs_namespaceObject.vendorManifestContract,
64
- vendor: 'hightouch',
65
- category: 'measurement',
66
- bootstrap: [
67
- {
68
- type: 'setGlobal',
69
- name: 'htevents',
70
- value: [],
71
- ifUndefined: true
72
- },
73
- {
74
- type: 'defineQueueMethods',
75
- target: 'htevents',
76
- methods: [
77
- ...HIGHTOUCH_QUEUE_METHODS
78
- ]
79
- },
80
- {
81
- type: 'setGlobalPath',
82
- path: [
83
- 'htevents',
84
- '_writeKey'
85
- ],
86
- value: '{{writeKey}}'
87
- },
88
- {
89
- type: 'setGlobalPath',
90
- path: [
91
- 'htevents',
92
- '_loadOptions'
93
- ],
94
- value: '{{loadOptions}}'
95
- }
96
- ],
97
- install: [
98
- {
99
- type: 'callGlobal',
100
- global: 'htevents',
101
- method: 'load',
102
- args: [
103
- '{{writeKey}}',
104
- '{{loadOptions}}'
105
- ]
106
- },
107
- {
108
- type: 'callGlobal',
109
- global: 'htevents',
110
- method: 'page'
111
- },
112
- {
113
- type: 'loadScript',
114
- src: "{{scriptUrl}}",
115
- async: true
116
- }
117
- ]
118
- };
119
- function validateWriteKey(writeKey) {
120
- const normalized = 'string' == typeof writeKey ? writeKey.trim() : '';
121
- if (0 === normalized.length) throw new Error('hightouch: missing or invalid writeKey');
122
- return normalized;
123
- }
124
- function normalizeApiHost(apiHost) {
125
- return (0, script_url_cjs_namespaceObject.trimToUndefined)(apiHost);
126
- }
127
- function hightouch({ writeKey, apiHost, trackPageView = true, scriptUrl }) {
128
- const normalizedWriteKey = validateWriteKey(writeKey);
129
- const loadOptions = {
130
- apiHost: normalizeApiHost(apiHost)
131
- };
132
- let manifest = hightouchManifest;
133
- if (!trackPageView) manifest = {
134
- ...hightouchManifest,
135
- install: hightouchManifest.install.filter((step)=>!('callGlobal' === step.type && 'htevents' === step.global && 'page' === step.method))
136
- };
137
- return (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
138
- loadOptions,
139
- writeKey: normalizedWriteKey,
140
- scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)((0, script_url_cjs_namespaceObject.trimToUndefined)(scriptUrl), DEFAULT_HIGHTOUCH_SCRIPT_URL)
141
- });
142
- }
143
- exports.HIGHTOUCH_QUEUE_METHODS = __webpack_exports__.HIGHTOUCH_QUEUE_METHODS;
144
- exports.hightouch = __webpack_exports__.hightouch;
145
- exports.hightouchManifest = __webpack_exports__.hightouchManifest;
146
- for(var __rspack_i in __webpack_exports__)if (-1 === [
147
- "HIGHTOUCH_QUEUE_METHODS",
148
- "hightouch",
149
- "hightouchManifest"
150
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
151
- Object.defineProperty(exports, '__esModule', {
152
- value: true
153
- });
@@ -1,85 +0,0 @@
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
- hotjar: ()=>hotjar,
32
- hotjarManifest: ()=>hotjarManifest
33
- });
34
- const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
- const external_types_cjs_namespaceObject = require("../../types.cjs");
36
- const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
37
- const hotjarManifest = {
38
- ...external_types_cjs_namespaceObject.vendorManifestContract,
39
- vendor: 'hotjar',
40
- category: 'measurement',
41
- install: [
42
- {
43
- type: 'setGlobal',
44
- name: '_hjSettings',
45
- value: {
46
- hjid: '{{siteId}}',
47
- hjsv: '{{version}}'
48
- },
49
- ifUndefined: true
50
- },
51
- {
52
- type: 'defineStubFunction',
53
- name: 'hj',
54
- queue: {
55
- property: 'q'
56
- },
57
- queueFormat: 'array',
58
- ifUndefined: true
59
- },
60
- {
61
- type: 'loadScript',
62
- src: "{{scriptUrl}}",
63
- async: true
64
- }
65
- ]
66
- };
67
- function hotjar({ siteId, version = 6, scriptUrl }) {
68
- if (null == siteId) throw new Error('hotjar: missing or invalid siteId');
69
- const normalizedSiteId = String(siteId).trim();
70
- if (0 === normalizedSiteId.length || '0' === normalizedSiteId) throw new Error('hotjar: missing or invalid siteId');
71
- return (0, external_resolve_cjs_namespaceObject.resolveManifest)(hotjarManifest, {
72
- siteId: normalizedSiteId,
73
- version,
74
- scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)(scriptUrl, `https://static.hotjar.com/c/hotjar-${normalizedSiteId}.js?sv=${version}`)
75
- });
76
- }
77
- exports.hotjar = __webpack_exports__.hotjar;
78
- exports.hotjarManifest = __webpack_exports__.hotjarManifest;
79
- for(var __rspack_i in __webpack_exports__)if (-1 === [
80
- "hotjar",
81
- "hotjarManifest"
82
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
83
- Object.defineProperty(exports, '__esModule', {
84
- value: true
85
- });
@@ -1,99 +0,0 @@
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
- logRocket: ()=>logRocket,
32
- logRocketManifest: ()=>logRocketManifest
33
- });
34
- const external_resolve_cjs_namespaceObject = require("../../resolve.cjs");
35
- const external_types_cjs_namespaceObject = require("../../types.cjs");
36
- const script_url_cjs_namespaceObject = require("../_shared/script-url.cjs");
37
- const DEFAULT_LOGROCKET_SCRIPT_URL = 'https://cdn.logrocket.io/LogRocket.min.js';
38
- function validateLogRocketAppId(appId) {
39
- const normalized = 'string' == typeof appId ? appId.trim() : '';
40
- const segments = normalized.split('/');
41
- if (2 !== segments.length || segments.some((segment)=>0 === segment.length)) throw new Error("logRocket: invalid appId - must be a non-empty string in 'org/app' format");
42
- return normalized;
43
- }
44
- const logRocketManifest = {
45
- ...external_types_cjs_namespaceObject.vendorManifestContract,
46
- vendor: 'logrocket',
47
- category: 'measurement',
48
- install: [
49
- {
50
- type: 'loadScript',
51
- src: "{{scriptUrl}}",
52
- attributes: {
53
- crossorigin: 'anonymous'
54
- }
55
- }
56
- ],
57
- afterLoad: [
58
- {
59
- type: 'callGlobal',
60
- global: 'LogRocket',
61
- method: 'init',
62
- args: [
63
- '{{appId}}',
64
- '{{initOptions}}'
65
- ]
66
- }
67
- ]
68
- };
69
- function logRocket(options) {
70
- const appId = validateLogRocketAppId(options?.appId);
71
- const asyncScriptUrl = (0, script_url_cjs_namespaceObject.trimToUndefined)(options.asyncScriptUrl);
72
- let manifest = logRocketManifest;
73
- if (asyncScriptUrl) manifest = {
74
- ...logRocketManifest,
75
- bootstrap: [
76
- {
77
- type: 'setGlobal',
78
- name: '_lrAsyncScript',
79
- value: '{{asyncScriptUrl}}',
80
- ifUndefined: false
81
- }
82
- ]
83
- };
84
- return (0, external_resolve_cjs_namespaceObject.resolveManifest)(manifest, {
85
- appId,
86
- asyncScriptUrl,
87
- initOptions: options.initOptions ?? {},
88
- scriptUrl: (0, script_url_cjs_namespaceObject.resolveScriptUrl)((0, script_url_cjs_namespaceObject.trimToUndefined)(options.scriptUrl), DEFAULT_LOGROCKET_SCRIPT_URL)
89
- });
90
- }
91
- exports.logRocket = __webpack_exports__.logRocket;
92
- exports.logRocketManifest = __webpack_exports__.logRocketManifest;
93
- for(var __rspack_i in __webpack_exports__)if (-1 === [
94
- "logRocket",
95
- "logRocketManifest"
96
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
97
- Object.defineProperty(exports, '__esModule', {
98
- value: true
99
- });