@modernconsent/vendors 0.0.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.
- package/LICENSE +21 -0
- package/dist/abtasty-3G4JRT5W.js +21 -0
- package/dist/abtasty-3G4JRT5W.js.map +1 -0
- package/dist/abtasty.d.ts +8 -0
- package/dist/abtasty.js +53 -0
- package/dist/abtasty.js.map +1 -0
- package/dist/amplitude-CFLVTHYV.js +25 -0
- package/dist/amplitude-CFLVTHYV.js.map +1 -0
- package/dist/amplitude.d.ts +8 -0
- package/dist/amplitude.js +57 -0
- package/dist/amplitude.js.map +1 -0
- package/dist/chunk-6JXWYPMF.js +28 -0
- package/dist/chunk-6JXWYPMF.js.map +1 -0
- package/dist/chunk-TBZUWLOP.js +35 -0
- package/dist/chunk-TBZUWLOP.js.map +1 -0
- package/dist/clarity-KJPNK3FJ.js +29 -0
- package/dist/clarity-KJPNK3FJ.js.map +1 -0
- package/dist/clarity.d.ts +13 -0
- package/dist/clarity.js +39 -0
- package/dist/clarity.js.map +1 -0
- package/dist/criteo-XKQPP2XY.js +23 -0
- package/dist/criteo-XKQPP2XY.js.map +1 -0
- package/dist/criteo.d.ts +13 -0
- package/dist/criteo.js +55 -0
- package/dist/criteo.js.map +1 -0
- package/dist/gcmads-LKOHK6MW.js +23 -0
- package/dist/gcmads-LKOHK6MW.js.map +1 -0
- package/dist/gcmads.d.ts +10 -0
- package/dist/gcmads.js +33 -0
- package/dist/gcmads.js.map +1 -0
- package/dist/google-analytics-SSTM7QMW.js +37 -0
- package/dist/google-analytics-SSTM7QMW.js.map +1 -0
- package/dist/google-analytics.d.ts +14 -0
- package/dist/google-analytics.js +69 -0
- package/dist/google-analytics.js.map +1 -0
- package/dist/googleads-XPXUKIXQ.js +72 -0
- package/dist/googleads-XPXUKIXQ.js.map +1 -0
- package/dist/googleads.d.ts +14 -0
- package/dist/googleads.js +104 -0
- package/dist/googleads.js.map +1 -0
- package/dist/gtm-WFI6ABNK.js +25 -0
- package/dist/gtm-WFI6ABNK.js.map +1 -0
- package/dist/gtm.d.ts +13 -0
- package/dist/gtm.js +57 -0
- package/dist/gtm.js.map +1 -0
- package/dist/hotjar-YCFHYSKB.js +38 -0
- package/dist/hotjar-YCFHYSKB.js.map +1 -0
- package/dist/hotjar.d.ts +8 -0
- package/dist/hotjar.js +48 -0
- package/dist/hotjar.js.map +1 -0
- package/dist/hubspot-TLVPT4LG.js +31 -0
- package/dist/hubspot-TLVPT4LG.js.map +1 -0
- package/dist/hubspot.d.ts +8 -0
- package/dist/hubspot.js +63 -0
- package/dist/hubspot.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/intercom-4MUKJZOV.js +42 -0
- package/dist/intercom-4MUKJZOV.js.map +1 -0
- package/dist/intercom.d.ts +14 -0
- package/dist/intercom.js +52 -0
- package/dist/intercom.js.map +1 -0
- package/dist/linkedin-insight-EH5OICV7.js +40 -0
- package/dist/linkedin-insight-EH5OICV7.js.map +1 -0
- package/dist/linkedin-insight.d.ts +16 -0
- package/dist/linkedin-insight.js +50 -0
- package/dist/linkedin-insight.js.map +1 -0
- package/dist/matomo-H4JJCYJR.js +29 -0
- package/dist/matomo-H4JJCYJR.js.map +1 -0
- package/dist/matomo.d.ts +14 -0
- package/dist/matomo.js +39 -0
- package/dist/matomo.js.map +1 -0
- package/dist/meta-pixel-26NJ4GZJ.js +34 -0
- package/dist/meta-pixel-26NJ4GZJ.js.map +1 -0
- package/dist/meta-pixel.d.ts +19 -0
- package/dist/meta-pixel.js +66 -0
- package/dist/meta-pixel.js.map +1 -0
- package/dist/piano-analytics-CZXSQQNF.js +30 -0
- package/dist/piano-analytics-CZXSQQNF.js.map +1 -0
- package/dist/piano-analytics.d.ts +10 -0
- package/dist/piano-analytics.js +62 -0
- package/dist/piano-analytics.js.map +1 -0
- package/dist/pinterest-pixel-B7J3RCSI.js +31 -0
- package/dist/pinterest-pixel-B7J3RCSI.js.map +1 -0
- package/dist/pinterest-pixel.d.ts +16 -0
- package/dist/pinterest-pixel.js +63 -0
- package/dist/pinterest-pixel.js.map +1 -0
- package/dist/plausible-GI4L4SM4.js +25 -0
- package/dist/plausible-GI4L4SM4.js.map +1 -0
- package/dist/plausible.d.ts +11 -0
- package/dist/plausible.js +57 -0
- package/dist/plausible.js.map +1 -0
- package/dist/posthog-N2HG7XOO.js +32 -0
- package/dist/posthog-N2HG7XOO.js.map +1 -0
- package/dist/posthog.d.ts +9 -0
- package/dist/posthog.js +42 -0
- package/dist/posthog.js.map +1 -0
- package/dist/reddit-pixel-SKXRCFEF.js +34 -0
- package/dist/reddit-pixel-SKXRCFEF.js.map +1 -0
- package/dist/reddit-pixel.d.ts +16 -0
- package/dist/reddit-pixel.js +66 -0
- package/dist/reddit-pixel.js.map +1 -0
- package/dist/segment-GZJFC57W.js +66 -0
- package/dist/segment-GZJFC57W.js.map +1 -0
- package/dist/segment.d.ts +13 -0
- package/dist/segment.js +76 -0
- package/dist/segment.js.map +1 -0
- package/dist/sentry-UIBASRVZ.js +27 -0
- package/dist/sentry-UIBASRVZ.js.map +1 -0
- package/dist/sentry.d.ts +10 -0
- package/dist/sentry.js +59 -0
- package/dist/sentry.js.map +1 -0
- package/dist/smartsupp-I6XHQISS.js +27 -0
- package/dist/smartsupp-I6XHQISS.js.map +1 -0
- package/dist/smartsupp.d.ts +14 -0
- package/dist/smartsupp.js +37 -0
- package/dist/smartsupp.js.map +1 -0
- package/dist/snapchat-pixel-SYR3ZSSB.js +37 -0
- package/dist/snapchat-pixel-SYR3ZSSB.js.map +1 -0
- package/dist/snapchat-pixel.d.ts +15 -0
- package/dist/snapchat-pixel.js +47 -0
- package/dist/snapchat-pixel.js.map +1 -0
- package/dist/tiktok-pixel-FDGVKGOH.js +70 -0
- package/dist/tiktok-pixel-FDGVKGOH.js.map +1 -0
- package/dist/tiktok-pixel.d.ts +14 -0
- package/dist/tiktok-pixel.js +80 -0
- package/dist/tiktok-pixel.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { loadScript } from './chunk-6JXWYPMF.js';
|
|
2
|
+
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
|
|
4
|
+
// src/google-analytics.ts
|
|
5
|
+
var GoogleAnalytics = {
|
|
6
|
+
name: "Google Analytics",
|
|
7
|
+
category: "Analytics",
|
|
8
|
+
description: "Mesure l'audience et le comportement des visiteurs.",
|
|
9
|
+
...PURPOSE_ANALYTICS,
|
|
10
|
+
requireConsent: true,
|
|
11
|
+
setup: (config) => {
|
|
12
|
+
window.dataLayer = window.dataLayer || [];
|
|
13
|
+
window.gtag = function gtag(...args) {
|
|
14
|
+
window.dataLayer.push(args);
|
|
15
|
+
};
|
|
16
|
+
window.gtag("js", /* @__PURE__ */ new Date());
|
|
17
|
+
window.gtag("consent", "default", {
|
|
18
|
+
analytics_storage: "denied"
|
|
19
|
+
});
|
|
20
|
+
if (config?.measurementId) {
|
|
21
|
+
window.gtag("config", config.measurementId);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
init: (config) => {
|
|
25
|
+
if (!config?.measurementId) return;
|
|
26
|
+
loadScript(`https://www.googletagmanager.com/gtag/js?id=${config.measurementId}`).then(() => {
|
|
27
|
+
window.gtag?.("consent", "update", {
|
|
28
|
+
analytics_storage: "granted"
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var google_analytics_default = GoogleAnalytics;
|
|
34
|
+
|
|
35
|
+
export { google_analytics_default as default };
|
|
36
|
+
//# sourceMappingURL=google-analytics-SSTM7QMW.js.map
|
|
37
|
+
//# sourceMappingURL=google-analytics-SSTM7QMW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/google-analytics.ts"],"names":[],"mappings":";;;;AAeA,IAAM,eAAA,GAAiD;AAAA,EACrD,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,qDAAA;AAAA,EACb,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,KAAA,EAAO,CAAC,MAAA,KAAkC;AACxC,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,MAAA,CAAO,IAAA,GAAO,SAAS,IAAA,CAAA,GAAQ,IAAA,EAAiB;AAC9C,MAAA,MAAA,CAAO,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA,IAC5B,CAAA;AACA,IAAA,MAAA,CAAO,IAAA,CAAK,IAAA,kBAAM,IAAI,IAAA,EAAM,CAAA;AAC5B,IAAA,MAAA,CAAO,IAAA,CAAK,WAAW,SAAA,EAAW;AAAA,MAChC,iBAAA,EAAmB;AAAA,KACpB,CAAA;AACD,IAAA,IAAI,QAAQ,aAAA,EAAe;AACzB,MAAA,MAAA,CAAO,IAAA,CAAK,QAAA,EAAU,MAAA,CAAO,aAAa,CAAA;AAAA,IAC5C;AAAA,EACF,CAAA;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAAkC;AACvC,IAAA,IAAI,CAAC,QAAQ,aAAA,EAAe;AAC5B,IAAA,UAAA,CAAW,+CAA+C,MAAA,CAAO,aAAa,CAAA,CAAE,CAAA,CAAE,KAAK,MAAM;AAC3F,MAAA,MAAA,CAAO,IAAA,GAAO,WAAW,QAAA,EAAU;AAAA,QACjC,iBAAA,EAAmB;AAAA,OACpB,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AAEA,IAAO,wBAAA,GAAQ","file":"google-analytics-SSTM7QMW.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype GoogleAnalyticsConfig = {\n measurementId: string; // G-XXXXXXXX\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}\n\nconst GoogleAnalytics: Vendor<GoogleAnalyticsConfig> = {\n name: 'Google Analytics',\n category: 'Analytics',\n description: \"Mesure l'audience et le comportement des visiteurs.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n setup: (config: GoogleAnalyticsConfig) => {\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag(...args: unknown[]) {\n window.dataLayer.push(args);\n };\n window.gtag('js', new Date());\n window.gtag('consent', 'default', {\n analytics_storage: 'denied',\n });\n if (config?.measurementId) {\n window.gtag('config', config.measurementId);\n }\n },\n init: (config: GoogleAnalyticsConfig) => {\n if (!config?.measurementId) return;\n loadScript(`https://www.googletagmanager.com/gtag/js?id=${config.measurementId}`).then(() => {\n window.gtag?.('consent', 'update', {\n analytics_storage: 'granted',\n });\n });\n },\n};\n\nexport default GoogleAnalytics;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vendor } from '@modernconsent/core';
|
|
2
|
+
|
|
3
|
+
type GoogleAnalyticsConfig = {
|
|
4
|
+
measurementId: string;
|
|
5
|
+
};
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
dataLayer: any[];
|
|
9
|
+
gtag: (...args: any[]) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const GoogleAnalytics: Vendor<GoogleAnalyticsConfig>;
|
|
13
|
+
|
|
14
|
+
export { GoogleAnalytics as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/utils/loader.ts
|
|
2
|
+
function loadScript(src, callback, attrs = {}) {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
if (document.querySelector(`script[src="${src}"]`)) {
|
|
5
|
+
resolve();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const script = document.createElement("script");
|
|
9
|
+
script.src = src;
|
|
10
|
+
script.async = true;
|
|
11
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
12
|
+
script.setAttribute(key, value);
|
|
13
|
+
}
|
|
14
|
+
script.onload = () => {
|
|
15
|
+
resolve();
|
|
16
|
+
};
|
|
17
|
+
script.onerror = () => {
|
|
18
|
+
reject(new Error(`Failed to load script: ${src}`));
|
|
19
|
+
};
|
|
20
|
+
document.head.appendChild(script);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/utils/purposes.ts
|
|
25
|
+
var PURPOSE_ANALYTICS = {
|
|
26
|
+
purposeLabel: {
|
|
27
|
+
fr: "Analyse de session utilisateur et mesure d'audience",
|
|
28
|
+
en: "User session analysis and audience measurement"
|
|
29
|
+
},
|
|
30
|
+
purposeDescription: {
|
|
31
|
+
fr: "Ces cookies nous permettent d'\xE9tablir des statistiques et volumes de fr\xE9quentation et d'utilisation des \xE9l\xE9ments du site.",
|
|
32
|
+
en: "These cookies allow us to compile statistics on site traffic and usage."
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/google-analytics.ts
|
|
37
|
+
var GoogleAnalytics = {
|
|
38
|
+
name: "Google Analytics",
|
|
39
|
+
category: "Analytics",
|
|
40
|
+
description: "Mesure l'audience et le comportement des visiteurs.",
|
|
41
|
+
...PURPOSE_ANALYTICS,
|
|
42
|
+
requireConsent: true,
|
|
43
|
+
setup: (config) => {
|
|
44
|
+
window.dataLayer = window.dataLayer || [];
|
|
45
|
+
window.gtag = function gtag(...args) {
|
|
46
|
+
window.dataLayer.push(args);
|
|
47
|
+
};
|
|
48
|
+
window.gtag("js", /* @__PURE__ */ new Date());
|
|
49
|
+
window.gtag("consent", "default", {
|
|
50
|
+
analytics_storage: "denied"
|
|
51
|
+
});
|
|
52
|
+
if (config?.measurementId) {
|
|
53
|
+
window.gtag("config", config.measurementId);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
init: (config) => {
|
|
57
|
+
if (!config?.measurementId) return;
|
|
58
|
+
loadScript(`https://www.googletagmanager.com/gtag/js?id=${config.measurementId}`).then(() => {
|
|
59
|
+
window.gtag?.("consent", "update", {
|
|
60
|
+
analytics_storage: "granted"
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var google_analytics_default = GoogleAnalytics;
|
|
66
|
+
|
|
67
|
+
export { google_analytics_default as default };
|
|
68
|
+
//# sourceMappingURL=google-analytics.js.map
|
|
69
|
+
//# sourceMappingURL=google-analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/google-analytics.ts"],"names":[],"mappings":";AAAO,SAAS,UAAA,CACd,GAAA,EACA,QAAA,EACA,KAAA,GAAgC,EAAC,EAClB;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AAItC,IAAA,IAAI,QAAA,CAAS,aAAA,CAAc,CAAA,YAAA,EAAe,GAAG,IAAI,CAAA,EAAG;AAClD,MAAA,OAAA,EAAQ;AAER,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,IAAA,MAAA,CAAO,GAAA,GAAM,GAAA;AACb,IAAA,MAAA,CAAO,KAAA,GAAQ,IAAA;AAEf,IAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAAA,IAChC;AAEA,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,EAAQ;AACG,IACb,CAAA;AAEA,IAAA,MAAA,CAAO,UAAU,MAAM;AACrB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,uBAAA,EAA0B,GAAG,EAAE,CAAC,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,MAAM,CAAA;AAAA,EAClC,CAAC,CAAA;AACH;;;AC5BO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACCA,IAAM,eAAA,GAAiD;AAAA,EACrD,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,qDAAA;AAAA,EACb,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,KAAA,EAAO,CAAC,MAAA,KAAkC;AACxC,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,MAAA,CAAO,IAAA,GAAO,SAAS,IAAA,CAAA,GAAQ,IAAA,EAAiB;AAC9C,MAAA,MAAA,CAAO,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA,IAC5B,CAAA;AACA,IAAA,MAAA,CAAO,IAAA,CAAK,IAAA,kBAAM,IAAI,IAAA,EAAM,CAAA;AAC5B,IAAA,MAAA,CAAO,IAAA,CAAK,WAAW,SAAA,EAAW;AAAA,MAChC,iBAAA,EAAmB;AAAA,KACpB,CAAA;AACD,IAAA,IAAI,QAAQ,aAAA,EAAe;AACzB,MAAA,MAAA,CAAO,IAAA,CAAK,QAAA,EAAU,MAAA,CAAO,aAAa,CAAA;AAAA,IAC5C;AAAA,EACF,CAAA;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAAkC;AACvC,IAAA,IAAI,CAAC,QAAQ,aAAA,EAAe;AAC5B,IAAA,UAAA,CAAW,+CAA+C,MAAA,CAAO,aAAa,CAAA,CAAE,CAAA,CAAE,KAAK,MAAM;AAC3F,MAAA,MAAA,CAAO,IAAA,GAAO,WAAW,QAAA,EAAU;AAAA,QACjC,iBAAA,EAAmB;AAAA,OACpB,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AAEA,IAAO,wBAAA,GAAQ","file":"google-analytics.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n","/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype GoogleAnalyticsConfig = {\n measurementId: string; // G-XXXXXXXX\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}\n\nconst GoogleAnalytics: Vendor<GoogleAnalyticsConfig> = {\n name: 'Google Analytics',\n category: 'Analytics',\n description: \"Mesure l'audience et le comportement des visiteurs.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n setup: (config: GoogleAnalyticsConfig) => {\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag(...args: unknown[]) {\n window.dataLayer.push(args);\n };\n window.gtag('js', new Date());\n window.gtag('consent', 'default', {\n analytics_storage: 'denied',\n });\n if (config?.measurementId) {\n window.gtag('config', config.measurementId);\n }\n },\n init: (config: GoogleAnalyticsConfig) => {\n if (!config?.measurementId) return;\n loadScript(`https://www.googletagmanager.com/gtag/js?id=${config.measurementId}`).then(() => {\n window.gtag?.('consent', 'update', {\n analytics_storage: 'granted',\n });\n });\n },\n};\n\nexport default GoogleAnalytics;\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { loadScript } from './chunk-6JXWYPMF.js';
|
|
2
|
+
import { PURPOSE_ADS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
|
|
4
|
+
// src/googleads.ts
|
|
5
|
+
var GoogleAds = {
|
|
6
|
+
name: "Google Ads",
|
|
7
|
+
category: "Publicit\xE9",
|
|
8
|
+
description: "Analyse l'audience du site web.",
|
|
9
|
+
...PURPOSE_ADS,
|
|
10
|
+
requireConsent: true,
|
|
11
|
+
artifacts: (option) => {
|
|
12
|
+
let tagUaCookie = "_gat_gtag_" + option.tagId, tagGCookie = "_ga_" + option.tagId;
|
|
13
|
+
tagUaCookie = tagUaCookie.replace(/-/g, "_");
|
|
14
|
+
tagGCookie = tagGCookie.replace(/G-/g, "");
|
|
15
|
+
return [
|
|
16
|
+
"_ga",
|
|
17
|
+
"_gat",
|
|
18
|
+
"_gid",
|
|
19
|
+
"__utma",
|
|
20
|
+
"__utmb",
|
|
21
|
+
"__utmc",
|
|
22
|
+
"__utmt",
|
|
23
|
+
"__utmz",
|
|
24
|
+
tagUaCookie,
|
|
25
|
+
tagGCookie,
|
|
26
|
+
"_gcl_au"
|
|
27
|
+
];
|
|
28
|
+
},
|
|
29
|
+
setup: (option) => {
|
|
30
|
+
window.dataLayer = window.dataLayer || [];
|
|
31
|
+
window.gtag = function gtag(...args) {
|
|
32
|
+
window.dataLayer.push(args);
|
|
33
|
+
};
|
|
34
|
+
window.gtag("js", /* @__PURE__ */ new Date());
|
|
35
|
+
window.gtag("config", option.tagId);
|
|
36
|
+
window.gtag("consent", "default", {
|
|
37
|
+
ad_storage: "denied",
|
|
38
|
+
analytics_storage: "denied"
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
init: (option) => {
|
|
42
|
+
if (option.tagId === void 0) return;
|
|
43
|
+
window.dataLayer = window.dataLayer || [];
|
|
44
|
+
loadScript(`https://www.googletagmanager.com/gtag/js?id=${option.tagId}`).then(() => {
|
|
45
|
+
window.gtag?.("consent", "update", {
|
|
46
|
+
ad_storage: "granted"
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
event: [
|
|
51
|
+
{
|
|
52
|
+
name: "onAccept",
|
|
53
|
+
callback: () => {
|
|
54
|
+
window.dataLayer.push({
|
|
55
|
+
event: "modern_consent_accept",
|
|
56
|
+
service: "google_ads"
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
link: [
|
|
62
|
+
{
|
|
63
|
+
vendor: "gcmads",
|
|
64
|
+
condition: ({ consentConfig }) => consentConfig.consentMode === true
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
};
|
|
68
|
+
var googleads_default = GoogleAds;
|
|
69
|
+
|
|
70
|
+
export { googleads_default as default };
|
|
71
|
+
//# sourceMappingURL=googleads-XPXUKIXQ.js.map
|
|
72
|
+
//# sourceMappingURL=googleads-XPXUKIXQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/googleads.ts"],"names":[],"mappings":";;;;AAeA,IAAM,SAAA,GAAqC;AAAA,EACzC,IAAA,EAAM,YAAA;AAAA,EACN,QAAA,EAAU,cAAA;AAAA,EACV,WAAA,EAAa,iCAAA;AAAA,EACb,GAAG,WAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW,CAAC,MAAA,KAA4B;AACtC,IAAA,IAAI,cAAc,YAAA,GAAe,MAAA,CAAO,KAAA,EACtC,UAAA,GAAa,SAAS,MAAA,CAAO,KAAA;AAC/B,IAAA,WAAA,GAAc,WAAA,CAAY,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA;AAC3C,IAAA,UAAA,GAAa,UAAA,CAAW,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AACzC,IAAA,OAAO;AAAA,MACL,KAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF,CAAA;AAAA,EACA,KAAA,EAAO,CAAC,MAAA,KAA4B;AAClC,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,MAAA,CAAO,IAAA,GAAO,SAAS,IAAA,CAAA,GAAQ,IAAA,EAAiB;AAC9C,MAAA,MAAA,CAAO,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA,IAC5B,CAAA;AACA,IAAA,MAAA,CAAO,IAAA,CAAK,IAAA,kBAAM,IAAI,IAAA,EAAM,CAAA;AAC5B,IAAA,MAAA,CAAO,IAAA,CAAK,QAAA,EAAU,MAAA,CAAO,KAAK,CAAA;AAElC,IAAA,MAAA,CAAO,IAAA,CAAK,WAAW,SAAA,EAAW;AAAA,MAChC,UAAA,EAAY,QAAA;AAAA,MACZ,iBAAA,EAAmB;AAAA,KACpB,CAAA;AAAA,EACH,CAAA;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAA4B;AACjC,IAAA,IAAI,MAAA,CAAO,UAAU,MAAA,EAAW;AAChC,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,UAAA,CAAW,+CAA+C,MAAA,CAAO,KAAK,CAAA,CAAE,CAAA,CAAE,KAAK,MAAM;AACnF,MAAA,MAAA,CAAO,IAAA,GAAO,WAAW,QAAA,EAAU;AAAA,QACjC,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH,CAAC,CAAA;AAAA,EACH,CAAA;AAAA,EACA,KAAA,EAAO;AAAA,IACL;AAAA,MACE,IAAA,EAAM,UAAA;AAAA,MACN,UAAU,MAAM;AACd,QAAA,MAAA,CAAO,UAAU,IAAA,CAAK;AAAA,UACpB,KAAA,EAAO,uBAAA;AAAA,UACP,OAAA,EAAS;AAAA,SACV,CAAA;AAAA,MACH;AAAA;AACF,GACF;AAAA,EACA,IAAA,EAAM;AAAA,IACJ;AAAA,MACE,MAAA,EAAQ,QAAA;AAAA,MACR,WAAW,CAAC,EAAE,aAAA,EAAc,KAA8B,cAAc,WAAA,KAAgB;AAAA;AAC1F;AAEJ,CAAA;AAEA,IAAO,iBAAA,GAAQ","file":"googleads-XPXUKIXQ.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ADS } from './utils/purposes';\n\ntype GoogleAdsOption = {\n tagId: string;\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}\n\nconst GoogleAds: Vendor<GoogleAdsOption> = {\n name: 'Google Ads',\n category: 'Publicité',\n description: \"Analyse l'audience du site web.\",\n ...PURPOSE_ADS,\n requireConsent: true,\n artifacts: (option: GoogleAdsOption) => {\n let tagUaCookie = '_gat_gtag_' + option.tagId,\n tagGCookie = '_ga_' + option.tagId;\n tagUaCookie = tagUaCookie.replace(/-/g, '_');\n tagGCookie = tagGCookie.replace(/G-/g, '');\n return [\n '_ga',\n '_gat',\n '_gid',\n '__utma',\n '__utmb',\n '__utmc',\n '__utmt',\n '__utmz',\n tagUaCookie,\n tagGCookie,\n '_gcl_au',\n ];\n },\n setup: (option: GoogleAdsOption) => {\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag(...args: unknown[]) {\n window.dataLayer.push(args);\n };\n window.gtag('js', new Date());\n window.gtag('config', option.tagId);\n\n window.gtag('consent', 'default', {\n ad_storage: 'denied',\n analytics_storage: 'denied',\n });\n },\n init: (option: GoogleAdsOption) => {\n if (option.tagId === undefined) return;\n window.dataLayer = window.dataLayer || [];\n loadScript(`https://www.googletagmanager.com/gtag/js?id=${option.tagId}`).then(() => {\n window.gtag?.('consent', 'update', {\n ad_storage: 'granted',\n });\n });\n },\n event: [\n {\n name: 'onAccept',\n callback: () => {\n window.dataLayer.push({\n event: 'modern_consent_accept',\n service: 'google_ads',\n });\n },\n },\n ],\n link: [\n {\n vendor: 'gcmads',\n condition: ({ consentConfig }: { consentConfig: any }) => consentConfig.consentMode === true,\n },\n ],\n};\n\nexport default GoogleAds;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Vendor } from '@modernconsent/core';
|
|
2
|
+
|
|
3
|
+
type GoogleAdsOption = {
|
|
4
|
+
tagId: string;
|
|
5
|
+
};
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
dataLayer: any[];
|
|
9
|
+
gtag: (...args: any[]) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const GoogleAds: Vendor<GoogleAdsOption>;
|
|
13
|
+
|
|
14
|
+
export { GoogleAds as default };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// src/utils/loader.ts
|
|
2
|
+
function loadScript(src, callback, attrs = {}) {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
if (document.querySelector(`script[src="${src}"]`)) {
|
|
5
|
+
resolve();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const script = document.createElement("script");
|
|
9
|
+
script.src = src;
|
|
10
|
+
script.async = true;
|
|
11
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
12
|
+
script.setAttribute(key, value);
|
|
13
|
+
}
|
|
14
|
+
script.onload = () => {
|
|
15
|
+
resolve();
|
|
16
|
+
};
|
|
17
|
+
script.onerror = () => {
|
|
18
|
+
reject(new Error(`Failed to load script: ${src}`));
|
|
19
|
+
};
|
|
20
|
+
document.head.appendChild(script);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/utils/purposes.ts
|
|
25
|
+
var PURPOSE_ADS = {
|
|
26
|
+
purposeLabel: {
|
|
27
|
+
fr: "Ciblage publicitaire",
|
|
28
|
+
en: "Advertising targeting"
|
|
29
|
+
},
|
|
30
|
+
purposeDescription: {
|
|
31
|
+
fr: "Ces cookies sont utilis\xE9s pour vous proposer des publicit\xE9s personnalis\xE9es en fonction de votre navigation.",
|
|
32
|
+
en: "These cookies are used to deliver personalized ads based on your browsing behavior."
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/googleads.ts
|
|
37
|
+
var GoogleAds = {
|
|
38
|
+
name: "Google Ads",
|
|
39
|
+
category: "Publicit\xE9",
|
|
40
|
+
description: "Analyse l'audience du site web.",
|
|
41
|
+
...PURPOSE_ADS,
|
|
42
|
+
requireConsent: true,
|
|
43
|
+
artifacts: (option) => {
|
|
44
|
+
let tagUaCookie = "_gat_gtag_" + option.tagId, tagGCookie = "_ga_" + option.tagId;
|
|
45
|
+
tagUaCookie = tagUaCookie.replace(/-/g, "_");
|
|
46
|
+
tagGCookie = tagGCookie.replace(/G-/g, "");
|
|
47
|
+
return [
|
|
48
|
+
"_ga",
|
|
49
|
+
"_gat",
|
|
50
|
+
"_gid",
|
|
51
|
+
"__utma",
|
|
52
|
+
"__utmb",
|
|
53
|
+
"__utmc",
|
|
54
|
+
"__utmt",
|
|
55
|
+
"__utmz",
|
|
56
|
+
tagUaCookie,
|
|
57
|
+
tagGCookie,
|
|
58
|
+
"_gcl_au"
|
|
59
|
+
];
|
|
60
|
+
},
|
|
61
|
+
setup: (option) => {
|
|
62
|
+
window.dataLayer = window.dataLayer || [];
|
|
63
|
+
window.gtag = function gtag(...args) {
|
|
64
|
+
window.dataLayer.push(args);
|
|
65
|
+
};
|
|
66
|
+
window.gtag("js", /* @__PURE__ */ new Date());
|
|
67
|
+
window.gtag("config", option.tagId);
|
|
68
|
+
window.gtag("consent", "default", {
|
|
69
|
+
ad_storage: "denied",
|
|
70
|
+
analytics_storage: "denied"
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
init: (option) => {
|
|
74
|
+
if (option.tagId === void 0) return;
|
|
75
|
+
window.dataLayer = window.dataLayer || [];
|
|
76
|
+
loadScript(`https://www.googletagmanager.com/gtag/js?id=${option.tagId}`).then(() => {
|
|
77
|
+
window.gtag?.("consent", "update", {
|
|
78
|
+
ad_storage: "granted"
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
event: [
|
|
83
|
+
{
|
|
84
|
+
name: "onAccept",
|
|
85
|
+
callback: () => {
|
|
86
|
+
window.dataLayer.push({
|
|
87
|
+
event: "modern_consent_accept",
|
|
88
|
+
service: "google_ads"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
link: [
|
|
94
|
+
{
|
|
95
|
+
vendor: "gcmads",
|
|
96
|
+
condition: ({ consentConfig }) => consentConfig.consentMode === true
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
var googleads_default = GoogleAds;
|
|
101
|
+
|
|
102
|
+
export { googleads_default as default };
|
|
103
|
+
//# sourceMappingURL=googleads.js.map
|
|
104
|
+
//# sourceMappingURL=googleads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/googleads.ts"],"names":[],"mappings":"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","file":"googleads.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n","/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ADS } from './utils/purposes';\n\ntype GoogleAdsOption = {\n tagId: string;\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n gtag: (...args: any[]) => void;\n }\n}\n\nconst GoogleAds: Vendor<GoogleAdsOption> = {\n name: 'Google Ads',\n category: 'Publicité',\n description: \"Analyse l'audience du site web.\",\n ...PURPOSE_ADS,\n requireConsent: true,\n artifacts: (option: GoogleAdsOption) => {\n let tagUaCookie = '_gat_gtag_' + option.tagId,\n tagGCookie = '_ga_' + option.tagId;\n tagUaCookie = tagUaCookie.replace(/-/g, '_');\n tagGCookie = tagGCookie.replace(/G-/g, '');\n return [\n '_ga',\n '_gat',\n '_gid',\n '__utma',\n '__utmb',\n '__utmc',\n '__utmt',\n '__utmz',\n tagUaCookie,\n tagGCookie,\n '_gcl_au',\n ];\n },\n setup: (option: GoogleAdsOption) => {\n window.dataLayer = window.dataLayer || [];\n window.gtag = function gtag(...args: unknown[]) {\n window.dataLayer.push(args);\n };\n window.gtag('js', new Date());\n window.gtag('config', option.tagId);\n\n window.gtag('consent', 'default', {\n ad_storage: 'denied',\n analytics_storage: 'denied',\n });\n },\n init: (option: GoogleAdsOption) => {\n if (option.tagId === undefined) return;\n window.dataLayer = window.dataLayer || [];\n loadScript(`https://www.googletagmanager.com/gtag/js?id=${option.tagId}`).then(() => {\n window.gtag?.('consent', 'update', {\n ad_storage: 'granted',\n });\n });\n },\n event: [\n {\n name: 'onAccept',\n callback: () => {\n window.dataLayer.push({\n event: 'modern_consent_accept',\n service: 'google_ads',\n });\n },\n },\n ],\n link: [\n {\n vendor: 'gcmads',\n condition: ({ consentConfig }: { consentConfig: any }) => consentConfig.consentMode === true,\n },\n ],\n};\n\nexport default GoogleAds;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { loadScript } from './chunk-6JXWYPMF.js';
|
|
2
|
+
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
|
|
4
|
+
// src/gtm.ts
|
|
5
|
+
var GTM = {
|
|
6
|
+
name: "Google Tag Manager",
|
|
7
|
+
category: "Analytics",
|
|
8
|
+
description: "Gestionnaire de balises permettant de d\xE9ployer et g\xE9rer des scripts tiers.",
|
|
9
|
+
...PURPOSE_ANALYTICS,
|
|
10
|
+
requireConsent: true,
|
|
11
|
+
init: (config) => {
|
|
12
|
+
if (!config?.containerId) return;
|
|
13
|
+
window.dataLayer = window.dataLayer || [];
|
|
14
|
+
window.dataLayer.push({
|
|
15
|
+
"gtm.start": (/* @__PURE__ */ new Date()).getTime(),
|
|
16
|
+
event: "gtm.js"
|
|
17
|
+
});
|
|
18
|
+
loadScript(`https://www.googletagmanager.com/gtm.js?id=${config.containerId}`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var gtm_default = GTM;
|
|
22
|
+
|
|
23
|
+
export { gtm_default as default };
|
|
24
|
+
//# sourceMappingURL=gtm-WFI6ABNK.js.map
|
|
25
|
+
//# sourceMappingURL=gtm-WFI6ABNK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gtm.ts"],"names":[],"mappings":";;;;AAcA,IAAM,GAAA,GAAyB;AAAA,EAC7B,IAAA,EAAM,oBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,kFAAA;AAAA,EACb,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,IAAA,EAAM,CAAC,MAAA,KAAsB;AAC3B,IAAA,IAAI,CAAC,QAAQ,WAAA,EAAa;AAE1B,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,MAAA,CAAO,UAAU,IAAA,CAAK;AAAA,MACpB,WAAA,EAAA,iBAAa,IAAI,IAAA,EAAK,EAAE,OAAA,EAAQ;AAAA,MAChC,KAAA,EAAO;AAAA,KACR,CAAA;AAED,IAAA,UAAA,CAAW,CAAA,2CAAA,EAA8C,MAAA,CAAO,WAAW,CAAA,CAAE,CAAA;AAAA,EAC/E;AACF,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"gtm-WFI6ABNK.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype GTMConfig = {\n containerId: string; // GTM-XXXXXXX\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n }\n}\n\nconst GTM: Vendor<GTMConfig> = {\n name: 'Google Tag Manager',\n category: 'Analytics',\n description: 'Gestionnaire de balises permettant de déployer et gérer des scripts tiers.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n init: (config: GTMConfig) => {\n if (!config?.containerId) return;\n\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js',\n });\n\n loadScript(`https://www.googletagmanager.com/gtm.js?id=${config.containerId}`);\n },\n};\n\nexport default GTM;\n"]}
|
package/dist/gtm.d.ts
ADDED
package/dist/gtm.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/utils/loader.ts
|
|
2
|
+
function loadScript(src, callback, attrs = {}) {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
if (document.querySelector(`script[src="${src}"]`)) {
|
|
5
|
+
resolve();
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const script = document.createElement("script");
|
|
9
|
+
script.src = src;
|
|
10
|
+
script.async = true;
|
|
11
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
12
|
+
script.setAttribute(key, value);
|
|
13
|
+
}
|
|
14
|
+
script.onload = () => {
|
|
15
|
+
resolve();
|
|
16
|
+
};
|
|
17
|
+
script.onerror = () => {
|
|
18
|
+
reject(new Error(`Failed to load script: ${src}`));
|
|
19
|
+
};
|
|
20
|
+
document.head.appendChild(script);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/utils/purposes.ts
|
|
25
|
+
var PURPOSE_ANALYTICS = {
|
|
26
|
+
purposeLabel: {
|
|
27
|
+
fr: "Analyse de session utilisateur et mesure d'audience",
|
|
28
|
+
en: "User session analysis and audience measurement"
|
|
29
|
+
},
|
|
30
|
+
purposeDescription: {
|
|
31
|
+
fr: "Ces cookies nous permettent d'\xE9tablir des statistiques et volumes de fr\xE9quentation et d'utilisation des \xE9l\xE9ments du site.",
|
|
32
|
+
en: "These cookies allow us to compile statistics on site traffic and usage."
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/gtm.ts
|
|
37
|
+
var GTM = {
|
|
38
|
+
name: "Google Tag Manager",
|
|
39
|
+
category: "Analytics",
|
|
40
|
+
description: "Gestionnaire de balises permettant de d\xE9ployer et g\xE9rer des scripts tiers.",
|
|
41
|
+
...PURPOSE_ANALYTICS,
|
|
42
|
+
requireConsent: true,
|
|
43
|
+
init: (config) => {
|
|
44
|
+
if (!config?.containerId) return;
|
|
45
|
+
window.dataLayer = window.dataLayer || [];
|
|
46
|
+
window.dataLayer.push({
|
|
47
|
+
"gtm.start": (/* @__PURE__ */ new Date()).getTime(),
|
|
48
|
+
event: "gtm.js"
|
|
49
|
+
});
|
|
50
|
+
loadScript(`https://www.googletagmanager.com/gtm.js?id=${config.containerId}`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var gtm_default = GTM;
|
|
54
|
+
|
|
55
|
+
export { gtm_default as default };
|
|
56
|
+
//# sourceMappingURL=gtm.js.map
|
|
57
|
+
//# sourceMappingURL=gtm.js.map
|
package/dist/gtm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/loader.ts","../src/utils/purposes.ts","../src/gtm.ts"],"names":[],"mappings":";AAAO,SAAS,UAAA,CACd,GAAA,EACA,QAAA,EACA,KAAA,GAAgC,EAAC,EAClB;AACf,EAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,OAAA,EAAS,MAAA,KAAW;AAItC,IAAA,IAAI,QAAA,CAAS,aAAA,CAAc,CAAA,YAAA,EAAe,GAAG,IAAI,CAAA,EAAG;AAClD,MAAA,OAAA,EAAQ;AAER,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,MAAA,GAAS,QAAA,CAAS,aAAA,CAAc,QAAQ,CAAA;AAC9C,IAAA,MAAA,CAAO,GAAA,GAAM,GAAA;AACb,IAAA,MAAA,CAAO,KAAA,GAAQ,IAAA;AAEf,IAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,MAAA,MAAA,CAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAAA,IAChC;AAEA,IAAA,MAAA,CAAO,SAAS,MAAM;AACpB,MAAA,OAAA,EAAQ;AACG,IACb,CAAA;AAEA,IAAA,MAAA,CAAO,UAAU,MAAM;AACrB,MAAA,MAAA,CAAO,IAAI,KAAA,CAAM,CAAA,uBAAA,EAA0B,GAAG,EAAE,CAAC,CAAA;AAAA,IACnD,CAAA;AACA,IAAA,QAAA,CAAS,IAAA,CAAK,YAAY,MAAM,CAAA;AAAA,EAClC,CAAC,CAAA;AACH;;;AC5BO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACAA,IAAM,GAAA,GAAyB;AAAA,EAC7B,IAAA,EAAM,oBAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,kFAAA;AAAA,EACb,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,IAAA,EAAM,CAAC,MAAA,KAAsB;AAC3B,IAAA,IAAI,CAAC,QAAQ,WAAA,EAAa;AAE1B,IAAA,MAAA,CAAO,SAAA,GAAY,MAAA,CAAO,SAAA,IAAa,EAAC;AACxC,IAAA,MAAA,CAAO,UAAU,IAAA,CAAK;AAAA,MACpB,WAAA,EAAA,iBAAa,IAAI,IAAA,EAAK,EAAE,OAAA,EAAQ;AAAA,MAChC,KAAA,EAAO;AAAA,KACR,CAAA;AAED,IAAA,UAAA,CAAW,CAAA,2CAAA,EAA8C,MAAA,CAAO,WAAW,CAAA,CAAE,CAAA;AAAA,EAC/E;AACF,CAAA;AAEA,IAAO,WAAA,GAAQ","file":"gtm.js","sourcesContent":["export function loadScript(\n src: string,\n callback?: () => void,\n attrs: Record<string, string> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n /**\n * check if already loaded.\n */\n if (document.querySelector(`script[src=\"${src}\"]`)) {\n resolve();\n callback?.();\n return;\n }\n\n const script = document.createElement('script');\n script.src = src;\n script.async = true;\n\n for (const [key, value] of Object.entries(attrs)) {\n script.setAttribute(key, value);\n }\n\n script.onload = () => {\n resolve();\n callback?.();\n };\n\n script.onerror = () => {\n reject(new Error(`Failed to load script: ${src}`));\n };\n document.head.appendChild(script);\n });\n}\n","/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype GTMConfig = {\n containerId: string; // GTM-XXXXXXX\n};\n\ndeclare global {\n interface Window {\n dataLayer: any[];\n }\n}\n\nconst GTM: Vendor<GTMConfig> = {\n name: 'Google Tag Manager',\n category: 'Analytics',\n description: 'Gestionnaire de balises permettant de déployer et gérer des scripts tiers.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n init: (config: GTMConfig) => {\n if (!config?.containerId) return;\n\n window.dataLayer = window.dataLayer || [];\n window.dataLayer.push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js',\n });\n\n loadScript(`https://www.googletagmanager.com/gtm.js?id=${config.containerId}`);\n },\n};\n\nexport default GTM;\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
2
|
+
|
|
3
|
+
// src/hotjar.ts
|
|
4
|
+
var Hotjar = {
|
|
5
|
+
name: "Hotjar",
|
|
6
|
+
category: "Analytics",
|
|
7
|
+
description: "Cartes de chaleur, enregistrements de sessions et sondages pour optimiser l'exp\xE9rience utilisateur.",
|
|
8
|
+
...PURPOSE_ANALYTICS,
|
|
9
|
+
requireConsent: true,
|
|
10
|
+
artifacts: [
|
|
11
|
+
"_hj",
|
|
12
|
+
"_hjSession",
|
|
13
|
+
"_hjSessionUser",
|
|
14
|
+
"_hjid",
|
|
15
|
+
"_hjFirstSeen",
|
|
16
|
+
"_hjAbsoluteSessionInProgress",
|
|
17
|
+
"_hjIncludedInSessionSample"
|
|
18
|
+
],
|
|
19
|
+
init: (config) => {
|
|
20
|
+
if (!config?.siteId) return;
|
|
21
|
+
(function(h, o, t, j) {
|
|
22
|
+
h.hj = h.hj || function(...args) {
|
|
23
|
+
(h.hj.q = h.hj.q || []).push(args);
|
|
24
|
+
};
|
|
25
|
+
h._hjSettings = { hjid: config.siteId, hjsv: 6 };
|
|
26
|
+
const a = o.getElementsByTagName("head")[0];
|
|
27
|
+
const r = o.createElement("script");
|
|
28
|
+
r.async = true;
|
|
29
|
+
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
|
|
30
|
+
a.appendChild(r);
|
|
31
|
+
})(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv=");
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var hotjar_default = Hotjar;
|
|
35
|
+
|
|
36
|
+
export { hotjar_default as default };
|
|
37
|
+
//# sourceMappingURL=hotjar-YCFHYSKB.js.map
|
|
38
|
+
//# sourceMappingURL=hotjar-YCFHYSKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hotjar.ts"],"names":[],"mappings":";;;AAOA,IAAM,MAAA,GAA+B;AAAA,EACnC,IAAA,EAAM,QAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EACE,wGAAA;AAAA,EACF,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW;AAAA,IACT,KAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAAyB;AAC9B,IAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AAErB,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAa,CAAA,EAAW,CAAA,EAAW;AACpD,MAAA,CAAA,CAAE,EAAA,GACA,CAAA,CAAE,EAAA,IACF,SAAA,GAAa,IAAA,EAAa;AACxB,QAAA,CAAC,CAAA,CAAE,GAAG,CAAA,GAAI,CAAA,CAAE,GAAG,CAAA,IAAK,EAAC,EAAG,IAAA,CAAK,IAAI,CAAA;AAAA,MACnC,CAAA;AACF,MAAA,CAAA,CAAE,cAAc,EAAE,IAAA,EAAM,MAAA,CAAO,MAAA,EAAQ,MAAM,CAAA,EAAE;AAC/C,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,oBAAA,CAAqB,MAAM,EAAE,CAAC,CAAA;AAC1C,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,aAAA,CAAc,QAAQ,CAAA;AAClC,MAAA,CAAA,CAAE,KAAA,GAAQ,IAAA;AACV,MAAA,CAAA,CAAE,MAAM,CAAA,GAAI,CAAA,CAAE,YAAY,IAAA,GAAO,CAAA,GAAI,EAAE,WAAA,CAAY,IAAA;AACnD,MAAA,CAAA,CAAE,YAAY,CAAC,CAAA;AAAA,IACjB,CAAA,EAAG,MAAA,EAAQ,QAAA,EAAU,qCAAA,EAAuC,SAAS,CAAA;AAAA,EACvE;AACF,CAAA;AAEA,IAAO,cAAA,GAAQ","file":"hotjar-YCFHYSKB.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype HotjarConfig = {\n siteId: string;\n};\n\nconst Hotjar: Vendor<HotjarConfig> = {\n name: 'Hotjar',\n category: 'Analytics',\n description:\n \"Cartes de chaleur, enregistrements de sessions et sondages pour optimiser l'expérience utilisateur.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: [\n '_hj',\n '_hjSession',\n '_hjSessionUser',\n '_hjid',\n '_hjFirstSeen',\n '_hjAbsoluteSessionInProgress',\n '_hjIncludedInSessionSample',\n ],\n init: (config: HotjarConfig) => {\n if (!config?.siteId) return;\n\n (function (h: any, o: Document, t: string, j: string) {\n h.hj =\n h.hj ||\n function (...args: any[]) {\n (h.hj.q = h.hj.q || []).push(args);\n };\n h._hjSettings = { hjid: config.siteId, hjsv: 6 };\n const a = o.getElementsByTagName('head')[0];\n const r = o.createElement('script') as HTMLScriptElement;\n r.async = true;\n r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;\n a.appendChild(r);\n })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');\n },\n};\n\nexport default Hotjar;\n"]}
|
package/dist/hotjar.d.ts
ADDED
package/dist/hotjar.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/utils/purposes.ts
|
|
2
|
+
var PURPOSE_ANALYTICS = {
|
|
3
|
+
purposeLabel: {
|
|
4
|
+
fr: "Analyse de session utilisateur et mesure d'audience",
|
|
5
|
+
en: "User session analysis and audience measurement"
|
|
6
|
+
},
|
|
7
|
+
purposeDescription: {
|
|
8
|
+
fr: "Ces cookies nous permettent d'\xE9tablir des statistiques et volumes de fr\xE9quentation et d'utilisation des \xE9l\xE9ments du site.",
|
|
9
|
+
en: "These cookies allow us to compile statistics on site traffic and usage."
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/hotjar.ts
|
|
14
|
+
var Hotjar = {
|
|
15
|
+
name: "Hotjar",
|
|
16
|
+
category: "Analytics",
|
|
17
|
+
description: "Cartes de chaleur, enregistrements de sessions et sondages pour optimiser l'exp\xE9rience utilisateur.",
|
|
18
|
+
...PURPOSE_ANALYTICS,
|
|
19
|
+
requireConsent: true,
|
|
20
|
+
artifacts: [
|
|
21
|
+
"_hj",
|
|
22
|
+
"_hjSession",
|
|
23
|
+
"_hjSessionUser",
|
|
24
|
+
"_hjid",
|
|
25
|
+
"_hjFirstSeen",
|
|
26
|
+
"_hjAbsoluteSessionInProgress",
|
|
27
|
+
"_hjIncludedInSessionSample"
|
|
28
|
+
],
|
|
29
|
+
init: (config) => {
|
|
30
|
+
if (!config?.siteId) return;
|
|
31
|
+
(function(h, o, t, j) {
|
|
32
|
+
h.hj = h.hj || function(...args) {
|
|
33
|
+
(h.hj.q = h.hj.q || []).push(args);
|
|
34
|
+
};
|
|
35
|
+
h._hjSettings = { hjid: config.siteId, hjsv: 6 };
|
|
36
|
+
const a = o.getElementsByTagName("head")[0];
|
|
37
|
+
const r = o.createElement("script");
|
|
38
|
+
r.async = true;
|
|
39
|
+
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
|
|
40
|
+
a.appendChild(r);
|
|
41
|
+
})(window, document, "https://static.hotjar.com/c/hotjar-", ".js?sv=");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var hotjar_default = Hotjar;
|
|
45
|
+
|
|
46
|
+
export { hotjar_default as default };
|
|
47
|
+
//# sourceMappingURL=hotjar.js.map
|
|
48
|
+
//# sourceMappingURL=hotjar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/purposes.ts","../src/hotjar.ts"],"names":[],"mappings":";AAKO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,YAAA,EAAc;AAAA,IACZ,EAAA,EAAI,qDAAA;AAAA,IACJ,EAAA,EAAI;AAAA,GACN;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,EAAA,EAAI,uIAAA;AAAA,IACJ,EAAA,EAAI;AAAA;AAER,CAAA;;;ACPA,IAAM,MAAA,GAA+B;AAAA,EACnC,IAAA,EAAM,QAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EACE,wGAAA;AAAA,EACF,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW;AAAA,IACT,KAAA;AAAA,IACA,YAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,cAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAAyB;AAC9B,IAAA,IAAI,CAAC,QAAQ,MAAA,EAAQ;AAErB,IAAA,CAAC,SAAU,CAAA,EAAQ,CAAA,EAAa,CAAA,EAAW,CAAA,EAAW;AACpD,MAAA,CAAA,CAAE,EAAA,GACA,CAAA,CAAE,EAAA,IACF,SAAA,GAAa,IAAA,EAAa;AACxB,QAAA,CAAC,CAAA,CAAE,GAAG,CAAA,GAAI,CAAA,CAAE,GAAG,CAAA,IAAK,EAAC,EAAG,IAAA,CAAK,IAAI,CAAA;AAAA,MACnC,CAAA;AACF,MAAA,CAAA,CAAE,cAAc,EAAE,IAAA,EAAM,MAAA,CAAO,MAAA,EAAQ,MAAM,CAAA,EAAE;AAC/C,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,oBAAA,CAAqB,MAAM,EAAE,CAAC,CAAA;AAC1C,MAAA,MAAM,CAAA,GAAI,CAAA,CAAE,aAAA,CAAc,QAAQ,CAAA;AAClC,MAAA,CAAA,CAAE,KAAA,GAAQ,IAAA;AACV,MAAA,CAAA,CAAE,MAAM,CAAA,GAAI,CAAA,CAAE,YAAY,IAAA,GAAO,CAAA,GAAI,EAAE,WAAA,CAAY,IAAA;AACnD,MAAA,CAAA,CAAE,YAAY,CAAC,CAAA;AAAA,IACjB,CAAA,EAAG,MAAA,EAAQ,QAAA,EAAU,qCAAA,EAAuC,SAAS,CAAA;AAAA,EACvE;AACF,CAAA;AAEA,IAAO,cAAA,GAAQ","file":"hotjar.js","sourcesContent":["/**\n * Shared purpose labels and descriptions for built-in vendors.\n * Imported by each vendor — inlined at build time by tsup (zero runtime overhead).\n */\n\nexport const PURPOSE_ANALYTICS = {\n purposeLabel: {\n fr: \"Analyse de session utilisateur et mesure d'audience\",\n en: 'User session analysis and audience measurement',\n },\n purposeDescription: {\n fr: \"Ces cookies nous permettent d'établir des statistiques et volumes de fréquentation et d'utilisation des éléments du site.\",\n en: 'These cookies allow us to compile statistics on site traffic and usage.',\n },\n} as const;\n\nexport const PURPOSE_ADS = {\n purposeLabel: {\n fr: 'Ciblage publicitaire',\n en: 'Advertising targeting',\n },\n purposeDescription: {\n fr: 'Ces cookies sont utilisés pour vous proposer des publicités personnalisées en fonction de votre navigation.',\n en: 'These cookies are used to deliver personalized ads based on your browsing behavior.',\n },\n} as const;\n\nexport const PURPOSE_SUPPORT = {\n purposeLabel: {\n fr: 'Support et assistance',\n en: 'Support and assistance',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent d'interagir avec notre service client et de bénéficier d'une assistance en direct.\",\n en: 'These cookies enable interaction with our customer support and provide live assistance.',\n },\n} as const;\n\nexport const PURPOSE_SOCIAL = {\n purposeLabel: {\n fr: 'Réseaux sociaux',\n en: 'Social media',\n },\n purposeDescription: {\n fr: \"Ces cookies permettent de partager du contenu sur les réseaux sociaux et d'interagir avec des plateformes tierces.\",\n en: 'These cookies allow sharing content on social media and interacting with third-party platforms.',\n },\n} as const;\n","import type { Vendor } from '@modernconsent/core';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype HotjarConfig = {\n siteId: string;\n};\n\nconst Hotjar: Vendor<HotjarConfig> = {\n name: 'Hotjar',\n category: 'Analytics',\n description:\n \"Cartes de chaleur, enregistrements de sessions et sondages pour optimiser l'expérience utilisateur.\",\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: [\n '_hj',\n '_hjSession',\n '_hjSessionUser',\n '_hjid',\n '_hjFirstSeen',\n '_hjAbsoluteSessionInProgress',\n '_hjIncludedInSessionSample',\n ],\n init: (config: HotjarConfig) => {\n if (!config?.siteId) return;\n\n (function (h: any, o: Document, t: string, j: string) {\n h.hj =\n h.hj ||\n function (...args: any[]) {\n (h.hj.q = h.hj.q || []).push(args);\n };\n h._hjSettings = { hjid: config.siteId, hjsv: 6 };\n const a = o.getElementsByTagName('head')[0];\n const r = o.createElement('script') as HTMLScriptElement;\n r.async = true;\n r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;\n a.appendChild(r);\n })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');\n },\n};\n\nexport default Hotjar;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { loadScript } from './chunk-6JXWYPMF.js';
|
|
2
|
+
import { PURPOSE_ANALYTICS } from './chunk-TBZUWLOP.js';
|
|
3
|
+
|
|
4
|
+
// src/hubspot.ts
|
|
5
|
+
var HubSpot = {
|
|
6
|
+
name: "HubSpot",
|
|
7
|
+
category: "Analytics",
|
|
8
|
+
description: "Suivi marketing, formulaires et analytics HubSpot.",
|
|
9
|
+
...PURPOSE_ANALYTICS,
|
|
10
|
+
requireConsent: true,
|
|
11
|
+
artifacts: [
|
|
12
|
+
"__hssc",
|
|
13
|
+
"__hssrc",
|
|
14
|
+
"__hstc",
|
|
15
|
+
"hubspotutk",
|
|
16
|
+
"__hs_opt_out",
|
|
17
|
+
"__hs_do_not_track",
|
|
18
|
+
"__hs_initial_opt_in"
|
|
19
|
+
],
|
|
20
|
+
init: (config) => {
|
|
21
|
+
if (!config?.portalId) return;
|
|
22
|
+
loadScript(`https://js.hs-scripts.com/${config.portalId}.js`, void 0, {
|
|
23
|
+
id: "hs-script-loader"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var hubspot_default = HubSpot;
|
|
28
|
+
|
|
29
|
+
export { hubspot_default as default };
|
|
30
|
+
//# sourceMappingURL=hubspot-TLVPT4LG.js.map
|
|
31
|
+
//# sourceMappingURL=hubspot-TLVPT4LG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hubspot.ts"],"names":[],"mappings":";;;;AAQA,IAAM,OAAA,GAAiC;AAAA,EACrC,IAAA,EAAM,SAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,WAAA,EAAa,oDAAA;AAAA,EACb,GAAG,iBAAA;AAAA,EACH,cAAA,EAAgB,IAAA;AAAA,EAChB,SAAA,EAAW;AAAA,IACT,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA,IAAA,EAAM,CAAC,MAAA,KAA0B;AAC/B,IAAA,IAAI,CAAC,QAAQ,QAAA,EAAU;AACvB,IAAA,UAAA,CAAW,CAAA,0BAAA,EAA6B,MAAA,CAAO,QAAQ,CAAA,GAAA,CAAA,EAAO,MAAA,EAAW;AAAA,MACvE,EAAA,EAAI;AAAA,KACL,CAAA;AAAA,EACH;AACF,CAAA;AAEA,IAAO,eAAA,GAAQ","file":"hubspot-TLVPT4LG.js","sourcesContent":["import type { Vendor } from '@modernconsent/core';\nimport { loadScript } from './utils/loader';\nimport { PURPOSE_ANALYTICS } from './utils/purposes';\n\ntype HubSpotConfig = {\n portalId: string;\n};\n\nconst HubSpot: Vendor<HubSpotConfig> = {\n name: 'HubSpot',\n category: 'Analytics',\n description: 'Suivi marketing, formulaires et analytics HubSpot.',\n ...PURPOSE_ANALYTICS,\n requireConsent: true,\n artifacts: [\n '__hssc',\n '__hssrc',\n '__hstc',\n 'hubspotutk',\n '__hs_opt_out',\n '__hs_do_not_track',\n '__hs_initial_opt_in',\n ],\n init: (config: HubSpotConfig) => {\n if (!config?.portalId) return;\n loadScript(`https://js.hs-scripts.com/${config.portalId}.js`, undefined, {\n id: 'hs-script-loader',\n });\n },\n};\n\nexport default HubSpot;\n"]}
|