@luwiostack/cookie-consent 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +292 -2
- package/dist/errors-BqpghFQf.cjs +55 -0
- package/dist/errors-BqpghFQf.cjs.map +1 -0
- package/dist/errors-D2ZIcEYK.mjs +32 -0
- package/dist/errors-D2ZIcEYK.mjs.map +1 -0
- package/dist/index.cjs +571 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +163 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +163 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +558 -0
- package/dist/index.mjs.map +1 -0
- package/dist/react.cjs +124 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +109 -0
- package/dist/react.d.cts.map +1 -0
- package/dist/react.d.mts +109 -0
- package/dist/react.d.mts.map +1 -0
- package/dist/react.mjs +120 -0
- package/dist/react.mjs.map +1 -0
- package/dist/types-BrxRJL4I.d.cts +198 -0
- package/dist/types-BrxRJL4I.d.cts.map +1 -0
- package/dist/types-BrxRJL4I.d.mts +198 -0
- package/dist/types-BrxRJL4I.d.mts.map +1 -0
- package/dist/used-vendors-C8uSNIkd.cjs +14 -0
- package/dist/used-vendors-C8uSNIkd.cjs.map +1 -0
- package/dist/used-vendors-Dxk4PZtY.mjs +9 -0
- package/dist/used-vendors-Dxk4PZtY.mjs.map +1 -0
- package/dist/vendors.cjs +449 -0
- package/dist/vendors.cjs.map +1 -0
- package/dist/vendors.d.cts +163 -0
- package/dist/vendors.d.cts.map +1 -0
- package/dist/vendors.d.mts +163 -0
- package/dist/vendors.d.mts.map +1 -0
- package/dist/vendors.mjs +436 -0
- package/dist/vendors.mjs.map +1 -0
- package/package.json +90 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors.d.cts","names":[],"sources":["../src/vendors/define-vendor.ts","../src/vendors/presets.ts","../src/vendors/from-data.ts","../src/vendors/google-ads.ts","../src/vendors/google-analytics.ts","../src/vendors/google-maps.ts","../src/vendors/google-recaptcha.ts","../src/vendors/hotjar.ts","../src/vendors/linkedin-insight.ts","../src/vendors/meta-pixel.ts","../src/vendors/tiktok-pixel.ts","../src/vendors/vimeo.ts","../src/vendors/youtube.ts"],"mappings":";;UAGiB,oBAAoB;;;;;EAKnC,mBAAmB;;EAEnB,iBAAiB;;;UAIF,aAAa;GAC3B,UAAU,oBAAoB,QAAQ;;WAE9B;;WAEA,kBAAkB;;UAGZ,iBAAiB,mBAAmB;;EAEnD;EACA;EACA,SAAS;;;;;;;;;;iBAWK,mBAAmB,mBAAmB,iBACpD,YAAY,iBAAiB,KAC5B,aAAa;;;;;;;;cCvBH;6BAAA;;;;;;;;;;;;KAcD,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;UCJzB;;EAEf;;EAEA;;EAEA,YAAY,QAAQ,OAAO,4BAA4B;;;KAI7C,oBAAoB,iBAAiB,0BAA0B;;UAG1D;EACf,QAAQ;EACR;EACA,iBAAiB;;;UAIF;EACf,YAAY;EACZ;EACA;;;UAIe;;;;;;;EAOf,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBAoDP,sBACd,MAAM,mBACN,UAAS,+BACR;;;cC1GU,WAAA;;;cCDA,iBAAA;;;cCCA,YAAA;;;cCDA,iBAAA;;;cCDA,QAAA;;;cCAA,iBAAA;;;cCGA,WAAA;;;cCHA,aAAA;;;cCEA,OAAA;;;cCEA,SAAA"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { h as ConsentCategoryId, i as ConsentCookie, t as ConsentCategoriesConfig, u as ConsentVendor } from "./types-BrxRJL4I.mjs";
|
|
2
|
+
//#region src/vendors/define-vendor.d.ts
|
|
3
|
+
interface VendorPresetOptions<Name extends string = string> {
|
|
4
|
+
/**
|
|
5
|
+
* Only these of the preset's cookies — for when your integration doesn't set them all (e.g. no
|
|
6
|
+
* Google Signals). Default: every cookie in the preset. An unknown name is a type error and throws.
|
|
7
|
+
*/
|
|
8
|
+
cookies?: readonly Name[];
|
|
9
|
+
/** Your own cookies on top, for anything this vendor sets in your setup that the preset lacks. */
|
|
10
|
+
extra?: readonly ConsentCookie[];
|
|
11
|
+
}
|
|
12
|
+
/** A ready-made vendor: call it (optionally narrowing or extending its cookies) to get a `ConsentVendor`. */
|
|
13
|
+
interface VendorPreset<Name extends string = string> {
|
|
14
|
+
(options?: VendorPresetOptions<Name>): ConsentVendor;
|
|
15
|
+
/** The vendor id — also the translation key of its name. */
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/** Every cookie the preset declares. */
|
|
18
|
+
readonly cookies: readonly ConsentCookie[];
|
|
19
|
+
}
|
|
20
|
+
interface VendorDefinition<C extends readonly ConsentCookie[]> {
|
|
21
|
+
/** Stable key — also the translation key for the vendor's name, and the prefix of its cookies' keys. */
|
|
22
|
+
id: string;
|
|
23
|
+
privacy_policy_url?: string;
|
|
24
|
+
cookies: C;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Define a reusable vendor preset — how every preset in `@luwiostack/cookie-consent/vendors` is built, and
|
|
28
|
+
* the way to package your own (an in-house widget you use across apps). Cookie names are inferred as
|
|
29
|
+
* literals, so the preset's `cookies` option only accepts names it declares.
|
|
30
|
+
*
|
|
31
|
+
* Translation keys follow the package catalogs: `t(vendor.id)` is the vendor's name and
|
|
32
|
+
* `t(\`${vendor.id}.${cookie.name}\`)` a cookie's purpose.
|
|
33
|
+
*/
|
|
34
|
+
declare function defineVendor<const C extends readonly ConsentCookie[]>(definition: VendorDefinition<C>): VendorPreset<C[number]['name']>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/vendors/presets.d.ts
|
|
37
|
+
/**
|
|
38
|
+
* Every preset by its id — for when the set of vendors is decided at runtime (a backend that turns
|
|
39
|
+
* integrations on and off sends `"google_analytics"`, not code). Importing this map bundles every
|
|
40
|
+
* preset; import the named presets instead when your vendors are fixed in code.
|
|
41
|
+
*/
|
|
42
|
+
declare const vendorPresets: {
|
|
43
|
+
readonly google_analytics: VendorPreset<"_ga" | "_ga_*">;
|
|
44
|
+
readonly hotjar: VendorPreset<"_hjDonePolls" | "_hjHasCachedUserAttributes" | "_hjSessionUser_*" | "_hjSession_*" | "_hjUserAttributes" | "_hjUserAttributesHash" | "hjActiveViewportIds" | "hjViewportId">;
|
|
45
|
+
readonly google_ads: VendorPreset<"IDE" | "_gac_*" | "_gcl_au" | "_gcl_aw" | "_gcl_dc" | "ar_debug" | "test_cookie">;
|
|
46
|
+
readonly meta_pixel: VendorPreset<"_fbc" | "_fbp" | "fr">;
|
|
47
|
+
readonly linkedin_insight: VendorPreset<"AnalyticsSyncHistory" | "UserMatchHistory" | "bcookie" | "li_fat_id" | "li_gc" | "li_sugr" | "lidc" | "ln_or">;
|
|
48
|
+
readonly tiktok_pixel: VendorPreset<"_pangle" | "_ttp" | "ttclid" | "ttcsid*">;
|
|
49
|
+
readonly youtube: VendorPreset<"PREF" | "VISITOR_INFO1_LIVE" | "YSC" | "__Secure-ROLLOUT_TOKEN" | "__Secure-YENID" | "__Secure-YNID">;
|
|
50
|
+
readonly vimeo: VendorPreset<"__cf_bm" | "_cfuvid" | "cf_clearance" | "player" | "player_clearance" | "vuid">;
|
|
51
|
+
readonly google_maps: VendorPreset<"AEC" | "NID" | "SOCS">;
|
|
52
|
+
readonly google_recaptcha: VendorPreset<"_GRECAPTCHA">;
|
|
53
|
+
};
|
|
54
|
+
/** The id of a shipped preset — `'google_analytics'`, `'meta_pixel'`, … */
|
|
55
|
+
type VendorPresetId = keyof typeof vendorPresets;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/vendors/from-data.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* The serializable consent config — what a backend sends when it decides which integrations are on
|
|
60
|
+
* (a back office where an admin enables Google Analytics, or the YouTube embed without tracking).
|
|
61
|
+
* JSON only: per category, the vendors used in it — a preset id, a preset reference narrowed or
|
|
62
|
+
* extended, or a full declaration when there's no preset. A vendor brings only its cookies of the
|
|
63
|
+
* category it's listed under (plus its necessary ones). snake_case, like every dataset.
|
|
64
|
+
*
|
|
65
|
+
* ```json
|
|
66
|
+
* {
|
|
67
|
+
* "policy_version": 7,
|
|
68
|
+
* "categories": {
|
|
69
|
+
* "statistics": ["google_analytics"],
|
|
70
|
+
* "preferences": ["youtube"],
|
|
71
|
+
* "marketing": [
|
|
72
|
+
* { "preset": "google_ads", "cookies": ["_gcl_au", "IDE"] },
|
|
73
|
+
* { "id": "acme_chat", "cookies": [{ "name": "acme_id", "category": "marketing", "max_age": 31536000000 }] }
|
|
74
|
+
* ]
|
|
75
|
+
* }
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
interface ConsentConfigData {
|
|
80
|
+
/** Bump it whenever the set of vendors changes, so every visitor is asked again. Default `1`. */
|
|
81
|
+
policy_version?: string | number;
|
|
82
|
+
/** How long a decision stays valid, in milliseconds. Default: 365 days. */
|
|
83
|
+
max_age?: number;
|
|
84
|
+
/** Per category, the vendors used in it. */
|
|
85
|
+
categories: Partial<Record<ConsentCategoryId, readonly ConsentVendorData[]>>;
|
|
86
|
+
}
|
|
87
|
+
/** A vendor in the data: a preset id, a preset reference, or a full declaration of your own. */
|
|
88
|
+
type ConsentVendorData = VendorPresetId | ConsentPresetVendorData | ConsentVendor;
|
|
89
|
+
/** A shipped preset by id, optionally narrowed (`cookies`) or extended (`extra`). */
|
|
90
|
+
interface ConsentPresetVendorData {
|
|
91
|
+
preset: VendorPresetId;
|
|
92
|
+
cookies?: readonly string[];
|
|
93
|
+
extra?: readonly ConsentCookie[];
|
|
94
|
+
}
|
|
95
|
+
/** The part of `createConsent`'s config that data describes. */
|
|
96
|
+
interface ConsentConfigFromData {
|
|
97
|
+
categories: ConsentCategoriesConfig;
|
|
98
|
+
policyVersion?: string | number;
|
|
99
|
+
maxAge?: number;
|
|
100
|
+
}
|
|
101
|
+
/** What only the app knows, merged into the data's config. */
|
|
102
|
+
interface ConsentConfigFromDataOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The app's own strictly necessary vendors (its session cookie, CSRF token, the consent record),
|
|
105
|
+
* declared in code. Put under `necessary`, ahead of the data's categories. Once the app declares
|
|
106
|
+
* them, the data may not list `necessary` itself: strictly necessary cookies are the app's to
|
|
107
|
+
* declare, never the backend's.
|
|
108
|
+
*/
|
|
109
|
+
necessary?: readonly ConsentVendor[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Turn backend data into `createConsent` options: per category, preset ids and references become
|
|
113
|
+
* full vendor declarations (from `vendorPresets`); full declarations pass through. Pass the app's
|
|
114
|
+
* own strictly necessary vendors as `necessary`, then spread the result and add what else only the
|
|
115
|
+
* app knows:
|
|
116
|
+
*
|
|
117
|
+
* ```ts
|
|
118
|
+
* const consent = createConsent({
|
|
119
|
+
* ...consentConfigFromData(config.consent, { necessary: [mySite] }),
|
|
120
|
+
* onChange,
|
|
121
|
+
* })
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* Checks the shape as it goes — the data comes over the wire — and `createConsent` then validates
|
|
125
|
+
* the rest (a vendor without cookies of its category, cookie names, lifetimes).
|
|
126
|
+
*
|
|
127
|
+
* @throws {ConsentError} for a malformed shape, an unknown category or preset, a cookie a preset
|
|
128
|
+
* doesn't declare, or — when the app passes `necessary` — a `necessary` category in the data.
|
|
129
|
+
*/
|
|
130
|
+
declare function consentConfigFromData(data: ConsentConfigData, options?: ConsentConfigFromDataOptions): ConsentConfigFromData;
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/vendors/google-ads.d.ts
|
|
133
|
+
declare const googleAds: VendorPreset<"IDE" | "_gac_*" | "_gcl_au" | "_gcl_aw" | "_gcl_dc" | "ar_debug" | "test_cookie">;
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/vendors/google-analytics.d.ts
|
|
136
|
+
declare const googleAnalytics: VendorPreset<"_ga" | "_ga_*">;
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/vendors/google-maps.d.ts
|
|
139
|
+
declare const googleMaps: VendorPreset<"AEC" | "NID" | "SOCS">;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/vendors/google-recaptcha.d.ts
|
|
142
|
+
declare const googleRecaptcha: VendorPreset<"_GRECAPTCHA">;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/vendors/hotjar.d.ts
|
|
145
|
+
declare const hotjar: VendorPreset<"_hjDonePolls" | "_hjHasCachedUserAttributes" | "_hjSessionUser_*" | "_hjSession_*" | "_hjUserAttributes" | "_hjUserAttributesHash" | "hjActiveViewportIds" | "hjViewportId">;
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/vendors/linkedin-insight.d.ts
|
|
148
|
+
declare const linkedinInsight: VendorPreset<"AnalyticsSyncHistory" | "UserMatchHistory" | "bcookie" | "li_fat_id" | "li_gc" | "li_sugr" | "lidc" | "ln_or">;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/vendors/meta-pixel.d.ts
|
|
151
|
+
declare const metaPixel: VendorPreset<"_fbc" | "_fbp" | "fr">;
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/vendors/tiktok-pixel.d.ts
|
|
154
|
+
declare const tiktokPixel: VendorPreset<"_pangle" | "_ttp" | "ttclid" | "ttcsid*">;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/vendors/vimeo.d.ts
|
|
157
|
+
declare const vimeo: VendorPreset<"__cf_bm" | "_cfuvid" | "cf_clearance" | "player" | "player_clearance" | "vuid">;
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/vendors/youtube.d.ts
|
|
160
|
+
declare const youtube: VendorPreset<"PREF" | "VISITOR_INFO1_LIVE" | "YSC" | "__Secure-ROLLOUT_TOKEN" | "__Secure-YENID" | "__Secure-YNID">;
|
|
161
|
+
//#endregion
|
|
162
|
+
export { type ConsentConfigData, type ConsentConfigFromData, type ConsentConfigFromDataOptions, type ConsentPresetVendorData, type ConsentVendorData, type VendorDefinition, type VendorPreset, type VendorPresetId, type VendorPresetOptions, consentConfigFromData, defineVendor, googleAds, googleAnalytics, googleMaps, googleRecaptcha, hotjar, linkedinInsight, metaPixel, tiktokPixel, vendorPresets, vimeo, youtube };
|
|
163
|
+
//# sourceMappingURL=vendors.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors.d.mts","names":[],"sources":["../src/vendors/define-vendor.ts","../src/vendors/presets.ts","../src/vendors/from-data.ts","../src/vendors/google-ads.ts","../src/vendors/google-analytics.ts","../src/vendors/google-maps.ts","../src/vendors/google-recaptcha.ts","../src/vendors/hotjar.ts","../src/vendors/linkedin-insight.ts","../src/vendors/meta-pixel.ts","../src/vendors/tiktok-pixel.ts","../src/vendors/vimeo.ts","../src/vendors/youtube.ts"],"mappings":";;UAGiB,oBAAoB;;;;;EAKnC,mBAAmB;;EAEnB,iBAAiB;;;UAIF,aAAa;GAC3B,UAAU,oBAAoB,QAAQ;;WAE9B;;WAEA,kBAAkB;;UAGZ,iBAAiB,mBAAmB;;EAEnD;EACA;EACA,SAAS;;;;;;;;;;iBAWK,mBAAmB,mBAAmB,iBACpD,YAAY,iBAAiB,KAC5B,aAAa;;;;;;;;cCvBH;6BAAA;;;;;;;;;;;;KAcD,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;UCJzB;;EAEf;;EAEA;;EAEA,YAAY,QAAQ,OAAO,4BAA4B;;;KAI7C,oBAAoB,iBAAiB,0BAA0B;;UAG1D;EACf,QAAQ;EACR;EACA,iBAAiB;;;UAIF;EACf,YAAY;EACZ;EACA;;;UAIe;;;;;;;EAOf,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBAoDP,sBACd,MAAM,mBACN,UAAS,+BACR;;;cC1GU,WAAA;;;cCDA,iBAAA;;;cCCA,YAAA;;;cCDA,iBAAA;;;cCDA,QAAA;;;cCAA,iBAAA;;;cCGA,WAAA;;;cCHA,aAAA;;;cCEA,OAAA;;;cCEA,SAAA"}
|
package/dist/vendors.mjs
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { i as isConsentCategoryId, r as REQUIRED_CATEGORY, t as ConsentError } from "./errors-D2ZIcEYK.mjs";
|
|
2
|
+
//#region src/vendors/define-vendor.ts
|
|
3
|
+
/**
|
|
4
|
+
* Define a reusable vendor preset — how every preset in `@luwiostack/cookie-consent/vendors` is built, and
|
|
5
|
+
* the way to package your own (an in-house widget you use across apps). Cookie names are inferred as
|
|
6
|
+
* literals, so the preset's `cookies` option only accepts names it declares.
|
|
7
|
+
*
|
|
8
|
+
* Translation keys follow the package catalogs: `t(vendor.id)` is the vendor's name and
|
|
9
|
+
* `t(\`${vendor.id}.${cookie.name}\`)` a cookie's purpose.
|
|
10
|
+
*/
|
|
11
|
+
function defineVendor(definition) {
|
|
12
|
+
const { id, privacy_policy_url, cookies } = definition;
|
|
13
|
+
const preset = (options = {}) => {
|
|
14
|
+
let picked = cookies;
|
|
15
|
+
if (options.cookies) {
|
|
16
|
+
const known = new Set(cookies.map((c) => c.name));
|
|
17
|
+
for (const name of options.cookies) if (!known.has(name)) throw new ConsentError(`Vendor "${id}" has no cookie "${name}" — use \`extra\` to add one.`);
|
|
18
|
+
const wanted = new Set(options.cookies);
|
|
19
|
+
picked = cookies.filter((c) => wanted.has(c.name));
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
id,
|
|
23
|
+
...privacy_policy_url ? { privacy_policy_url } : {},
|
|
24
|
+
cookies: [...picked, ...options.extra ?? []]
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
return Object.assign(preset, {
|
|
28
|
+
id,
|
|
29
|
+
cookies
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/vendors/time.ts
|
|
34
|
+
const MINUTE = 6e4;
|
|
35
|
+
const DAY = 24 * (60 * MINUTE);
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/vendors/google-ads.ts
|
|
38
|
+
const googleAds = /* @__PURE__ */ defineVendor({
|
|
39
|
+
id: "google_ads",
|
|
40
|
+
privacy_policy_url: "https://policies.google.com/privacy",
|
|
41
|
+
cookies: [
|
|
42
|
+
{
|
|
43
|
+
name: "_gcl_au",
|
|
44
|
+
category: "marketing",
|
|
45
|
+
max_age: 90 * DAY
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "_gcl_aw",
|
|
49
|
+
category: "marketing",
|
|
50
|
+
max_age: 90 * DAY
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "_gcl_dc",
|
|
54
|
+
category: "marketing",
|
|
55
|
+
max_age: 90 * DAY
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "_gac_*",
|
|
59
|
+
category: "marketing",
|
|
60
|
+
max_age: 90 * DAY
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "IDE",
|
|
64
|
+
category: "marketing",
|
|
65
|
+
max_age: 390 * DAY
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "test_cookie",
|
|
69
|
+
category: "marketing",
|
|
70
|
+
max_age: 15 * MINUTE
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "ar_debug",
|
|
74
|
+
category: "marketing",
|
|
75
|
+
max_age: 90 * DAY
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/vendors/google-analytics.ts
|
|
81
|
+
const googleAnalytics = /* @__PURE__ */ defineVendor({
|
|
82
|
+
id: "google_analytics",
|
|
83
|
+
privacy_policy_url: "https://policies.google.com/privacy",
|
|
84
|
+
cookies: [{
|
|
85
|
+
name: "_ga",
|
|
86
|
+
category: "statistics",
|
|
87
|
+
max_age: 730 * DAY
|
|
88
|
+
}, {
|
|
89
|
+
name: "_ga_*",
|
|
90
|
+
category: "statistics",
|
|
91
|
+
max_age: 730 * DAY
|
|
92
|
+
}]
|
|
93
|
+
});
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/vendors/google-maps.ts
|
|
96
|
+
const googleMaps = /* @__PURE__ */ defineVendor({
|
|
97
|
+
id: "google_maps",
|
|
98
|
+
privacy_policy_url: "https://policies.google.com/privacy",
|
|
99
|
+
cookies: [
|
|
100
|
+
{
|
|
101
|
+
name: "NID",
|
|
102
|
+
category: "marketing",
|
|
103
|
+
max_age: 180 * DAY
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "AEC",
|
|
107
|
+
category: "necessary",
|
|
108
|
+
max_age: 180 * DAY
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "SOCS",
|
|
112
|
+
category: "necessary",
|
|
113
|
+
max_age: 390 * DAY
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/vendors/google-recaptcha.ts
|
|
119
|
+
const googleRecaptcha = /* @__PURE__ */ defineVendor({
|
|
120
|
+
id: "google_recaptcha",
|
|
121
|
+
privacy_policy_url: "https://policies.google.com/privacy",
|
|
122
|
+
cookies: [{
|
|
123
|
+
name: "_GRECAPTCHA",
|
|
124
|
+
category: "necessary",
|
|
125
|
+
max_age: 180 * DAY
|
|
126
|
+
}]
|
|
127
|
+
});
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/vendors/hotjar.ts
|
|
130
|
+
const hotjar = /* @__PURE__ */ defineVendor({
|
|
131
|
+
id: "hotjar",
|
|
132
|
+
privacy_policy_url: "https://www.hotjar.com/legal/policies/privacy/",
|
|
133
|
+
cookies: [
|
|
134
|
+
{
|
|
135
|
+
name: "_hjSessionUser_*",
|
|
136
|
+
category: "statistics",
|
|
137
|
+
max_age: 365 * DAY
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "_hjSession_*",
|
|
141
|
+
category: "statistics",
|
|
142
|
+
max_age: 30 * MINUTE
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "_hjHasCachedUserAttributes",
|
|
146
|
+
category: "statistics",
|
|
147
|
+
max_age: "session"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "_hjUserAttributesHash",
|
|
151
|
+
category: "statistics",
|
|
152
|
+
max_age: 2 * MINUTE
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "_hjUserAttributes",
|
|
156
|
+
category: "statistics",
|
|
157
|
+
type: "local_storage",
|
|
158
|
+
max_age: "persistent"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "hjViewportId",
|
|
162
|
+
category: "statistics",
|
|
163
|
+
type: "session_storage",
|
|
164
|
+
max_age: "session"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "hjActiveViewportIds",
|
|
168
|
+
category: "statistics",
|
|
169
|
+
type: "local_storage",
|
|
170
|
+
max_age: "session"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "_hjDonePolls",
|
|
174
|
+
category: "statistics",
|
|
175
|
+
max_age: 365 * DAY
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
});
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/vendors/linkedin-insight.ts
|
|
181
|
+
const linkedinInsight = /* @__PURE__ */ defineVendor({
|
|
182
|
+
id: "linkedin_insight",
|
|
183
|
+
privacy_policy_url: "https://www.linkedin.com/legal/privacy-policy",
|
|
184
|
+
cookies: [
|
|
185
|
+
{
|
|
186
|
+
name: "li_fat_id",
|
|
187
|
+
category: "marketing",
|
|
188
|
+
max_age: 30 * DAY
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "ln_or",
|
|
192
|
+
category: "marketing",
|
|
193
|
+
max_age: DAY
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "bcookie",
|
|
197
|
+
category: "marketing",
|
|
198
|
+
max_age: 365 * DAY
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "lidc",
|
|
202
|
+
category: "marketing",
|
|
203
|
+
max_age: DAY
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "li_sugr",
|
|
207
|
+
category: "marketing",
|
|
208
|
+
max_age: 90 * DAY
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "UserMatchHistory",
|
|
212
|
+
category: "marketing",
|
|
213
|
+
max_age: 30 * DAY
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "AnalyticsSyncHistory",
|
|
217
|
+
category: "marketing",
|
|
218
|
+
max_age: 30 * DAY
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "li_gc",
|
|
222
|
+
category: "necessary",
|
|
223
|
+
max_age: 180 * DAY
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/vendors/meta-pixel.ts
|
|
229
|
+
const metaPixel = /* @__PURE__ */ defineVendor({
|
|
230
|
+
id: "meta_pixel",
|
|
231
|
+
privacy_policy_url: "https://www.facebook.com/privacy/policy/",
|
|
232
|
+
cookies: [
|
|
233
|
+
{
|
|
234
|
+
name: "_fbp",
|
|
235
|
+
category: "marketing",
|
|
236
|
+
max_age: 90 * DAY
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "_fbc",
|
|
240
|
+
category: "marketing",
|
|
241
|
+
max_age: 90 * DAY
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "fr",
|
|
245
|
+
category: "marketing",
|
|
246
|
+
max_age: 90 * DAY
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
});
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/vendors/tiktok-pixel.ts
|
|
252
|
+
const tiktokPixel = /* @__PURE__ */ defineVendor({
|
|
253
|
+
id: "tiktok_pixel",
|
|
254
|
+
privacy_policy_url: "https://www.tiktok.com/legal/page/eea/privacy-policy/en",
|
|
255
|
+
cookies: [
|
|
256
|
+
{
|
|
257
|
+
name: "_ttp",
|
|
258
|
+
category: "marketing",
|
|
259
|
+
max_age: 390 * DAY
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "ttcsid*",
|
|
263
|
+
category: "marketing",
|
|
264
|
+
max_age: 390 * DAY
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: "ttclid",
|
|
268
|
+
category: "marketing",
|
|
269
|
+
max_age: 390 * DAY
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "_pangle",
|
|
273
|
+
category: "marketing",
|
|
274
|
+
max_age: 390 * DAY
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/vendors/vimeo.ts
|
|
280
|
+
const vimeo = /* @__PURE__ */ defineVendor({
|
|
281
|
+
id: "vimeo",
|
|
282
|
+
privacy_policy_url: "https://vimeo.com/privacy",
|
|
283
|
+
cookies: [
|
|
284
|
+
{
|
|
285
|
+
name: "vuid",
|
|
286
|
+
category: "statistics",
|
|
287
|
+
max_age: 730 * DAY
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "player",
|
|
291
|
+
category: "preferences",
|
|
292
|
+
max_age: 365 * DAY
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "player_clearance",
|
|
296
|
+
category: "necessary",
|
|
297
|
+
max_age: 7 * DAY
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "__cf_bm",
|
|
301
|
+
category: "necessary",
|
|
302
|
+
max_age: 30 * MINUTE
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "_cfuvid",
|
|
306
|
+
category: "necessary",
|
|
307
|
+
max_age: "session"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: "cf_clearance",
|
|
311
|
+
category: "necessary",
|
|
312
|
+
max_age: 365 * DAY
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
});
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/vendors/youtube.ts
|
|
318
|
+
const youtube = /* @__PURE__ */ defineVendor({
|
|
319
|
+
id: "youtube",
|
|
320
|
+
privacy_policy_url: "https://policies.google.com/privacy",
|
|
321
|
+
cookies: [
|
|
322
|
+
{
|
|
323
|
+
name: "YSC",
|
|
324
|
+
category: "marketing",
|
|
325
|
+
max_age: "session"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
name: "__Secure-YNID",
|
|
329
|
+
category: "marketing",
|
|
330
|
+
max_age: 180 * DAY
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: "VISITOR_INFO1_LIVE",
|
|
334
|
+
category: "marketing",
|
|
335
|
+
max_age: 180 * DAY
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: "__Secure-YENID",
|
|
339
|
+
category: "marketing",
|
|
340
|
+
max_age: 390 * DAY
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "__Secure-ROLLOUT_TOKEN",
|
|
344
|
+
category: "marketing",
|
|
345
|
+
max_age: 180 * DAY
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "PREF",
|
|
349
|
+
category: "preferences",
|
|
350
|
+
max_age: 240 * DAY
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
});
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/vendors/presets.ts
|
|
356
|
+
/**
|
|
357
|
+
* Every preset by its id — for when the set of vendors is decided at runtime (a backend that turns
|
|
358
|
+
* integrations on and off sends `"google_analytics"`, not code). Importing this map bundles every
|
|
359
|
+
* preset; import the named presets instead when your vendors are fixed in code.
|
|
360
|
+
*/
|
|
361
|
+
const vendorPresets = {
|
|
362
|
+
google_analytics: googleAnalytics,
|
|
363
|
+
hotjar,
|
|
364
|
+
google_ads: googleAds,
|
|
365
|
+
meta_pixel: metaPixel,
|
|
366
|
+
linkedin_insight: linkedinInsight,
|
|
367
|
+
tiktok_pixel: tiktokPixel,
|
|
368
|
+
youtube,
|
|
369
|
+
vimeo,
|
|
370
|
+
google_maps: googleMaps,
|
|
371
|
+
google_recaptcha: googleRecaptcha
|
|
372
|
+
};
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/vendors/from-data.ts
|
|
375
|
+
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
376
|
+
function presetFor(id, where) {
|
|
377
|
+
if (typeof id === "string" && Object.hasOwn(vendorPresets, id)) return vendorPresets[id];
|
|
378
|
+
throw new ConsentError(`${where}: unknown vendor preset "${String(id)}".`);
|
|
379
|
+
}
|
|
380
|
+
function vendorFromData(raw, where) {
|
|
381
|
+
if (typeof raw === "string") return presetFor(raw, where)();
|
|
382
|
+
if (!isObject(raw)) throw new ConsentError(`${where}: must be a preset id or an object.`);
|
|
383
|
+
if ("preset" in raw) {
|
|
384
|
+
const preset = presetFor(raw.preset, where);
|
|
385
|
+
if (raw.cookies !== void 0 && !Array.isArray(raw.cookies)) throw new ConsentError(`${where} ("${raw.preset}"): cookies must be an array of names.`);
|
|
386
|
+
if (raw.extra !== void 0 && !Array.isArray(raw.extra)) throw new ConsentError(`${where} ("${raw.preset}"): extra must be an array of cookies.`);
|
|
387
|
+
return preset({
|
|
388
|
+
cookies: raw.cookies,
|
|
389
|
+
extra: raw.extra
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
return raw;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Turn backend data into `createConsent` options: per category, preset ids and references become
|
|
396
|
+
* full vendor declarations (from `vendorPresets`); full declarations pass through. Pass the app's
|
|
397
|
+
* own strictly necessary vendors as `necessary`, then spread the result and add what else only the
|
|
398
|
+
* app knows:
|
|
399
|
+
*
|
|
400
|
+
* ```ts
|
|
401
|
+
* const consent = createConsent({
|
|
402
|
+
* ...consentConfigFromData(config.consent, { necessary: [mySite] }),
|
|
403
|
+
* onChange,
|
|
404
|
+
* })
|
|
405
|
+
* ```
|
|
406
|
+
*
|
|
407
|
+
* Checks the shape as it goes — the data comes over the wire — and `createConsent` then validates
|
|
408
|
+
* the rest (a vendor without cookies of its category, cookie names, lifetimes).
|
|
409
|
+
*
|
|
410
|
+
* @throws {ConsentError} for a malformed shape, an unknown category or preset, a cookie a preset
|
|
411
|
+
* doesn't declare, or — when the app passes `necessary` — a `necessary` category in the data.
|
|
412
|
+
*/
|
|
413
|
+
function consentConfigFromData(data, options = {}) {
|
|
414
|
+
if (!isObject(data)) throw new ConsentError("Consent config data must be an object.");
|
|
415
|
+
if (!isObject(data.categories)) throw new ConsentError("Consent config data needs a \"categories\" object.");
|
|
416
|
+
const categories = {};
|
|
417
|
+
if (options.necessary !== void 0) {
|
|
418
|
+
if (Object.hasOwn(data.categories, "necessary")) throw new ConsentError(`Consent config data may not list "${REQUIRED_CATEGORY}": the app declares its strictly necessary vendors itself.`);
|
|
419
|
+
if (!Array.isArray(options.necessary)) throw new ConsentError(`The app's "${REQUIRED_CATEGORY}" vendors must be an array.`);
|
|
420
|
+
categories[REQUIRED_CATEGORY] = options.necessary;
|
|
421
|
+
}
|
|
422
|
+
for (const [id, list] of Object.entries(data.categories)) {
|
|
423
|
+
if (!isConsentCategoryId(id)) throw new ConsentError(`Unknown consent category "${id}".`);
|
|
424
|
+
if (!Array.isArray(list)) throw new ConsentError(`Category "${id}": vendors must be an array.`);
|
|
425
|
+
categories[id] = list.map((raw, index) => vendorFromData(raw, `Category "${id}", vendor #${index + 1}`));
|
|
426
|
+
}
|
|
427
|
+
return {
|
|
428
|
+
categories,
|
|
429
|
+
...data.policy_version !== void 0 ? { policyVersion: data.policy_version } : {},
|
|
430
|
+
...data.max_age !== void 0 ? { maxAge: data.max_age } : {}
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
export { consentConfigFromData, defineVendor, googleAds, googleAnalytics, googleMaps, googleRecaptcha, hotjar, linkedinInsight, metaPixel, tiktokPixel, vendorPresets, vimeo, youtube };
|
|
435
|
+
|
|
436
|
+
//# sourceMappingURL=vendors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors.mjs","names":[],"sources":["../src/vendors/define-vendor.ts","../src/vendors/time.ts","../src/vendors/google-ads.ts","../src/vendors/google-analytics.ts","../src/vendors/google-maps.ts","../src/vendors/google-recaptcha.ts","../src/vendors/hotjar.ts","../src/vendors/linkedin-insight.ts","../src/vendors/meta-pixel.ts","../src/vendors/tiktok-pixel.ts","../src/vendors/vimeo.ts","../src/vendors/youtube.ts","../src/vendors/presets.ts","../src/vendors/from-data.ts"],"sourcesContent":["import { ConsentError } from '../errors'\nimport type { ConsentCookie, ConsentVendor } from '../types'\n\nexport interface VendorPresetOptions<Name extends string = string> {\n /**\n * Only these of the preset's cookies — for when your integration doesn't set them all (e.g. no\n * Google Signals). Default: every cookie in the preset. An unknown name is a type error and throws.\n */\n cookies?: readonly Name[]\n /** Your own cookies on top, for anything this vendor sets in your setup that the preset lacks. */\n extra?: readonly ConsentCookie[]\n}\n\n/** A ready-made vendor: call it (optionally narrowing or extending its cookies) to get a `ConsentVendor`. */\nexport interface VendorPreset<Name extends string = string> {\n (options?: VendorPresetOptions<Name>): ConsentVendor\n /** The vendor id — also the translation key of its name. */\n readonly id: string\n /** Every cookie the preset declares. */\n readonly cookies: readonly ConsentCookie[]\n}\n\nexport interface VendorDefinition<C extends readonly ConsentCookie[]> {\n /** Stable key — also the translation key for the vendor's name, and the prefix of its cookies' keys. */\n id: string\n privacy_policy_url?: string\n cookies: C\n}\n\n/**\n * Define a reusable vendor preset — how every preset in `@luwiostack/cookie-consent/vendors` is built, and\n * the way to package your own (an in-house widget you use across apps). Cookie names are inferred as\n * literals, so the preset's `cookies` option only accepts names it declares.\n *\n * Translation keys follow the package catalogs: `t(vendor.id)` is the vendor's name and\n * `t(\\`${vendor.id}.${cookie.name}\\`)` a cookie's purpose.\n */\nexport function defineVendor<const C extends readonly ConsentCookie[]>(\n definition: VendorDefinition<C>,\n): VendorPreset<C[number]['name']> {\n const { id, privacy_policy_url, cookies } = definition\n const preset = (options: VendorPresetOptions<C[number]['name']> = {}): ConsentVendor => {\n let picked: readonly ConsentCookie[] = cookies\n if (options.cookies) {\n const known = new Set(cookies.map((c) => c.name))\n for (const name of options.cookies) {\n if (!known.has(name)) {\n throw new ConsentError(\n `Vendor \"${id}\" has no cookie \"${name}\" — use \\`extra\\` to add one.`,\n )\n }\n }\n const wanted = new Set<string>(options.cookies)\n picked = cookies.filter((c) => wanted.has(c.name))\n }\n return {\n id,\n ...(privacy_policy_url ? { privacy_policy_url } : {}),\n cookies: [...picked, ...(options.extra ?? [])],\n }\n }\n return Object.assign(preset, { id, cookies })\n}\n","// Lifetimes in the presets are milliseconds, like every duration in @luwiostack/cookie-consent.\nexport const MINUTE = 60 * 1000\nexport const HOUR = 60 * MINUTE\nexport const DAY = 24 * HOUR\n","import { defineVendor } from './define-vendor'\nimport { DAY, MINUTE } from './time'\n\n// Google Ads — the cookies a standard integration sets for visitors.\n// Sources:\n// https://business.safety.google/adscookies/\n// https://policies.google.com/technologies/cookies\n// Note: IDE is 13 months in the EEA, Switzerland and UK (24 months elsewhere). _gac_* is only set when Google\n// Analytics is linked to Google Ads.\nexport const googleAds = /* @__PURE__ */ defineVendor({\n id: 'google_ads',\n privacy_policy_url: 'https://policies.google.com/privacy',\n cookies: [\n { name: '_gcl_au', category: 'marketing', max_age: 90 * DAY },\n { name: '_gcl_aw', category: 'marketing', max_age: 90 * DAY },\n { name: '_gcl_dc', category: 'marketing', max_age: 90 * DAY },\n { name: '_gac_*', category: 'marketing', max_age: 90 * DAY },\n { name: 'IDE', category: 'marketing', max_age: 390 * DAY },\n { name: 'test_cookie', category: 'marketing', max_age: 15 * MINUTE },\n { name: 'ar_debug', category: 'marketing', max_age: 90 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// Google Analytics — the cookies a standard integration sets for visitors.\n// Sources:\n// https://support.google.com/analytics/answer/11397207\n// https://business.safety.google/adscookies/\n// https://policies.google.com/technologies/cookies\nexport const googleAnalytics = /* @__PURE__ */ defineVendor({\n id: 'google_analytics',\n privacy_policy_url: 'https://policies.google.com/privacy',\n cookies: [\n { name: '_ga', category: 'statistics', max_age: 730 * DAY },\n { name: '_ga_*', category: 'statistics', max_age: 730 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// Google Maps — the cookies a standard integration sets for visitors.\n// Sources:\n// https://policies.google.com/technologies/cookies\n// https://policies.google.com/technologies/cookies/embedded?hl=en\n// Note: Google publishes no list for Maps embeds; these are the general google.com cookies from \"How Google\n// uses cookies\". What's set depends on the visitor's existing Google cookies, sign-in and region.\nexport const googleMaps = /* @__PURE__ */ defineVendor({\n id: 'google_maps',\n privacy_policy_url: 'https://policies.google.com/privacy',\n cookies: [\n { name: 'NID', category: 'marketing', max_age: 180 * DAY },\n { name: 'AEC', category: 'necessary', max_age: 180 * DAY },\n { name: 'SOCS', category: 'necessary', max_age: 390 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// Google reCAPTCHA — the cookies a standard integration sets for visitors.\n// Sources:\n// https://developers.google.com/recaptcha/docs/faq\n// https://cookiedatabase.org/cookie/google-recaptcha/_grecaptcha/\n// Note: Google documents _GRECAPTCHA's name and purpose, not its lifetime — 6 months is from Cookiedatabase.org.\nexport const googleRecaptcha = /* @__PURE__ */ defineVendor({\n id: 'google_recaptcha',\n privacy_policy_url: 'https://policies.google.com/privacy',\n cookies: [{ name: '_GRECAPTCHA', category: 'necessary', max_age: 180 * DAY }],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY, MINUTE } from './time'\n\n// Hotjar — the cookies a standard integration sets for visitors.\n// Sources:\n// https://help.hotjar.com/hc/en-us/articles/36819973371409-Cookies-Set-by-the-Hotjar-Tracking-Code\n// Note: Short-lived test cookies and two survey cookies are left out.\nexport const hotjar = /* @__PURE__ */ defineVendor({\n id: 'hotjar',\n privacy_policy_url: 'https://www.hotjar.com/legal/policies/privacy/',\n cookies: [\n { name: '_hjSessionUser_*', category: 'statistics', max_age: 365 * DAY },\n { name: '_hjSession_*', category: 'statistics', max_age: 30 * MINUTE },\n { name: '_hjHasCachedUserAttributes', category: 'statistics', max_age: 'session' },\n { name: '_hjUserAttributesHash', category: 'statistics', max_age: 2 * MINUTE },\n {\n name: '_hjUserAttributes',\n category: 'statistics',\n type: 'local_storage',\n max_age: 'persistent',\n },\n { name: 'hjViewportId', category: 'statistics', type: 'session_storage', max_age: 'session' },\n {\n name: 'hjActiveViewportIds',\n category: 'statistics',\n type: 'local_storage',\n max_age: 'session',\n },\n { name: '_hjDonePolls', category: 'statistics', max_age: 365 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// LinkedIn Insight Tag — the cookies a standard integration sets for visitors.\n// Sources:\n// https://www.linkedin.com/legal/l/cookie-table\n// Note: The logged-in-only bscookie and _guid (LinkedIn's own Google Ads) are left out.\nexport const linkedinInsight = /* @__PURE__ */ defineVendor({\n id: 'linkedin_insight',\n privacy_policy_url: 'https://www.linkedin.com/legal/privacy-policy',\n cookies: [\n { name: 'li_fat_id', category: 'marketing', max_age: 30 * DAY },\n { name: 'ln_or', category: 'marketing', max_age: DAY },\n { name: 'bcookie', category: 'marketing', max_age: 365 * DAY },\n { name: 'lidc', category: 'marketing', max_age: DAY },\n { name: 'li_sugr', category: 'marketing', max_age: 90 * DAY },\n { name: 'UserMatchHistory', category: 'marketing', max_age: 30 * DAY },\n { name: 'AnalyticsSyncHistory', category: 'marketing', max_age: 30 * DAY },\n { name: 'li_gc', category: 'necessary', max_age: 180 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// Meta Pixel — the cookies a standard integration sets for visitors.\n// Sources:\n// https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc/\n// https://www.facebook.com/policies/cookies/\n// https://web.archive.org/web/20220522135037/https://www.facebook.com/policies/cookies\n// Note: Meta's current cookie policy names no cookies; the 90-day lifetimes of _fbp / fr come from earlier\n// versions of Meta's own policy, and _fbc's from Meta's Conversions API docs.\nexport const metaPixel = /* @__PURE__ */ defineVendor({\n id: 'meta_pixel',\n privacy_policy_url: 'https://www.facebook.com/privacy/policy/',\n cookies: [\n { name: '_fbp', category: 'marketing', max_age: 90 * DAY },\n { name: '_fbc', category: 'marketing', max_age: 90 * DAY },\n { name: 'fr', category: 'marketing', max_age: 90 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// TikTok Pixel — the cookies a standard integration sets for visitors.\n// Sources:\n// https://ads.tiktok.com/help/article/using-cookies-with-tiktok-pixel\n// Note: TikTok's lifetimes are 13 months from last use (rolling). ttcsid* covers ttcsid and ttcsid_<pixel code>.\nexport const tiktokPixel = /* @__PURE__ */ defineVendor({\n id: 'tiktok_pixel',\n privacy_policy_url: 'https://www.tiktok.com/legal/page/eea/privacy-policy/en',\n cookies: [\n { name: '_ttp', category: 'marketing', max_age: 390 * DAY },\n { name: 'ttcsid*', category: 'marketing', max_age: 390 * DAY },\n { name: 'ttclid', category: 'marketing', max_age: 390 * DAY },\n { name: '_pangle', category: 'marketing', max_age: 390 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY, MINUTE } from './time'\n\n// Vimeo — the cookies a standard integration sets for visitors.\n// Sources:\n// https://help.vimeo.com/hc/en-us/articles/26080940921361-Vimeo-Player-Cookies\n// https://vimeo.com/cookie_policy\n// Note: Feature-specific cookies (passwords, webinars, live chat) are left out; Cloudflare's __cf_bm / _cfuvid /\n// cf_clearance come from Vimeo's own player-cookie article.\nexport const vimeo = /* @__PURE__ */ defineVendor({\n id: 'vimeo',\n privacy_policy_url: 'https://vimeo.com/privacy',\n cookies: [\n { name: 'vuid', category: 'statistics', max_age: 730 * DAY },\n { name: 'player', category: 'preferences', max_age: 365 * DAY },\n { name: 'player_clearance', category: 'necessary', max_age: 7 * DAY },\n { name: '__cf_bm', category: 'necessary', max_age: 30 * MINUTE },\n { name: '_cfuvid', category: 'necessary', max_age: 'session' },\n { name: 'cf_clearance', category: 'necessary', max_age: 365 * DAY },\n ],\n})\n","import { defineVendor } from './define-vendor'\nimport { DAY } from './time'\n\n// YouTube — the cookies a standard integration sets for visitors.\n// Sources:\n// https://policies.google.com/technologies/cookies\n// https://business.safety.google/adscookies/\n// https://support.google.com/youtube/answer/171780\n// https://cookiedatabase.org/\n// Note: Google is moving VISITOR_INFO1_LIVE to __Secure-YNID, so both are listed. youtube-nocookie.com still\n// uses storage, so treat it as needing consent too.\nexport const youtube = /* @__PURE__ */ defineVendor({\n id: 'youtube',\n privacy_policy_url: 'https://policies.google.com/privacy',\n cookies: [\n { name: 'YSC', category: 'marketing', max_age: 'session' },\n { name: '__Secure-YNID', category: 'marketing', max_age: 180 * DAY },\n { name: 'VISITOR_INFO1_LIVE', category: 'marketing', max_age: 180 * DAY },\n { name: '__Secure-YENID', category: 'marketing', max_age: 390 * DAY },\n { name: '__Secure-ROLLOUT_TOKEN', category: 'marketing', max_age: 180 * DAY },\n { name: 'PREF', category: 'preferences', max_age: 240 * DAY },\n ],\n})\n","import { googleAds } from './google-ads'\nimport { googleAnalytics } from './google-analytics'\nimport { googleMaps } from './google-maps'\nimport { googleRecaptcha } from './google-recaptcha'\nimport { hotjar } from './hotjar'\nimport { linkedinInsight } from './linkedin-insight'\nimport { metaPixel } from './meta-pixel'\nimport { tiktokPixel } from './tiktok-pixel'\nimport { vimeo } from './vimeo'\nimport { youtube } from './youtube'\n\n/**\n * Every preset by its id — for when the set of vendors is decided at runtime (a backend that turns\n * integrations on and off sends `\"google_analytics\"`, not code). Importing this map bundles every\n * preset; import the named presets instead when your vendors are fixed in code.\n */\nexport const vendorPresets = {\n google_analytics: googleAnalytics,\n hotjar,\n google_ads: googleAds,\n meta_pixel: metaPixel,\n linkedin_insight: linkedinInsight,\n tiktok_pixel: tiktokPixel,\n youtube,\n vimeo,\n google_maps: googleMaps,\n google_recaptcha: googleRecaptcha,\n} as const\n\n/** The id of a shipped preset — `'google_analytics'`, `'meta_pixel'`, … */\nexport type VendorPresetId = keyof typeof vendorPresets\n","import { type ConsentCategoryId, isConsentCategoryId, REQUIRED_CATEGORY } from '../categories'\nimport { ConsentError } from '../errors'\nimport type { ConsentCategoriesConfig, ConsentCookie, ConsentVendor } from '../types'\nimport { type VendorPresetId, vendorPresets } from './presets'\n\n/**\n * The serializable consent config — what a backend sends when it decides which integrations are on\n * (a back office where an admin enables Google Analytics, or the YouTube embed without tracking).\n * JSON only: per category, the vendors used in it — a preset id, a preset reference narrowed or\n * extended, or a full declaration when there's no preset. A vendor brings only its cookies of the\n * category it's listed under (plus its necessary ones). snake_case, like every dataset.\n *\n * ```json\n * {\n * \"policy_version\": 7,\n * \"categories\": {\n * \"statistics\": [\"google_analytics\"],\n * \"preferences\": [\"youtube\"],\n * \"marketing\": [\n * { \"preset\": \"google_ads\", \"cookies\": [\"_gcl_au\", \"IDE\"] },\n * { \"id\": \"acme_chat\", \"cookies\": [{ \"name\": \"acme_id\", \"category\": \"marketing\", \"max_age\": 31536000000 }] }\n * ]\n * }\n * }\n * ```\n */\nexport interface ConsentConfigData {\n /** Bump it whenever the set of vendors changes, so every visitor is asked again. Default `1`. */\n policy_version?: string | number\n /** How long a decision stays valid, in milliseconds. Default: 365 days. */\n max_age?: number\n /** Per category, the vendors used in it. */\n categories: Partial<Record<ConsentCategoryId, readonly ConsentVendorData[]>>\n}\n\n/** A vendor in the data: a preset id, a preset reference, or a full declaration of your own. */\nexport type ConsentVendorData = VendorPresetId | ConsentPresetVendorData | ConsentVendor\n\n/** A shipped preset by id, optionally narrowed (`cookies`) or extended (`extra`). */\nexport interface ConsentPresetVendorData {\n preset: VendorPresetId\n cookies?: readonly string[]\n extra?: readonly ConsentCookie[]\n}\n\n/** The part of `createConsent`'s config that data describes. */\nexport interface ConsentConfigFromData {\n categories: ConsentCategoriesConfig\n policyVersion?: string | number\n maxAge?: number\n}\n\n/** What only the app knows, merged into the data's config. */\nexport interface ConsentConfigFromDataOptions {\n /**\n * The app's own strictly necessary vendors (its session cookie, CSRF token, the consent record),\n * declared in code. Put under `necessary`, ahead of the data's categories. Once the app declares\n * them, the data may not list `necessary` itself: strictly necessary cookies are the app's to\n * declare, never the backend's.\n */\n necessary?: readonly ConsentVendor[]\n}\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\nfunction presetFor(id: unknown, where: string) {\n if (typeof id === 'string' && Object.hasOwn(vendorPresets, id)) {\n return vendorPresets[id as VendorPresetId] as (\n options?: Record<string, unknown>,\n ) => ConsentVendor\n }\n throw new ConsentError(`${where}: unknown vendor preset \"${String(id)}\".`)\n}\n\nfunction vendorFromData(raw: unknown, where: string): ConsentVendor {\n if (typeof raw === 'string') return presetFor(raw, where)()\n if (!isObject(raw)) throw new ConsentError(`${where}: must be a preset id or an object.`)\n if ('preset' in raw) {\n const preset = presetFor(raw.preset, where)\n if (raw.cookies !== undefined && !Array.isArray(raw.cookies)) {\n throw new ConsentError(`${where} (\"${raw.preset}\"): cookies must be an array of names.`)\n }\n if (raw.extra !== undefined && !Array.isArray(raw.extra)) {\n throw new ConsentError(`${where} (\"${raw.preset}\"): extra must be an array of cookies.`)\n }\n // The preset itself rejects a cookie name it doesn't declare.\n return preset({ cookies: raw.cookies, extra: raw.extra })\n }\n // A full declaration — createConsent validates its id, cookies, categories and lifetimes.\n return raw as unknown as ConsentVendor\n}\n\n/**\n * Turn backend data into `createConsent` options: per category, preset ids and references become\n * full vendor declarations (from `vendorPresets`); full declarations pass through. Pass the app's\n * own strictly necessary vendors as `necessary`, then spread the result and add what else only the\n * app knows:\n *\n * ```ts\n * const consent = createConsent({\n * ...consentConfigFromData(config.consent, { necessary: [mySite] }),\n * onChange,\n * })\n * ```\n *\n * Checks the shape as it goes — the data comes over the wire — and `createConsent` then validates\n * the rest (a vendor without cookies of its category, cookie names, lifetimes).\n *\n * @throws {ConsentError} for a malformed shape, an unknown category or preset, a cookie a preset\n * doesn't declare, or — when the app passes `necessary` — a `necessary` category in the data.\n */\nexport function consentConfigFromData(\n data: ConsentConfigData,\n options: ConsentConfigFromDataOptions = {},\n): ConsentConfigFromData {\n if (!isObject(data)) throw new ConsentError('Consent config data must be an object.')\n if (!isObject(data.categories)) {\n throw new ConsentError('Consent config data needs a \"categories\" object.')\n }\n const categories: Record<string, readonly ConsentVendor[]> = {}\n if (options.necessary !== undefined) {\n if (Object.hasOwn(data.categories, REQUIRED_CATEGORY)) {\n throw new ConsentError(\n `Consent config data may not list \"${REQUIRED_CATEGORY}\": the app declares its strictly necessary vendors itself.`,\n )\n }\n if (!Array.isArray(options.necessary)) {\n throw new ConsentError(`The app's \"${REQUIRED_CATEGORY}\" vendors must be an array.`)\n }\n categories[REQUIRED_CATEGORY] = options.necessary\n }\n for (const [id, list] of Object.entries(data.categories)) {\n if (!isConsentCategoryId(id)) throw new ConsentError(`Unknown consent category \"${id}\".`)\n if (!Array.isArray(list)) throw new ConsentError(`Category \"${id}\": vendors must be an array.`)\n categories[id] = list.map((raw: unknown, index) =>\n vendorFromData(raw, `Category \"${id}\", vendor #${index + 1}`),\n )\n }\n return {\n categories,\n ...(data.policy_version !== undefined ? { policyVersion: data.policy_version } : {}),\n ...(data.max_age !== undefined ? { maxAge: data.max_age } : {}),\n }\n}\n"],"mappings":";;;;;;;;;;AAqCA,SAAgB,aACd,YACiC;CACjC,MAAM,EAAE,IAAI,oBAAoB,YAAY;CAC5C,MAAM,UAAU,UAAkD,CAAC,MAAqB;EACtF,IAAI,SAAmC;EACvC,IAAI,QAAQ,SAAS;GACnB,MAAM,QAAQ,IAAI,IAAI,QAAQ,KAAK,MAAM,EAAE,IAAI,CAAC;GAChD,KAAK,MAAM,QAAQ,QAAQ,SACzB,IAAI,CAAC,MAAM,IAAI,IAAI,GACjB,MAAM,IAAI,aACR,WAAW,GAAG,mBAAmB,KAAK,8BACxC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