@c15t/scripts 2.2.0 → 3.0.0-alpha.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.
Files changed (197) hide show
  1. package/AGENTS.md +74 -48
  2. package/README.md +3 -3
  3. package/dist/e2e-test-utils.js +60 -24
  4. package/dist/engine/compile.js +45 -45
  5. package/dist/engine/runtime.js +119 -119
  6. package/dist/registry.js +186 -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 +31 -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/google-tag-manager.js +20 -20
  47. package/dist-types/__tests__/helpers.d.ts +10 -10
  48. package/dist-types/engine/compile.d.ts +2 -2
  49. package/dist-types/engine/runtime.d.ts +3 -3
  50. package/dist-types/registry.d.ts +182 -173
  51. package/dist-types/resolve.d.ts +2 -2
  52. package/dist-types/types.d.ts +2 -2
  53. package/dist-types/vendors/_shared/attributes.d.ts +2 -2
  54. package/dist-types/vendors/_shared/google-consent.d.ts +2 -2
  55. package/dist-types/vendors/_shared/install-builders.d.ts +1 -1
  56. package/dist-types/vendors/_shared/script-url.d.ts +6 -6
  57. package/dist-types/vendors/ads-and-pixels/linkedin-insights.d.ts +14 -14
  58. package/dist-types/vendors/ads-and-pixels/meta-pixel.d.ts +27 -27
  59. package/dist-types/vendors/ads-and-pixels/microsoft-uet.d.ts +40 -40
  60. package/dist-types/vendors/ads-and-pixels/openai-pixel.d.ts +211 -0
  61. package/dist-types/vendors/ads-and-pixels/reddit-pixel.d.ts +28 -29
  62. package/dist-types/vendors/ads-and-pixels/snapchat-pixel.d.ts +23 -23
  63. package/dist-types/vendors/ads-and-pixels/tiktok-pixel.d.ts +22 -22
  64. package/dist-types/vendors/ads-and-pixels/x-pixel.d.ts +15 -15
  65. package/dist-types/vendors/analytics/adobe-analytics.d.ts +3 -3
  66. package/dist-types/vendors/analytics/ahrefs-analytics.d.ts +5 -5
  67. package/dist-types/vendors/analytics/amplitude.d.ts +24 -24
  68. package/dist-types/vendors/analytics/clearbit.d.ts +5 -5
  69. package/dist-types/vendors/analytics/cloudflare-web-analytics.d.ts +6 -6
  70. package/dist-types/vendors/analytics/databuddy.d.ts +34 -31
  71. package/dist-types/vendors/analytics/fathom-analytics.d.ts +8 -8
  72. package/dist-types/vendors/analytics/google-tag.d.ts +17 -17
  73. package/dist-types/vendors/analytics/heap.d.ts +17 -17
  74. package/dist-types/vendors/analytics/hightouch.d.ts +15 -15
  75. package/dist-types/vendors/analytics/hotjar.d.ts +9 -9
  76. package/dist-types/vendors/analytics/logrocket.d.ts +11 -11
  77. package/dist-types/vendors/analytics/matomo-analytics.d.ts +3 -3
  78. package/dist-types/vendors/analytics/microsoft-clarity.d.ts +12 -13
  79. package/dist-types/vendors/analytics/mixpanel-analytics.d.ts +20 -20
  80. package/dist-types/vendors/analytics/pirsch.d.ts +10 -10
  81. package/dist-types/vendors/analytics/plausible-analytics.d.ts +13 -13
  82. package/dist-types/vendors/analytics/posthog.d.ts +35 -32
  83. package/dist-types/vendors/analytics/promptwatch.d.ts +5 -5
  84. package/dist-types/vendors/analytics/rudderstack.d.ts +16 -16
  85. package/dist-types/vendors/analytics/rybbit-analytics.d.ts +15 -15
  86. package/dist-types/vendors/analytics/segment.d.ts +11 -11
  87. package/dist-types/vendors/analytics/umami-analytics.d.ts +9 -9
  88. package/dist-types/vendors/analytics/vercel-analytics.d.ts +13 -13
  89. package/dist-types/vendors/functional/crisp.d.ts +9 -9
  90. package/dist-types/vendors/functional/intercom.d.ts +12 -12
  91. package/dist-types/vendors/tag-managers/google-tag-manager.d.ts +16 -16
  92. package/docs/README.md +74 -48
  93. package/docs/assets/v3/brand-bar.png +0 -0
  94. package/docs/assets/v3/brand-card.png +0 -0
  95. package/docs/assets/v3/choice-wall.png +0 -0
  96. package/docs/assets/v3/mobile-card.png +0 -0
  97. package/docs/assets/v3/preferences.png +0 -0
  98. package/docs/customization/overview.md +45 -0
  99. package/docs/customization/recipes.md +79 -0
  100. package/docs/customization/slots.md +55 -0
  101. package/docs/customization/tokens.md +76 -0
  102. package/docs/customization/translations.md +49 -0
  103. package/docs/frameworks/javascript/script-loader.md +30 -339
  104. package/docs/frameworks/next/script-loader.md +134 -467
  105. package/docs/frameworks/react/script-loader.md +35 -535
  106. package/docs/guides/consent-state.md +60 -0
  107. package/docs/guides/data-fetching.md +163 -0
  108. package/docs/guides/deployment-modes.md +63 -0
  109. package/docs/guides/troubleshooting.md +68 -0
  110. package/docs/guides/verify-consent.md +62 -0
  111. package/docs/integrations/adobe-analytics.md +239 -105
  112. package/docs/integrations/ahrefs-analytics.md +238 -104
  113. package/docs/integrations/amplitude.md +219 -157
  114. package/docs/integrations/building-integrations.md +32 -224
  115. package/docs/integrations/clearbit.md +247 -86
  116. package/docs/integrations/cloudflare-web-analytics.md +250 -84
  117. package/docs/integrations/crisp.md +251 -97
  118. package/docs/integrations/databuddy.md +259 -153
  119. package/docs/integrations/fathom-analytics.md +239 -96
  120. package/docs/integrations/google-maps.md +328 -207
  121. package/docs/integrations/google-tag-manager.md +248 -96
  122. package/docs/integrations/google-tag.md +261 -90
  123. package/docs/integrations/heap.md +222 -149
  124. package/docs/integrations/hightouch.md +225 -131
  125. package/docs/integrations/hotjar.md +239 -90
  126. package/docs/integrations/intercom.md +239 -98
  127. package/docs/integrations/linkedin-insights.md +243 -113
  128. package/docs/integrations/logrocket.md +241 -123
  129. package/docs/integrations/matomo-analytics.md +256 -111
  130. package/docs/integrations/meta-pixel.md +197 -324
  131. package/docs/integrations/microsoft-clarity.md +233 -114
  132. package/docs/integrations/microsoft-uet.md +245 -110
  133. package/docs/integrations/mixpanel-analytics.md +252 -87
  134. package/docs/integrations/openai-pixel.md +441 -0
  135. package/docs/integrations/overview.md +95 -133
  136. package/docs/integrations/pirsch.md +249 -96
  137. package/docs/integrations/plausible-analytics.md +241 -100
  138. package/docs/integrations/posthog.md +353 -214
  139. package/docs/integrations/promptwatch.md +251 -81
  140. package/docs/integrations/reddit-pixel.md +226 -173
  141. package/docs/integrations/rudderstack.md +244 -187
  142. package/docs/integrations/rybbit-analytics.md +244 -91
  143. package/docs/integrations/segment.md +238 -92
  144. package/docs/integrations/snapchat-pixel.md +240 -110
  145. package/docs/integrations/tiktok-pixel.md +249 -81
  146. package/docs/integrations/umami-analytics.md +242 -95
  147. package/docs/integrations/vercel-analytics.md +242 -90
  148. package/docs/integrations/x-pixel.md +238 -104
  149. package/docs/integrations/youtube.md +354 -142
  150. package/docs/upgrade-v3.md +334 -0
  151. package/package.json +85 -78
  152. package/readme.json +2 -2
  153. package/dist/e2e-test-utils.cjs +0 -166
  154. package/dist/engine/compile.cjs +0 -130
  155. package/dist/engine/runtime.cjs +0 -475
  156. package/dist/registry.cjs +0 -423
  157. package/dist/resolve.cjs +0 -71
  158. package/dist/types.cjs +0 -69
  159. package/dist/vendors/_shared/attributes.cjs +0 -55
  160. package/dist/vendors/_shared/google-consent.cjs +0 -69
  161. package/dist/vendors/_shared/install-builders.cjs +0 -59
  162. package/dist/vendors/_shared/script-url.cjs +0 -78
  163. package/dist/vendors/ads-and-pixels/linkedin-insights.cjs +0 -89
  164. package/dist/vendors/ads-and-pixels/meta-pixel.cjs +0 -206
  165. package/dist/vendors/ads-and-pixels/microsoft-uet.cjs +0 -151
  166. package/dist/vendors/ads-and-pixels/reddit-pixel.cjs +0 -151
  167. package/dist/vendors/ads-and-pixels/snapchat-pixel.cjs +0 -131
  168. package/dist/vendors/ads-and-pixels/tiktok-pixel.cjs +0 -130
  169. package/dist/vendors/ads-and-pixels/x-pixel.cjs +0 -92
  170. package/dist/vendors/analytics/adobe-analytics.cjs +0 -90
  171. package/dist/vendors/analytics/ahrefs-analytics.cjs +0 -68
  172. package/dist/vendors/analytics/amplitude.cjs +0 -193
  173. package/dist/vendors/analytics/clearbit.cjs +0 -69
  174. package/dist/vendors/analytics/cloudflare-web-analytics.cjs +0 -73
  175. package/dist/vendors/analytics/databuddy.cjs +0 -144
  176. package/dist/vendors/analytics/fathom-analytics.cjs +0 -76
  177. package/dist/vendors/analytics/google-tag.cjs +0 -107
  178. package/dist/vendors/analytics/heap.cjs +0 -181
  179. package/dist/vendors/analytics/hightouch.cjs +0 -153
  180. package/dist/vendors/analytics/hotjar.cjs +0 -85
  181. package/dist/vendors/analytics/logrocket.cjs +0 -99
  182. package/dist/vendors/analytics/matomo-analytics.cjs +0 -232
  183. package/dist/vendors/analytics/microsoft-clarity.cjs +0 -138
  184. package/dist/vendors/analytics/mixpanel-analytics.cjs +0 -134
  185. package/dist/vendors/analytics/pirsch.cjs +0 -108
  186. package/dist/vendors/analytics/plausible-analytics.cjs +0 -122
  187. package/dist/vendors/analytics/posthog.cjs +0 -236
  188. package/dist/vendors/analytics/promptwatch.cjs +0 -70
  189. package/dist/vendors/analytics/rudderstack.cjs +0 -227
  190. package/dist/vendors/analytics/rybbit-analytics.cjs +0 -104
  191. package/dist/vendors/analytics/segment.cjs +0 -97
  192. package/dist/vendors/analytics/umami-analytics.cjs +0 -80
  193. package/dist/vendors/analytics/vercel-analytics.cjs +0 -94
  194. package/dist/vendors/functional/crisp.cjs +0 -143
  195. package/dist/vendors/functional/intercom.cjs +0 -89
  196. package/dist/vendors/tag-managers/google-tag-manager.cjs +0 -100
  197. package/docs/shared/react/guides/script-loader.md +0 -311
@@ -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
- });