@iqworksai/consentiq-react 0.1.4 → 0.1.5
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 +10 -10
- package/dist/index.d.mts +128 -18
- package/dist/index.d.ts +128 -18
- package/dist/index.js +557 -125
- package/dist/index.mjs +549 -121
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23,7 +23,10 @@ __export(index_exports, {
|
|
|
23
23
|
ConsentGate: () => ConsentGate,
|
|
24
24
|
ConsentIQApiClient: () => ConsentIQApiClient,
|
|
25
25
|
ConsentIQProvider: () => ConsentIQProvider,
|
|
26
|
+
ConsentTrigger: () => ConsentTrigger,
|
|
26
27
|
CookieBanner: () => CookieBanner,
|
|
28
|
+
LanguageSelector: () => LanguageSelector,
|
|
29
|
+
MarketingConsentForm: () => MarketingConsentForm,
|
|
27
30
|
PreferenceCenter: () => PreferenceCenter,
|
|
28
31
|
detectCountry: () => detectCountry,
|
|
29
32
|
detectLanguage: () => detectLanguage,
|
|
@@ -32,6 +35,7 @@ __export(index_exports, {
|
|
|
32
35
|
useConsent: () => useConsent,
|
|
33
36
|
useConsentGate: () => useConsentGate,
|
|
34
37
|
useConsentIQ: () => useConsentIQ,
|
|
38
|
+
useFormConsent: () => useFormConsent,
|
|
35
39
|
withConsentGate: () => withConsentGate
|
|
36
40
|
});
|
|
37
41
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -40,7 +44,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
40
44
|
var import_react = require("react");
|
|
41
45
|
|
|
42
46
|
// src/api-client.ts
|
|
43
|
-
var DEFAULT_API_URL = "https://
|
|
47
|
+
var DEFAULT_API_URL = "https://consent.iqworks.ai";
|
|
44
48
|
var ConsentIQApiClient = class {
|
|
45
49
|
constructor(propertyKey, apiUrl, debug = false) {
|
|
46
50
|
this.propertyKey = propertyKey;
|
|
@@ -171,6 +175,10 @@ var DEFAULT_CONSENT = {
|
|
|
171
175
|
social: false
|
|
172
176
|
};
|
|
173
177
|
var CONSENT_STORAGE_KEY = "consentiq_consent";
|
|
178
|
+
var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur", "ps", "sd", "dv", "yi"]);
|
|
179
|
+
function isRtlLanguage(lang) {
|
|
180
|
+
return RTL_LANGUAGES.has(lang.split("-")[0].toLowerCase());
|
|
181
|
+
}
|
|
174
182
|
function ConsentIQProvider({
|
|
175
183
|
children,
|
|
176
184
|
propertyKey,
|
|
@@ -182,6 +190,7 @@ function ConsentIQProvider({
|
|
|
182
190
|
onClose,
|
|
183
191
|
autoShow = true,
|
|
184
192
|
language: preferredLanguage,
|
|
193
|
+
locale,
|
|
185
194
|
debug = false
|
|
186
195
|
}) {
|
|
187
196
|
const [config, setConfig] = (0, import_react.useState)(null);
|
|
@@ -193,7 +202,6 @@ function ConsentIQProvider({
|
|
|
193
202
|
const [language, setLanguage] = (0, import_react.useState)("en");
|
|
194
203
|
const [regulation, setRegulation] = (0, import_react.useState)(null);
|
|
195
204
|
const [subjectId, setSubjectId] = (0, import_react.useState)("");
|
|
196
|
-
const [hasExistingConsent, setHasExistingConsent] = (0, import_react.useState)(false);
|
|
197
205
|
const apiClient = (0, import_react.useMemo)(
|
|
198
206
|
() => new ConsentIQApiClient(propertyKey, apiUrl, debug),
|
|
199
207
|
[propertyKey, apiUrl, debug]
|
|
@@ -223,7 +231,7 @@ function ConsentIQProvider({
|
|
|
223
231
|
setSubjectId(sid);
|
|
224
232
|
const propertyConfig = await apiClient.getConfig();
|
|
225
233
|
setConfig(propertyConfig);
|
|
226
|
-
const detectedLang = preferredLanguage || detectLanguage(propertyConfig.property.supportedLanguages);
|
|
234
|
+
const detectedLang = preferredLanguage || locale || detectLanguage(propertyConfig.property.supportedLanguages);
|
|
227
235
|
setLanguage(detectedLang);
|
|
228
236
|
const country = detectCountry();
|
|
229
237
|
if (country && propertyConfig.geoRules) {
|
|
@@ -242,14 +250,12 @@ function ConsentIQProvider({
|
|
|
242
250
|
if (existingConsent.marketingConsents) {
|
|
243
251
|
setMarketingConsent(existingConsent.marketingConsents);
|
|
244
252
|
}
|
|
245
|
-
setHasExistingConsent(true);
|
|
246
253
|
saveLocalConsent(existingConsent.cookieConsents);
|
|
247
254
|
foundExistingConsent = true;
|
|
248
255
|
} else {
|
|
249
256
|
const localConsent = loadLocalConsent();
|
|
250
257
|
if (localConsent) {
|
|
251
258
|
setConsent(localConsent);
|
|
252
|
-
setHasExistingConsent(true);
|
|
253
259
|
foundExistingConsent = true;
|
|
254
260
|
}
|
|
255
261
|
}
|
|
@@ -271,6 +277,7 @@ function ConsentIQProvider({
|
|
|
271
277
|
providedSubjectId,
|
|
272
278
|
autoGenerateSubjectId,
|
|
273
279
|
preferredLanguage,
|
|
280
|
+
locale,
|
|
274
281
|
autoShow
|
|
275
282
|
]);
|
|
276
283
|
const submitConsent = (0, import_react.useCallback)(
|
|
@@ -319,10 +326,10 @@ function ConsentIQProvider({
|
|
|
319
326
|
allAccepted.social = true;
|
|
320
327
|
}
|
|
321
328
|
setConsent(allAccepted);
|
|
322
|
-
await submitConsent(allAccepted, marketingConsent);
|
|
323
329
|
setIsBannerVisible(false);
|
|
324
330
|
setIsPreferenceCenterVisible(false);
|
|
325
331
|
onClose?.();
|
|
332
|
+
void submitConsent(allAccepted, marketingConsent);
|
|
326
333
|
}, [config, marketingConsent, submitConsent, onClose]);
|
|
327
334
|
const rejectAll = (0, import_react.useCallback)(async () => {
|
|
328
335
|
const allRejected = {
|
|
@@ -334,10 +341,10 @@ function ConsentIQProvider({
|
|
|
334
341
|
social: false
|
|
335
342
|
};
|
|
336
343
|
setConsent(allRejected);
|
|
337
|
-
await submitConsent(allRejected, {});
|
|
338
344
|
setIsBannerVisible(false);
|
|
339
345
|
setIsPreferenceCenterVisible(false);
|
|
340
346
|
onClose?.();
|
|
347
|
+
void submitConsent(allRejected, {});
|
|
341
348
|
}, [submitConsent, onClose]);
|
|
342
349
|
const updateConsent = (0, import_react.useCallback)(
|
|
343
350
|
async (updates) => {
|
|
@@ -348,7 +355,7 @@ function ConsentIQProvider({
|
|
|
348
355
|
// Always enforce necessary
|
|
349
356
|
};
|
|
350
357
|
setConsent(newConsent);
|
|
351
|
-
|
|
358
|
+
void submitConsent(newConsent, marketingConsent);
|
|
352
359
|
},
|
|
353
360
|
[consent, marketingConsent, submitConsent]
|
|
354
361
|
);
|
|
@@ -356,10 +363,13 @@ function ConsentIQProvider({
|
|
|
356
363
|
async (updates) => {
|
|
357
364
|
const newMarketingConsent = { ...marketingConsent, ...updates };
|
|
358
365
|
setMarketingConsent(newMarketingConsent);
|
|
359
|
-
|
|
366
|
+
void submitConsent(consent, newMarketingConsent);
|
|
360
367
|
},
|
|
361
368
|
[consent, marketingConsent, submitConsent]
|
|
362
369
|
);
|
|
370
|
+
const changeLanguage = (0, import_react.useCallback)((lang) => {
|
|
371
|
+
setLanguage(lang);
|
|
372
|
+
}, []);
|
|
363
373
|
const showBanner = (0, import_react.useCallback)(() => {
|
|
364
374
|
setIsBannerVisible(true);
|
|
365
375
|
onOpen?.();
|
|
@@ -380,12 +390,12 @@ function ConsentIQProvider({
|
|
|
380
390
|
const resetConsent = (0, import_react.useCallback)(() => {
|
|
381
391
|
setConsent(DEFAULT_CONSENT);
|
|
382
392
|
setMarketingConsent({});
|
|
383
|
-
setHasExistingConsent(false);
|
|
384
393
|
if (typeof window !== "undefined") {
|
|
385
394
|
localStorage.removeItem(CONSENT_STORAGE_KEY);
|
|
386
395
|
localStorage.removeItem("consentiq_subject_id");
|
|
387
396
|
}
|
|
388
397
|
}, []);
|
|
398
|
+
const dir = isRtlLanguage(language) ? "rtl" : "ltr";
|
|
389
399
|
const contextValue = (0, import_react.useMemo)(
|
|
390
400
|
() => ({
|
|
391
401
|
consent,
|
|
@@ -395,6 +405,8 @@ function ConsentIQProvider({
|
|
|
395
405
|
isBannerVisible,
|
|
396
406
|
isPreferenceCenterVisible,
|
|
397
407
|
language,
|
|
408
|
+
changeLanguage,
|
|
409
|
+
dir,
|
|
398
410
|
regulation,
|
|
399
411
|
hasConsent,
|
|
400
412
|
hasMarketingConsent,
|
|
@@ -416,6 +428,8 @@ function ConsentIQProvider({
|
|
|
416
428
|
isBannerVisible,
|
|
417
429
|
isPreferenceCenterVisible,
|
|
418
430
|
language,
|
|
431
|
+
changeLanguage,
|
|
432
|
+
dir,
|
|
419
433
|
regulation,
|
|
420
434
|
hasConsent,
|
|
421
435
|
hasMarketingConsent,
|
|
@@ -451,14 +465,70 @@ function useConsentGate(category) {
|
|
|
451
465
|
};
|
|
452
466
|
}
|
|
453
467
|
|
|
454
|
-
// src/components/
|
|
468
|
+
// src/components/LanguageSelector.tsx
|
|
455
469
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
470
|
+
function languageLabel(code) {
|
|
471
|
+
try {
|
|
472
|
+
const display = new Intl.DisplayNames([code], { type: "language" });
|
|
473
|
+
const name = display.of(code);
|
|
474
|
+
if (name) {
|
|
475
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
476
|
+
}
|
|
477
|
+
} catch {
|
|
478
|
+
}
|
|
479
|
+
return code.toUpperCase();
|
|
480
|
+
}
|
|
481
|
+
function LanguageSelector({ className, style }) {
|
|
482
|
+
const { config, language, changeLanguage, dir } = useConsentIQ();
|
|
483
|
+
const languages = config?.property.supportedLanguages ?? [];
|
|
484
|
+
if (languages.length <= 1) {
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
const caretSide = dir === "rtl" ? "left" : "right";
|
|
488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
489
|
+
"select",
|
|
490
|
+
{
|
|
491
|
+
className,
|
|
492
|
+
value: language,
|
|
493
|
+
onChange: (e) => changeLanguage(e.target.value),
|
|
494
|
+
"aria-label": "Language",
|
|
495
|
+
style: {
|
|
496
|
+
appearance: "none",
|
|
497
|
+
WebkitAppearance: "none",
|
|
498
|
+
MozAppearance: "none",
|
|
499
|
+
backgroundColor: "rgba(127, 127, 127, 0.12)",
|
|
500
|
+
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")`,
|
|
501
|
+
backgroundRepeat: "no-repeat",
|
|
502
|
+
backgroundPosition: `${caretSide} 0.45rem center`,
|
|
503
|
+
backgroundSize: "0.65rem",
|
|
504
|
+
border: "1px solid rgba(127, 127, 127, 0.3)",
|
|
505
|
+
borderRadius: "0.375rem",
|
|
506
|
+
color: "inherit",
|
|
507
|
+
fontFamily: "inherit",
|
|
508
|
+
fontSize: "0.75rem",
|
|
509
|
+
fontWeight: 500,
|
|
510
|
+
lineHeight: 1.2,
|
|
511
|
+
cursor: "pointer",
|
|
512
|
+
outline: "none",
|
|
513
|
+
paddingBlock: "0.3rem",
|
|
514
|
+
paddingInlineStart: "0.6rem",
|
|
515
|
+
paddingInlineEnd: "1.5rem",
|
|
516
|
+
...style
|
|
517
|
+
},
|
|
518
|
+
children: languages.map((code) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: code, style: { color: "#18181b" }, children: languageLabel(code) }, code))
|
|
519
|
+
}
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
// src/components/CookieBanner.tsx
|
|
524
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
456
525
|
function CookieBanner({ className, position, theme, style }) {
|
|
457
526
|
const {
|
|
458
527
|
config,
|
|
459
528
|
isBannerVisible,
|
|
460
529
|
isLoading,
|
|
461
530
|
language,
|
|
531
|
+
dir,
|
|
462
532
|
acceptAll,
|
|
463
533
|
rejectAll,
|
|
464
534
|
showPreferenceCenter
|
|
@@ -468,7 +538,8 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
468
538
|
}
|
|
469
539
|
const bannerConfig = config.banner;
|
|
470
540
|
const translations = config.translations[language] || config.translations[config.property.defaultLanguage] || {};
|
|
471
|
-
const
|
|
541
|
+
const requestedPosition = position || bannerConfig.position || "bottom";
|
|
542
|
+
const resolvedPosition = dir === "rtl" ? requestedPosition === "bottom-left" ? "bottom-right" : requestedPosition === "bottom-right" ? "bottom-left" : requestedPosition : requestedPosition;
|
|
472
543
|
const resolvedTheme = theme || bannerConfig.theme || "dark";
|
|
473
544
|
const effectiveTheme = resolvedTheme === "auto" ? typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : resolvedTheme;
|
|
474
545
|
const positionStyles = {
|
|
@@ -487,14 +558,14 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
487
558
|
}
|
|
488
559
|
};
|
|
489
560
|
const themeStyles = {
|
|
490
|
-
backgroundColor: effectiveTheme === "dark" ? "#
|
|
491
|
-
color: effectiveTheme === "dark" ? "#
|
|
561
|
+
backgroundColor: effectiveTheme === "dark" ? "#09090b" : "#ffffff",
|
|
562
|
+
color: effectiveTheme === "dark" ? "#f4f4f5" : "#27272a",
|
|
492
563
|
borderWidth: "1px",
|
|
493
564
|
borderStyle: "solid",
|
|
494
|
-
borderColor: effectiveTheme === "dark" ? "#
|
|
565
|
+
borderColor: effectiveTheme === "dark" ? "#3f3f46" : "#e4e4e7"
|
|
495
566
|
};
|
|
496
567
|
const buttonPrimaryStyle = {
|
|
497
|
-
backgroundColor: bannerConfig.primaryColor || "#
|
|
568
|
+
backgroundColor: bannerConfig.primaryColor || "#ff6a00",
|
|
498
569
|
color: "#ffffff",
|
|
499
570
|
padding: "0.5rem 1rem",
|
|
500
571
|
borderRadius: "0.5rem",
|
|
@@ -504,8 +575,8 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
504
575
|
fontSize: "0.875rem"
|
|
505
576
|
};
|
|
506
577
|
const buttonSecondaryStyle = {
|
|
507
|
-
backgroundColor: effectiveTheme === "dark" ? "#
|
|
508
|
-
color: effectiveTheme === "dark" ? "#
|
|
578
|
+
backgroundColor: effectiveTheme === "dark" ? "#52525b" : "#e4e4e7",
|
|
579
|
+
color: effectiveTheme === "dark" ? "#f4f4f5" : "#27272a",
|
|
509
580
|
padding: "0.5rem 1rem",
|
|
510
581
|
borderRadius: "0.5rem",
|
|
511
582
|
border: "none",
|
|
@@ -516,13 +587,13 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
516
587
|
const buttonLinkStyle = {
|
|
517
588
|
background: "none",
|
|
518
589
|
border: "none",
|
|
519
|
-
color: effectiveTheme === "dark" ? "#
|
|
590
|
+
color: effectiveTheme === "dark" ? "#a1a1aa" : "#71717a",
|
|
520
591
|
cursor: "pointer",
|
|
521
592
|
fontSize: "0.875rem",
|
|
522
593
|
padding: "0.5rem"
|
|
523
594
|
};
|
|
524
|
-
return /* @__PURE__ */ (0,
|
|
525
|
-
resolvedPosition === "center" && /* @__PURE__ */ (0,
|
|
595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
596
|
+
resolvedPosition === "center" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
526
597
|
"div",
|
|
527
598
|
{
|
|
528
599
|
style: {
|
|
@@ -533,7 +604,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
533
604
|
}
|
|
534
605
|
}
|
|
535
606
|
),
|
|
536
|
-
/* @__PURE__ */ (0,
|
|
607
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
537
608
|
"div",
|
|
538
609
|
{
|
|
539
610
|
className,
|
|
@@ -549,8 +620,9 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
549
620
|
role: "dialog",
|
|
550
621
|
"aria-label": "Cookie consent",
|
|
551
622
|
"aria-modal": resolvedPosition === "center",
|
|
623
|
+
dir,
|
|
552
624
|
children: [
|
|
553
|
-
bannerConfig.showLogo && bannerConfig.logoUrl && /* @__PURE__ */ (0,
|
|
625
|
+
bannerConfig.showLogo && bannerConfig.logoUrl && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
554
626
|
"img",
|
|
555
627
|
{
|
|
556
628
|
src: bannerConfig.logoUrl,
|
|
@@ -558,7 +630,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
558
630
|
style: { height: "1.5rem", marginBottom: "0.75rem" }
|
|
559
631
|
}
|
|
560
632
|
),
|
|
561
|
-
translations.bannerTitle && /* @__PURE__ */ (0,
|
|
633
|
+
translations.bannerTitle && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
562
634
|
"h2",
|
|
563
635
|
{
|
|
564
636
|
style: {
|
|
@@ -570,7 +642,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
570
642
|
children: translations.bannerTitle
|
|
571
643
|
}
|
|
572
644
|
),
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
645
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
574
646
|
"p",
|
|
575
647
|
{
|
|
576
648
|
style: {
|
|
@@ -582,7 +654,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
582
654
|
children: translations.bannerDescription || "We use cookies to enhance your experience. By continuing, you agree to our use of cookies."
|
|
583
655
|
}
|
|
584
656
|
),
|
|
585
|
-
/* @__PURE__ */ (0,
|
|
657
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
586
658
|
"div",
|
|
587
659
|
{
|
|
588
660
|
style: {
|
|
@@ -592,7 +664,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
592
664
|
alignItems: "center"
|
|
593
665
|
},
|
|
594
666
|
children: [
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
667
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
596
668
|
"button",
|
|
597
669
|
{
|
|
598
670
|
onClick: acceptAll,
|
|
@@ -601,7 +673,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
601
673
|
children: translations.acceptAllText || "Accept All"
|
|
602
674
|
}
|
|
603
675
|
),
|
|
604
|
-
/* @__PURE__ */ (0,
|
|
676
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
605
677
|
"button",
|
|
606
678
|
{
|
|
607
679
|
onClick: rejectAll,
|
|
@@ -610,7 +682,7 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
610
682
|
children: translations.rejectAllText || "Reject All"
|
|
611
683
|
}
|
|
612
684
|
),
|
|
613
|
-
/* @__PURE__ */ (0,
|
|
685
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
614
686
|
"button",
|
|
615
687
|
{
|
|
616
688
|
onClick: showPreferenceCenter,
|
|
@@ -618,7 +690,8 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
618
690
|
type: "button",
|
|
619
691
|
children: translations.customizeText || "Customize"
|
|
620
692
|
}
|
|
621
|
-
)
|
|
693
|
+
),
|
|
694
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LanguageSelector, { style: { marginInlineStart: "auto" } })
|
|
622
695
|
]
|
|
623
696
|
}
|
|
624
697
|
)
|
|
@@ -628,9 +701,91 @@ function CookieBanner({ className, position, theme, style }) {
|
|
|
628
701
|
] });
|
|
629
702
|
}
|
|
630
703
|
|
|
631
|
-
// src/components/
|
|
704
|
+
// src/components/ConsentTrigger.tsx
|
|
632
705
|
var import_react2 = require("react");
|
|
633
|
-
var
|
|
706
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
707
|
+
function ConsentTrigger({
|
|
708
|
+
className,
|
|
709
|
+
position = "bottom-left",
|
|
710
|
+
theme,
|
|
711
|
+
style,
|
|
712
|
+
label = "Cookie preferences"
|
|
713
|
+
}) {
|
|
714
|
+
const { config, isLoading, isBannerVisible, isPreferenceCenterVisible, showPreferenceCenter, dir } = useConsentIQ();
|
|
715
|
+
const [hovered, setHovered] = (0, import_react2.useState)(false);
|
|
716
|
+
if (isLoading || isBannerVisible || isPreferenceCenterVisible) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
const bannerConfig = config?.banner;
|
|
720
|
+
const resolvedTheme = theme || bannerConfig?.theme || "dark";
|
|
721
|
+
const effectiveTheme = resolvedTheme === "auto" ? typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : resolvedTheme;
|
|
722
|
+
const accent = bannerConfig?.primaryColor || "#ff6a00";
|
|
723
|
+
const corner = dir === "rtl" ? position === "bottom-right" ? "bottom-left" : "bottom-right" : position;
|
|
724
|
+
const cornerStyles = corner === "bottom-right" ? { right: "1rem" } : { left: "1rem" };
|
|
725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
726
|
+
"button",
|
|
727
|
+
{
|
|
728
|
+
type: "button",
|
|
729
|
+
className,
|
|
730
|
+
onClick: showPreferenceCenter,
|
|
731
|
+
onMouseEnter: () => setHovered(true),
|
|
732
|
+
onMouseLeave: () => setHovered(false),
|
|
733
|
+
onFocus: () => setHovered(true),
|
|
734
|
+
onBlur: () => setHovered(false),
|
|
735
|
+
"aria-label": label,
|
|
736
|
+
title: label,
|
|
737
|
+
style: {
|
|
738
|
+
position: "fixed",
|
|
739
|
+
bottom: "1rem",
|
|
740
|
+
...cornerStyles,
|
|
741
|
+
zIndex: 9997,
|
|
742
|
+
width: "3rem",
|
|
743
|
+
height: "3rem",
|
|
744
|
+
padding: 0,
|
|
745
|
+
borderRadius: "9999px",
|
|
746
|
+
display: "flex",
|
|
747
|
+
alignItems: "center",
|
|
748
|
+
justifyContent: "center",
|
|
749
|
+
cursor: "pointer",
|
|
750
|
+
backgroundColor: effectiveTheme === "dark" ? "#09090b" : "#ffffff",
|
|
751
|
+
color: accent,
|
|
752
|
+
borderWidth: "1px",
|
|
753
|
+
borderStyle: "solid",
|
|
754
|
+
borderColor: effectiveTheme === "dark" ? "#3f3f46" : "#e4e4e7",
|
|
755
|
+
boxShadow: hovered ? "0 6px 16px -2px rgba(0, 0, 0, 0.2)" : "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
|
756
|
+
transform: hovered ? "scale(1.05)" : "scale(1)",
|
|
757
|
+
transition: "transform 0.15s ease, box-shadow 0.15s ease",
|
|
758
|
+
...style
|
|
759
|
+
},
|
|
760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
761
|
+
"svg",
|
|
762
|
+
{
|
|
763
|
+
width: "22",
|
|
764
|
+
height: "22",
|
|
765
|
+
viewBox: "0 0 24 24",
|
|
766
|
+
fill: "none",
|
|
767
|
+
stroke: "currentColor",
|
|
768
|
+
strokeWidth: "2",
|
|
769
|
+
strokeLinecap: "round",
|
|
770
|
+
strokeLinejoin: "round",
|
|
771
|
+
"aria-hidden": "true",
|
|
772
|
+
children: [
|
|
773
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5Z" }),
|
|
774
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M8.5 8.5v.01" }),
|
|
775
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M16 15.5v.01" }),
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M12 12v.01" }),
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M11 17v.01" }),
|
|
778
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M7 14v.01" })
|
|
779
|
+
]
|
|
780
|
+
}
|
|
781
|
+
)
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// src/components/PreferenceCenter.tsx
|
|
787
|
+
var import_react3 = require("react");
|
|
788
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
634
789
|
function PreferenceCenter({ className, theme, style }) {
|
|
635
790
|
const {
|
|
636
791
|
config,
|
|
@@ -638,11 +793,12 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
638
793
|
isPreferenceCenterVisible,
|
|
639
794
|
isLoading,
|
|
640
795
|
language,
|
|
796
|
+
dir,
|
|
641
797
|
updateConsent,
|
|
642
798
|
hidePreferenceCenter
|
|
643
799
|
} = useConsentIQ();
|
|
644
|
-
const [localConsent, setLocalConsent] = (0,
|
|
645
|
-
(0,
|
|
800
|
+
const [localConsent, setLocalConsent] = (0, import_react3.useState)(consent);
|
|
801
|
+
(0, import_react3.useEffect)(() => {
|
|
646
802
|
setLocalConsent(consent);
|
|
647
803
|
}, [consent]);
|
|
648
804
|
if (isLoading || !isPreferenceCenterVisible || !config) {
|
|
@@ -707,8 +863,8 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
707
863
|
};
|
|
708
864
|
const modalStyle = {
|
|
709
865
|
position: "relative",
|
|
710
|
-
backgroundColor: isDark ? "#
|
|
711
|
-
color: isDark ? "#
|
|
866
|
+
backgroundColor: isDark ? "#09090b" : "#ffffff",
|
|
867
|
+
color: isDark ? "#f4f4f5" : "#27272a",
|
|
712
868
|
borderRadius: "0.75rem",
|
|
713
869
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
714
870
|
maxWidth: "600px",
|
|
@@ -722,7 +878,7 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
722
878
|
};
|
|
723
879
|
const headerStyle = {
|
|
724
880
|
padding: "1rem 1.5rem",
|
|
725
|
-
borderBottom: `1px solid ${isDark ? "#
|
|
881
|
+
borderBottom: `1px solid ${isDark ? "#3f3f46" : "#e4e4e7"}`,
|
|
726
882
|
display: "flex",
|
|
727
883
|
justifyContent: "space-between",
|
|
728
884
|
alignItems: "center"
|
|
@@ -734,14 +890,14 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
734
890
|
};
|
|
735
891
|
const footerStyle = {
|
|
736
892
|
padding: "1rem 1.5rem",
|
|
737
|
-
borderTop: `1px solid ${isDark ? "#
|
|
893
|
+
borderTop: `1px solid ${isDark ? "#3f3f46" : "#e4e4e7"}`,
|
|
738
894
|
display: "flex",
|
|
739
895
|
gap: "0.5rem",
|
|
740
896
|
justifyContent: "flex-end"
|
|
741
897
|
};
|
|
742
898
|
const categoryStyle = {
|
|
743
899
|
padding: "1rem",
|
|
744
|
-
backgroundColor: isDark ? "#
|
|
900
|
+
backgroundColor: isDark ? "#18181b" : "#fafafa",
|
|
745
901
|
borderRadius: "0.5rem",
|
|
746
902
|
marginBottom: "0.75rem"
|
|
747
903
|
};
|
|
@@ -751,7 +907,7 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
751
907
|
justifyContent: "space-between"
|
|
752
908
|
};
|
|
753
909
|
const buttonPrimaryStyle = {
|
|
754
|
-
backgroundColor: bannerConfig.primaryColor || "#
|
|
910
|
+
backgroundColor: bannerConfig.primaryColor || "#ff6a00",
|
|
755
911
|
color: "#ffffff",
|
|
756
912
|
padding: "0.5rem 1rem",
|
|
757
913
|
borderRadius: "0.5rem",
|
|
@@ -761,8 +917,8 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
761
917
|
fontSize: "0.875rem"
|
|
762
918
|
};
|
|
763
919
|
const buttonSecondaryStyle = {
|
|
764
|
-
backgroundColor: isDark ? "#
|
|
765
|
-
color: isDark ? "#
|
|
920
|
+
backgroundColor: isDark ? "#52525b" : "#e4e4e7",
|
|
921
|
+
color: isDark ? "#f4f4f5" : "#27272a",
|
|
766
922
|
padding: "0.5rem 1rem",
|
|
767
923
|
borderRadius: "0.5rem",
|
|
768
924
|
border: "none",
|
|
@@ -773,47 +929,59 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
773
929
|
const buttonTextStyle = {
|
|
774
930
|
background: "none",
|
|
775
931
|
border: "none",
|
|
776
|
-
color:
|
|
932
|
+
color: bannerConfig.primaryColor || "#ff6a00",
|
|
777
933
|
cursor: "pointer",
|
|
778
934
|
fontSize: "0.875rem",
|
|
779
|
-
|
|
935
|
+
fontWeight: 500,
|
|
936
|
+
padding: 0,
|
|
937
|
+
textDecoration: "underline",
|
|
938
|
+
textUnderlineOffset: "2px"
|
|
780
939
|
};
|
|
781
|
-
return /* @__PURE__ */ (0,
|
|
782
|
-
/* @__PURE__ */ (0,
|
|
783
|
-
/* @__PURE__ */ (0,
|
|
784
|
-
/* @__PURE__ */ (0,
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: containerStyle, className, children: [
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: backdropStyle, onClick: hidePreferenceCenter }),
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: modalStyle, role: "dialog", "aria-modal": "true", "aria-label": "Cookie preferences", dir, children: [
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: headerStyle, children: [
|
|
944
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { style: { margin: 0, fontSize: "1.25rem", fontWeight: 600, lineHeight: 1 }, children: "Cookie Preferences" }),
|
|
945
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.875rem" }, children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LanguageSelector, {}),
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
948
|
+
"button",
|
|
949
|
+
{
|
|
950
|
+
onClick: hidePreferenceCenter,
|
|
951
|
+
style: {
|
|
952
|
+
display: "flex",
|
|
953
|
+
alignItems: "center",
|
|
954
|
+
justifyContent: "center",
|
|
955
|
+
width: "1.75rem",
|
|
956
|
+
height: "1.75rem",
|
|
957
|
+
padding: 0,
|
|
958
|
+
background: "none",
|
|
959
|
+
border: "none",
|
|
960
|
+
fontSize: "1.5rem",
|
|
961
|
+
cursor: "pointer",
|
|
962
|
+
color: isDark ? "#a1a1aa" : "#71717a",
|
|
963
|
+
lineHeight: 1
|
|
964
|
+
},
|
|
965
|
+
"aria-label": "Close",
|
|
966
|
+
type: "button",
|
|
967
|
+
children: "\xD7"
|
|
968
|
+
}
|
|
969
|
+
)
|
|
970
|
+
] })
|
|
803
971
|
] }),
|
|
804
|
-
/* @__PURE__ */ (0,
|
|
805
|
-
/* @__PURE__ */ (0,
|
|
806
|
-
/* @__PURE__ */ (0,
|
|
807
|
-
/* @__PURE__ */ (0,
|
|
808
|
-
/* @__PURE__ */ (0,
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: bodyStyle, children: [
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: { marginTop: 0, marginBottom: "1.5rem", opacity: 0.8, fontSize: "0.875rem" }, children: translations.bannerDescription || "Manage your cookie preferences. Some cookies are essential for the site to function properly." }),
|
|
974
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", gap: "1rem", marginBottom: "1.5rem" }, children: [
|
|
975
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: handleAcceptAll, style: buttonTextStyle, type: "button", children: "Enable All" }),
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: handleRejectAll, style: buttonTextStyle, type: "button", children: "Disable All" })
|
|
809
977
|
] }),
|
|
810
978
|
config.categories.filter((cat) => cat.enabled).map((category) => {
|
|
811
979
|
const categoryTranslation = translations.categories?.[category.code];
|
|
812
980
|
const isEnabled = localConsent[category.code] ?? category.defaultState;
|
|
813
|
-
return /* @__PURE__ */ (0,
|
|
814
|
-
/* @__PURE__ */ (0,
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: categoryStyle, children: [
|
|
982
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: toggleContainerStyle, children: [
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "baseline", flexWrap: "wrap" }, children: [
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
817
985
|
"h3",
|
|
818
986
|
{
|
|
819
987
|
style: {
|
|
@@ -824,19 +992,19 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
824
992
|
children: categoryTranslation?.title || category.name
|
|
825
993
|
}
|
|
826
994
|
),
|
|
827
|
-
category.isRequired && /* @__PURE__ */ (0,
|
|
995
|
+
category.isRequired && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
828
996
|
"span",
|
|
829
997
|
{
|
|
830
998
|
style: {
|
|
831
999
|
fontSize: "0.75rem",
|
|
832
|
-
color: isDark ? "#
|
|
1000
|
+
color: isDark ? "#a1a1aa" : "#71717a",
|
|
833
1001
|
marginLeft: "0.5rem"
|
|
834
1002
|
},
|
|
835
1003
|
children: "(Required)"
|
|
836
1004
|
}
|
|
837
1005
|
)
|
|
838
1006
|
] }),
|
|
839
|
-
/* @__PURE__ */ (0,
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
840
1008
|
Toggle,
|
|
841
1009
|
{
|
|
842
1010
|
checked: isEnabled,
|
|
@@ -846,7 +1014,7 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
846
1014
|
}
|
|
847
1015
|
)
|
|
848
1016
|
] }),
|
|
849
|
-
/* @__PURE__ */ (0,
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
850
1018
|
"p",
|
|
851
1019
|
{
|
|
852
1020
|
style: {
|
|
@@ -860,14 +1028,14 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
860
1028
|
] }, category.code);
|
|
861
1029
|
})
|
|
862
1030
|
] }),
|
|
863
|
-
/* @__PURE__ */ (0,
|
|
864
|
-
/* @__PURE__ */ (0,
|
|
865
|
-
/* @__PURE__ */ (0,
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: footerStyle, children: [
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: hidePreferenceCenter, style: buttonSecondaryStyle, type: "button", children: "Cancel" }),
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { onClick: handleSave, style: buttonPrimaryStyle, type: "button", children: translations.savePreferencesText || "Save Preferences" })
|
|
866
1034
|
] }),
|
|
867
|
-
/* @__PURE__ */ (0,
|
|
1035
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
|
|
868
1036
|
padding: "0.5rem 1.5rem 0.75rem",
|
|
869
1037
|
textAlign: "center"
|
|
870
|
-
}, children: /* @__PURE__ */ (0,
|
|
1038
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
871
1039
|
"a",
|
|
872
1040
|
{
|
|
873
1041
|
href: "https://consent.iqworks.ai",
|
|
@@ -878,12 +1046,12 @@ function PreferenceCenter({ className, theme, style }) {
|
|
|
878
1046
|
alignItems: "center",
|
|
879
1047
|
gap: "0.35rem",
|
|
880
1048
|
fontSize: "0.7rem",
|
|
881
|
-
color: isDark ? "#
|
|
1049
|
+
color: isDark ? "#71717a" : "#a1a1aa",
|
|
882
1050
|
textDecoration: "none"
|
|
883
1051
|
},
|
|
884
1052
|
children: [
|
|
885
1053
|
"Powered by",
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ConsentIQLogo, { isDark })
|
|
887
1055
|
]
|
|
888
1056
|
}
|
|
889
1057
|
) })
|
|
@@ -900,7 +1068,7 @@ function Toggle({
|
|
|
900
1068
|
position: "relative",
|
|
901
1069
|
width: "44px",
|
|
902
1070
|
height: "24px",
|
|
903
|
-
backgroundColor: checked ? primaryColor || "#
|
|
1071
|
+
backgroundColor: checked ? primaryColor || "#ff6a00" : "#a1a1aa",
|
|
904
1072
|
borderRadius: "12px",
|
|
905
1073
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
906
1074
|
opacity: disabled ? 0.5 : 1,
|
|
@@ -909,15 +1077,15 @@ function Toggle({
|
|
|
909
1077
|
const thumbStyle = {
|
|
910
1078
|
position: "absolute",
|
|
911
1079
|
top: "2px",
|
|
912
|
-
|
|
1080
|
+
insetInlineStart: checked ? "22px" : "2px",
|
|
913
1081
|
width: "20px",
|
|
914
1082
|
height: "20px",
|
|
915
1083
|
backgroundColor: "#ffffff",
|
|
916
1084
|
borderRadius: "50%",
|
|
917
|
-
transition: "
|
|
1085
|
+
transition: "inset-inline-start 0.2s",
|
|
918
1086
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.2)"
|
|
919
1087
|
};
|
|
920
|
-
return /* @__PURE__ */ (0,
|
|
1088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
921
1089
|
"button",
|
|
922
1090
|
{
|
|
923
1091
|
type: "button",
|
|
@@ -926,47 +1094,47 @@ function Toggle({
|
|
|
926
1094
|
onClick: disabled ? void 0 : onChange,
|
|
927
1095
|
style: trackStyle,
|
|
928
1096
|
disabled,
|
|
929
|
-
children: /* @__PURE__ */ (0,
|
|
1097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: thumbStyle })
|
|
930
1098
|
}
|
|
931
1099
|
);
|
|
932
1100
|
}
|
|
933
1101
|
function ConsentIQLogo({ isDark }) {
|
|
934
1102
|
if (isDark) {
|
|
935
|
-
return /* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
937
|
-
/* @__PURE__ */ (0,
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
/* @__PURE__ */ (0,
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
942
|
-
/* @__PURE__ */ (0,
|
|
943
|
-
/* @__PURE__ */ (0,
|
|
944
|
-
/* @__PURE__ */ (0,
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
946
|
-
/* @__PURE__ */ (0,
|
|
947
|
-
/* @__PURE__ */ (0,
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
1103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "80", height: "14", viewBox: "0 0 487 85", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M49.3323 11.8633L41.634 7.59045L12.417 24.7048C9.84034 52.4047 19.3957 71.4081 35.7685 82.4129C20.9524 65.4494 18.5009 39.8252 19.664 29.2678L49.3323 11.8633Z", fill: "#FF6503" }),
|
|
1105
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M58.8505 6.18471L51.0667 2.15857L43.3711 6.59458L50.9943 10.8186L58.8505 6.18471Z", fill: "white" }),
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M28.2107 33.8309C24.131 59.3834 31.5211 76.8658 35.7261 82.413C35.7261 82.413 34.4207 77.3773 33.847 74.0981C31.4064 60.1473 32.3708 50.2576 35.1891 37.8571L66.0559 20.1421C65.3617 30.7093 59.5471 53.4338 42.7104 68.3178C50.6824 64.6214 61.1777 58.5798 64.854 51.8087C64.6636 52.2227 66.2567 49.3651 66.0559 49.771C73.3369 35.6413 74.3274 23.7642 74.3767 15.0422L66.8613 10.7477L28.2107 33.8309Z", fill: "#FF6503" }),
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M63.7104 54.4578C57.4728 65.6025 33.8945 74.3768 33.8945 74.3768C33.8945 74.3768 34.1088 75.8873 34.643 78.0695C35.1772 80.2517 35.7138 82.3943 35.7138 82.3943C43.4068 78.4438 55.3104 70.2184 63.7104 54.4578Z", fill: "white" }),
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M473.855 85V60.5074C472.26 61.7151 470.473 62.6571 468.492 63.3334C466.512 64.0581 464.362 64.4204 462.043 64.4204C457.985 64.4204 454.314 63.3817 451.029 61.3045C447.744 59.2272 445.111 56.4736 443.13 53.0436C441.198 49.5654 440.231 45.7248 440.231 41.5219C440.231 37.319 441.198 33.4784 443.13 30.0002C445.111 26.5219 447.744 23.7683 451.029 21.7393C454.314 19.6621 457.985 18.6234 462.043 18.6234C464.797 18.6234 467.333 19.1065 469.652 20.0727C471.97 21.0389 473.951 22.3674 475.594 24.0582V19.7828H486.463V85H473.855ZM463.492 53.3335C465.618 53.3335 467.55 52.8021 469.289 51.7393C471.028 50.6765 472.405 49.2513 473.42 47.4639C474.483 45.6765 475.014 43.6958 475.014 41.5219C475.014 39.348 474.483 37.3673 473.42 35.5799C472.405 33.7925 471.028 32.3673 469.289 31.3045C467.55 30.2417 465.618 29.7103 463.492 29.7103C461.367 29.7103 459.434 30.2417 457.695 31.3045C455.956 32.3673 454.555 33.7925 453.492 35.5799C452.478 37.3673 451.971 39.348 451.971 41.5219C451.971 43.6958 452.478 45.6765 453.492 47.4639C454.555 49.2513 455.956 50.6765 457.695 51.7393C459.434 52.8021 461.367 53.3335 463.492 53.3335Z", fill: "#FF6503" }),
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M420.133 63.2607V19.7826H432.742V63.2607H420.133ZM426.437 13.4782C424.553 13.4782 422.959 12.826 421.655 11.5217C420.35 10.2174 419.698 8.62316 419.698 6.73911C419.698 4.80675 420.35 3.21255 421.655 1.95651C422.959 0.65217 424.553 0 426.437 0C428.37 0 429.964 0.65217 431.22 1.95651C432.524 3.21255 433.176 4.80675 433.176 6.73911C433.176 8.62316 432.524 10.2174 431.22 11.5217C429.964 12.826 428.37 13.4782 426.437 13.4782Z", fill: "#FF6503" }),
|
|
1110
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M392.451 63.2607V29.7825H384.335V19.7825H392.668V5.28979H404.842V19.7825H413.465V29.7825H405.06V63.2607H392.451Z", fill: "white" }),
|
|
1111
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M338.059 63.2605V19.7824H349.363V24.565C350.909 22.536 352.817 20.9901 355.088 19.9273C357.358 18.8645 359.798 18.3331 362.406 18.3331C365.498 18.3331 368.373 19.0819 371.03 20.5795C373.735 22.0288 375.909 24.1785 377.551 27.0288C379.242 29.8307 380.087 33.2365 380.087 37.2461V63.2605H367.479V38.9128C367.479 36.4973 366.754 34.3476 365.305 32.4635C363.856 30.5795 361.778 29.6374 359.073 29.6374C356.899 29.6374 354.943 30.3862 353.203 31.8838C351.513 33.3331 350.667 35.6278 350.667 38.7679V63.2605H338.059Z", fill: "white" }),
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M310.56 64.7098C305.68 64.7098 301.381 63.6953 297.661 61.6664C293.941 59.6374 291.043 56.8596 288.966 53.333C286.888 49.7582 285.85 45.6761 285.85 41.0867C285.85 36.6906 286.864 32.8017 288.893 29.4201C290.922 25.9901 293.652 23.2848 297.081 21.3041C300.56 19.3235 304.4 18.3331 308.603 18.3331C312.903 18.3331 316.743 19.3235 320.125 21.3041C323.507 23.2365 326.164 25.8935 328.096 29.2751C330.077 32.6568 331.067 36.4973 331.067 40.7968V45.2171H304.545C303.337 45.2171 302.178 45.1447 301.067 44.9997C299.956 44.8548 298.845 44.6857 297.734 44.4925C298.313 47.391 299.738 49.7582 302.009 51.5939C304.328 53.3813 307.275 54.2751 310.85 54.2751C313.603 54.2751 316.067 53.7195 318.241 52.6084C320.463 51.4973 322.275 50.1205 323.676 48.478L326.429 59.7823C324.255 61.4248 321.792 62.6567 319.038 63.4779C316.333 64.2992 313.507 64.7098 310.56 64.7098ZM297.444 36.8838C299.859 36.3524 302.226 36.0867 304.545 36.0867H312.226C313.579 36.0867 314.859 36.135 316.067 36.2316C317.275 36.3283 318.41 36.4973 319.473 36.7389C318.748 34.1302 317.42 32.0771 315.487 30.5795C313.603 29.0819 311.26 28.3331 308.458 28.3331C305.801 28.3331 303.482 29.1061 301.502 30.6519C299.569 32.1495 298.217 34.2268 297.444 36.8838Z", fill: "white" }),
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M263.884 64.7098C260.937 64.7098 257.942 64.2267 254.898 63.2605C251.903 62.2944 249.56 60.99 247.869 59.3475L250.985 47.4635C252.386 49.3959 254.318 51.0867 256.782 52.5359C259.294 53.9852 261.879 54.7098 264.536 54.7098C266.323 54.7098 267.603 54.3717 268.376 53.6954C269.198 53.019 269.608 52.1978 269.608 51.2316C269.608 50.1205 269.198 49.3234 268.376 48.8403C267.555 48.3089 266.71 47.8741 265.84 47.536L259.753 45.2171C258.401 44.6857 256.855 43.9611 255.115 43.0432C253.376 42.1253 251.855 40.821 250.55 39.1302C249.294 37.4394 248.666 35.2171 248.666 32.4635C248.666 29.9515 249.294 27.6326 250.55 25.507C251.806 23.3814 253.618 21.6665 255.985 20.3621C258.401 19.0095 261.299 18.3331 264.681 18.3331C267.821 18.3331 270.743 18.8645 273.449 19.9273C276.202 20.9901 278.207 22.1737 279.463 23.478L276.565 34.9273C274.922 32.8017 272.966 31.1833 270.695 30.0722C268.473 28.9128 266.347 28.3331 264.318 28.3331C262.772 28.3331 261.637 28.6471 260.913 29.2751C260.188 29.9031 259.826 30.6278 259.826 31.449C259.826 32.0771 260.067 32.7051 260.55 33.3331C261.082 33.9128 261.951 34.4442 263.159 34.9273L268.811 37.0287C270.454 37.6084 272.193 38.3814 274.028 39.3476C275.913 40.3137 277.507 41.6664 278.811 43.4055C280.115 45.0963 280.768 47.4393 280.768 50.4345C280.768 54.6374 279.198 58.0673 276.057 60.7243C272.966 63.3813 268.908 64.7098 263.884 64.7098Z", fill: "white" }),
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M198.861 63.2605V19.7824H210.166V24.565C211.712 22.536 213.62 20.9901 215.89 19.9273C218.161 18.8645 220.6 18.3331 223.209 18.3331C226.301 18.3331 229.175 19.0819 231.832 20.5795C234.538 22.0288 236.711 24.1785 238.354 27.0288C240.045 29.8307 240.89 33.2365 240.89 37.2461V63.2605H228.282V38.9128C228.282 36.4973 227.557 34.3476 226.108 32.4635C224.658 30.5795 222.581 29.6374 219.876 29.6374C217.702 29.6374 215.745 30.3862 214.006 31.8838C212.315 33.3331 211.47 35.6278 211.47 38.7679V63.2605H198.861Z", fill: "white" }),
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M167.99 64.7098C163.69 64.7098 159.753 63.6712 156.178 61.5939C152.603 59.5166 149.753 56.7147 147.628 53.1881C145.55 49.6616 144.512 45.7727 144.512 41.5215C144.512 37.222 145.55 33.3331 147.628 29.8548C149.753 26.3283 152.603 23.5264 156.178 21.4491C159.753 19.3718 163.69 18.3331 167.99 18.3331C172.338 18.3331 176.275 19.3718 179.801 21.4491C183.376 23.5264 186.202 26.3283 188.28 29.8548C190.405 33.3331 191.468 37.222 191.468 41.5215C191.468 45.7727 190.405 49.6616 188.28 53.1881C186.202 56.7147 183.376 59.5166 179.801 61.5939C176.275 63.6712 172.338 64.7098 167.99 64.7098ZM167.99 53.4055C170.164 53.4055 172.12 52.8741 173.859 51.8113C175.647 50.7485 177.048 49.3234 178.062 47.536C179.125 45.7002 179.657 43.6954 179.657 41.5215C179.657 39.2993 179.125 37.2944 178.062 35.507C177.048 33.7196 175.647 32.2944 173.859 31.2316C172.12 30.1688 170.164 29.6374 167.99 29.6374C165.816 29.6374 163.835 30.1688 162.048 31.2316C160.309 32.2944 158.908 33.7196 157.845 35.507C156.831 37.2944 156.323 39.2993 156.323 41.5215C156.323 43.6954 156.831 45.7002 157.845 47.536C158.908 49.3234 160.309 50.7485 162.048 51.8113C163.835 52.8741 165.816 53.4055 167.99 53.4055Z", fill: "white" }),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M124.478 64.7098C120.179 64.7098 116.242 63.6712 112.667 61.5939C109.092 59.5166 106.242 56.7147 104.116 53.1881C102.039 49.6616 101 45.7727 101 41.5215C101 37.222 102.039 33.3331 104.116 29.8548C106.242 26.3283 109.092 23.5264 112.667 21.4491C116.242 19.3718 120.179 18.3331 124.478 18.3331C127.473 18.3331 130.299 18.8404 132.956 19.8549C135.662 20.821 138.053 22.2703 140.13 24.2027L136.869 37.0287C135.662 35.0481 134.043 33.3331 132.014 31.8838C130.034 30.3862 127.691 29.6374 124.985 29.6374C122.715 29.6374 120.686 30.1688 118.899 31.2316C117.111 32.2944 115.71 33.7196 114.696 35.507C113.681 37.2944 113.174 39.2993 113.174 41.5215C113.174 43.6954 113.681 45.7002 114.696 47.536C115.71 49.3234 117.111 50.7485 118.899 51.8113C120.686 52.8741 122.715 53.4055 124.985 53.4055C127.691 53.4055 130.034 52.6809 132.014 51.2316C134.043 49.734 135.662 47.9949 136.869 46.0142L140.13 58.8403C138.053 60.7726 135.662 62.2461 132.956 63.2605C130.299 64.2267 127.473 64.7098 124.478 64.7098Z", fill: "white" })
|
|
949
1117
|
] });
|
|
950
1118
|
}
|
|
951
|
-
return /* @__PURE__ */ (0,
|
|
952
|
-
/* @__PURE__ */ (0,
|
|
953
|
-
/* @__PURE__ */ (0,
|
|
954
|
-
/* @__PURE__ */ (0,
|
|
955
|
-
/* @__PURE__ */ (0,
|
|
956
|
-
/* @__PURE__ */ (0,
|
|
957
|
-
/* @__PURE__ */ (0,
|
|
958
|
-
/* @__PURE__ */ (0,
|
|
959
|
-
/* @__PURE__ */ (0,
|
|
960
|
-
/* @__PURE__ */ (0,
|
|
961
|
-
/* @__PURE__ */ (0,
|
|
962
|
-
/* @__PURE__ */ (0,
|
|
963
|
-
/* @__PURE__ */ (0,
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
1119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("svg", { width: "80", height: "14", viewBox: "0 0 487 85", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M48.6448 12.0775L40.9465 7.80469L11.7295 24.9191C9.15284 52.6189 18.7082 71.6223 35.081 82.6271C20.2649 65.6636 17.8134 40.0395 18.9765 29.482L48.6448 12.0775Z", fill: "#FF6503" }),
|
|
1121
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M58.163 6.39894L50.3792 2.3728L42.6836 6.80882L50.3068 11.0328L58.163 6.39894Z", fill: "#3A3A3A" }),
|
|
1122
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M27.5232 34.0452C23.4435 59.5977 30.8336 77.08 35.0386 82.6272C35.0386 82.6272 33.7332 77.5916 33.1595 74.3123C30.7189 60.3615 31.6833 50.4718 34.5016 38.0713L65.3684 20.3563C64.6742 30.9236 58.8596 53.6481 42.0229 68.532C49.9949 64.8357 60.4902 58.794 64.1665 52.0229C63.9761 52.437 65.5692 49.5794 65.3684 49.9853C72.6494 35.8555 73.6399 23.9785 73.6892 15.2564L66.1738 10.9619L27.5232 34.0452Z", fill: "#FF6503" }),
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M63.0229 54.672C56.7853 65.8167 33.207 74.5911 33.207 74.5911C33.207 74.5911 33.4213 76.1015 33.9555 78.2837C34.4897 80.4659 35.0263 82.6085 35.0263 82.6085C42.7193 78.658 54.6229 70.4326 63.0229 54.672Z", fill: "#3A3A3A" }),
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M473.854 85V60.5074C472.259 61.7151 470.472 62.6571 468.491 63.3334C466.511 64.0581 464.361 64.4204 462.042 64.4204C457.984 64.4204 454.313 63.3817 451.028 61.3045C447.743 59.2272 445.11 56.4736 443.129 53.0436C441.197 49.5654 440.23 45.7248 440.23 41.5219C440.23 37.319 441.197 33.4784 443.129 30.0002C445.11 26.5219 447.743 23.7683 451.028 21.7393C454.313 19.6621 457.984 18.6234 462.042 18.6234C464.796 18.6234 467.332 19.1065 469.651 20.0727C471.969 21.0389 473.95 22.3674 475.593 24.0582V19.7828H486.462V85H473.854ZM463.491 53.3335C465.617 53.3335 467.549 52.8021 469.288 51.7393C471.027 50.6765 472.404 49.2513 473.419 47.4639C474.482 45.6765 475.013 43.6958 475.013 41.5219C475.013 39.348 474.482 37.3673 473.419 35.5799C472.404 33.7925 471.027 32.3673 469.288 31.3045C467.549 30.2417 465.617 29.7103 463.491 29.7103C461.366 29.7103 459.433 30.2417 457.694 31.3045C455.955 32.3673 454.554 33.7925 453.491 35.5799C452.477 37.3673 451.97 39.348 451.97 41.5219C451.97 43.6958 452.477 45.6765 453.491 47.4639C454.554 49.2513 455.955 50.6765 457.694 51.7393C459.433 52.8021 461.366 53.3335 463.491 53.3335Z", fill: "#FF6503" }),
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M420.132 63.2607V19.7826H432.741V63.2607H420.132ZM426.436 13.4782C424.552 13.4782 422.958 12.826 421.654 11.5217C420.349 10.2174 419.697 8.62316 419.697 6.73911C419.697 4.80675 420.349 3.21255 421.654 1.95651C422.958 0.65217 424.552 0 426.436 0C428.369 0 429.963 0.65217 431.219 1.95651C432.523 3.21255 433.175 4.80675 433.175 6.73911C433.175 8.62316 432.523 10.2174 431.219 11.5217C429.963 12.826 428.369 13.4782 426.436 13.4782Z", fill: "#FF6503" }),
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M392.452 63.2607V29.7825H384.336V19.7825H392.669V5.28979H404.843V19.7825H413.466V29.7825H405.061V63.2607H392.452Z", fill: "#3A3A3A" }),
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M338.059 63.2605V19.7824H349.363V24.565C350.909 22.536 352.817 20.9901 355.088 19.9273C357.358 18.8645 359.798 18.3331 362.406 18.3331C365.498 18.3331 368.373 19.0819 371.03 20.5795C373.735 22.0288 375.909 24.1785 377.551 27.0288C379.242 29.8307 380.087 33.2365 380.087 37.2461V63.2605H367.479V38.9128C367.479 36.4973 366.754 34.3476 365.305 32.4635C363.856 30.5795 361.778 29.6374 359.073 29.6374C356.899 29.6374 354.943 30.3862 353.203 31.8838C351.513 33.3331 350.667 35.6278 350.667 38.7679V63.2605H338.059Z", fill: "#3A3A3A" }),
|
|
1128
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M310.56 64.7098C305.68 64.7098 301.381 63.6953 297.661 61.6664C293.941 59.6374 291.043 56.8596 288.966 53.333C286.888 49.7582 285.85 45.6761 285.85 41.0867C285.85 36.6906 286.864 32.8017 288.893 29.4201C290.922 25.9901 293.652 23.2848 297.081 21.3041C300.56 19.3235 304.4 18.3331 308.603 18.3331C312.903 18.3331 316.743 19.3235 320.125 21.3041C323.507 23.2365 326.164 25.8935 328.096 29.2751C330.077 32.6568 331.067 36.4973 331.067 40.7968V45.2171H304.545C303.337 45.2171 302.178 45.1447 301.067 44.9997C299.956 44.8548 298.845 44.6857 297.734 44.4925C298.313 47.391 299.738 49.7582 302.009 51.5939C304.328 53.3813 307.275 54.2751 310.85 54.2751C313.603 54.2751 316.067 53.7195 318.241 52.6084C320.463 51.4973 322.275 50.1205 323.676 48.478L326.429 59.7823C324.255 61.4248 321.792 62.6567 319.038 63.4779C316.333 64.2992 313.507 64.7098 310.56 64.7098ZM297.444 36.8838C299.859 36.3524 302.226 36.0867 304.545 36.0867H312.226C313.579 36.0867 314.859 36.135 316.067 36.2316C317.275 36.3283 318.41 36.4973 319.473 36.7389C318.748 34.1302 317.42 32.0771 315.487 30.5795C313.603 29.0819 311.26 28.3331 308.458 28.3331C305.801 28.3331 303.482 29.1061 301.502 30.6519C299.569 32.1495 298.217 34.2268 297.444 36.8838Z", fill: "#3A3A3A" }),
|
|
1129
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M263.884 64.7098C260.937 64.7098 257.942 64.2267 254.898 63.2605C251.903 62.2944 249.56 60.99 247.869 59.3475L250.985 47.4635C252.386 49.3959 254.318 51.0867 256.782 52.5359C259.294 53.9852 261.879 54.7098 264.536 54.7098C266.323 54.7098 267.603 54.3717 268.376 53.6954C269.198 53.019 269.608 52.1978 269.608 51.2316C269.608 50.1205 269.198 49.3234 268.376 48.8403C267.555 48.3089 266.71 47.8741 265.84 47.536L259.753 45.2171C258.401 44.6857 256.855 43.9611 255.115 43.0432C253.376 42.1253 251.855 40.821 250.55 39.1302C249.294 37.4394 248.666 35.2171 248.666 32.4635C248.666 29.9515 249.294 27.6326 250.55 25.507C251.806 23.3814 253.618 21.6665 255.985 20.3621C258.401 19.0095 261.299 18.3331 264.681 18.3331C267.821 18.3331 270.743 18.8645 273.449 19.9273C276.202 20.9901 278.207 22.1737 279.463 23.478L276.565 34.9273C274.922 32.8017 272.966 31.1833 270.695 30.0722C268.473 28.9128 266.347 28.3331 264.318 28.3331C262.772 28.3331 261.637 28.6471 260.913 29.2751C260.188 29.9031 259.826 30.6278 259.826 31.449C259.826 32.0771 260.067 32.7051 260.55 33.3331C261.082 33.9128 261.951 34.4442 263.159 34.9273L268.811 37.0287C270.454 37.6084 272.193 38.3814 274.028 39.3476C275.913 40.3137 277.507 41.6664 278.811 43.4055C280.115 45.0963 280.768 47.4393 280.768 50.4345C280.768 54.6374 279.198 58.0673 276.057 60.7243C272.966 63.3813 268.908 64.7098 263.884 64.7098Z", fill: "#3A3A3A" }),
|
|
1130
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M198.861 63.2605V19.7824H210.166V24.565C211.712 22.536 213.62 20.9901 215.89 19.9273C218.161 18.8645 220.6 18.3331 223.209 18.3331C226.301 18.3331 229.175 19.0819 231.832 20.5795C234.538 22.0288 236.711 24.1785 238.354 27.0288C240.045 29.8307 240.89 33.2365 240.89 37.2461V63.2605H228.282V38.9128C228.282 36.4973 227.557 34.3476 226.108 32.4635C224.658 30.5795 222.581 29.6374 219.876 29.6374C217.702 29.6374 215.745 30.3862 214.006 31.8838C212.315 33.3331 211.47 35.6278 211.47 38.7679V63.2605H198.861Z", fill: "#3A3A3A" }),
|
|
1131
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M167.99 64.7098C163.69 64.7098 159.753 63.6712 156.178 61.5939C152.603 59.5166 149.753 56.7147 147.628 53.1881C145.55 49.6616 144.512 45.7727 144.512 41.5215C144.512 37.222 145.55 33.3331 147.628 29.8548C149.753 26.3283 152.603 23.5264 156.178 21.4491C159.753 19.3718 163.69 18.3331 167.99 18.3331C172.338 18.3331 176.275 19.3718 179.801 21.4491C183.376 23.5264 186.202 26.3283 188.28 29.8548C190.405 33.3331 191.468 37.222 191.468 41.5215C191.468 45.7727 190.405 49.6616 188.28 53.1881C186.202 56.7147 183.376 59.5166 179.801 61.5939C176.275 63.6712 172.338 64.7098 167.99 64.7098ZM167.99 53.4055C170.164 53.4055 172.12 52.8741 173.859 51.8113C175.647 50.7485 177.048 49.3234 178.062 47.536C179.125 45.7002 179.657 43.6954 179.657 41.5215C179.657 39.2993 179.125 37.2944 178.062 35.507C177.048 33.7196 175.647 32.2944 173.859 31.2316C172.12 30.1688 170.164 29.6374 167.99 29.6374C165.816 29.6374 163.835 30.1688 162.048 31.2316C160.309 32.2944 158.908 33.7196 157.845 35.507C156.831 37.2944 156.323 39.2993 156.323 41.5215C156.323 43.6954 156.831 45.7002 157.845 47.536C158.908 49.3234 160.309 50.7485 162.048 51.8113C163.835 52.8741 165.816 53.4055 167.99 53.4055Z", fill: "#3A3A3A" }),
|
|
1132
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M124.478 64.7098C120.179 64.7098 116.242 63.6712 112.667 61.5939C109.092 59.5166 106.242 56.7147 104.116 53.1881C102.039 49.6616 101 45.7727 101 41.5215C101 37.222 102.039 33.3331 104.116 29.8548C106.242 26.3283 109.092 23.5264 112.667 21.4491C116.242 19.3718 120.179 18.3331 124.478 18.3331C127.473 18.3331 130.299 18.8404 132.956 19.8549C135.662 20.821 138.053 22.2703 140.13 24.2027L136.869 37.0287C135.662 35.0481 134.043 33.3331 132.014 31.8838C130.034 30.3862 127.691 29.6374 124.985 29.6374C122.715 29.6374 120.686 30.1688 118.899 31.2316C117.111 32.2944 115.71 33.7196 114.696 35.507C113.681 37.2944 113.174 39.2993 113.174 41.5215C113.174 43.6954 113.681 45.7002 114.696 47.536C115.71 49.3234 117.111 50.7485 118.899 51.8113C120.686 52.8741 122.715 53.4055 124.985 53.4055C127.691 53.4055 130.034 52.6809 132.014 51.2316C134.043 49.734 135.662 47.9949 136.869 46.0142L140.13 58.8403C138.053 60.7726 135.662 62.2461 132.956 63.2605C130.299 64.2267 127.473 64.7098 124.478 64.7098Z", fill: "#3A3A3A" })
|
|
965
1133
|
] });
|
|
966
1134
|
}
|
|
967
1135
|
|
|
968
1136
|
// src/components/ConsentGate.tsx
|
|
969
|
-
var
|
|
1137
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
970
1138
|
function ConsentGate({
|
|
971
1139
|
category,
|
|
972
1140
|
children,
|
|
@@ -975,12 +1143,12 @@ function ConsentGate({
|
|
|
975
1143
|
}) {
|
|
976
1144
|
const { hasConsent, isLoading } = useConsentGate(category);
|
|
977
1145
|
if (isLoading) {
|
|
978
|
-
return /* @__PURE__ */ (0,
|
|
1146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: loading });
|
|
979
1147
|
}
|
|
980
1148
|
if (hasConsent) {
|
|
981
|
-
return /* @__PURE__ */ (0,
|
|
1149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
982
1150
|
}
|
|
983
|
-
return /* @__PURE__ */ (0,
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: fallback });
|
|
984
1152
|
}
|
|
985
1153
|
function withConsentGate(Component, category, FallbackComponent) {
|
|
986
1154
|
return function ConsentGatedComponent(props) {
|
|
@@ -989,20 +1157,283 @@ function withConsentGate(Component, category, FallbackComponent) {
|
|
|
989
1157
|
return null;
|
|
990
1158
|
}
|
|
991
1159
|
if (hasConsent) {
|
|
992
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Component, { ...props });
|
|
993
1161
|
}
|
|
994
1162
|
if (FallbackComponent) {
|
|
995
|
-
return /* @__PURE__ */ (0,
|
|
1163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FallbackComponent, { ...props });
|
|
996
1164
|
}
|
|
997
1165
|
return null;
|
|
998
1166
|
};
|
|
999
1167
|
}
|
|
1168
|
+
|
|
1169
|
+
// src/components/MarketingConsentForm.tsx
|
|
1170
|
+
var import_react5 = require("react");
|
|
1171
|
+
|
|
1172
|
+
// src/hooks/useFormConsent.ts
|
|
1173
|
+
var import_react4 = require("react");
|
|
1174
|
+
var configCache = /* @__PURE__ */ new Map();
|
|
1175
|
+
var CONFIG_TTL = 6e4;
|
|
1176
|
+
function getCachedConfig(propertyKey) {
|
|
1177
|
+
const entry = configCache.get(propertyKey);
|
|
1178
|
+
if (entry && Date.now() - entry.timestamp < CONFIG_TTL) {
|
|
1179
|
+
return entry.config;
|
|
1180
|
+
}
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
function setCachedConfig(propertyKey, config) {
|
|
1184
|
+
configCache.set(propertyKey, { config, timestamp: Date.now() });
|
|
1185
|
+
}
|
|
1186
|
+
function useFormConsent(options) {
|
|
1187
|
+
const { propertyKey, apiUrl, subjectId, subjectType = "visitor", debug = false } = options;
|
|
1188
|
+
const [config, setConfig] = (0, import_react4.useState)(() => getCachedConfig(propertyKey));
|
|
1189
|
+
const [consents, setConsents] = (0, import_react4.useState)({});
|
|
1190
|
+
const [isLoading, setIsLoading] = (0, import_react4.useState)(!getCachedConfig(propertyKey));
|
|
1191
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react4.useState)(false);
|
|
1192
|
+
const [error, setError] = (0, import_react4.useState)(null);
|
|
1193
|
+
const [lastSubmission, setLastSubmission] = (0, import_react4.useState)(null);
|
|
1194
|
+
const apiClientRef = (0, import_react4.useRef)(null);
|
|
1195
|
+
(0, import_react4.useEffect)(() => {
|
|
1196
|
+
if (config) return;
|
|
1197
|
+
let cancelled = false;
|
|
1198
|
+
const client = new ConsentIQApiClient(propertyKey, apiUrl, debug);
|
|
1199
|
+
apiClientRef.current = client;
|
|
1200
|
+
client.getConfig().then((cfg) => {
|
|
1201
|
+
if (cancelled) return;
|
|
1202
|
+
setCachedConfig(propertyKey, cfg);
|
|
1203
|
+
setConfig(cfg);
|
|
1204
|
+
setIsLoading(false);
|
|
1205
|
+
}).catch((err) => {
|
|
1206
|
+
if (cancelled) return;
|
|
1207
|
+
setError(err.message || "Failed to load config");
|
|
1208
|
+
setIsLoading(false);
|
|
1209
|
+
});
|
|
1210
|
+
return () => {
|
|
1211
|
+
cancelled = true;
|
|
1212
|
+
};
|
|
1213
|
+
}, [propertyKey, apiUrl, debug]);
|
|
1214
|
+
const privacyNoticeUrl = (() => {
|
|
1215
|
+
if (!config) return null;
|
|
1216
|
+
const currentPath = typeof window !== "undefined" ? window.location.pathname : "/";
|
|
1217
|
+
const sources = config.formConsentSources || [];
|
|
1218
|
+
for (const source of sources) {
|
|
1219
|
+
if (!source.selector) continue;
|
|
1220
|
+
const selectorPath = source.selector.startsWith("/") ? source.selector.split("#")[0] : null;
|
|
1221
|
+
if (selectorPath && currentPath.startsWith(selectorPath)) {
|
|
1222
|
+
const noticeParam = source.privacyNotice.id;
|
|
1223
|
+
return `${config.privacyNoticeUrl}?notice=${noticeParam}`;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
return config.privacyNoticeUrl;
|
|
1227
|
+
})();
|
|
1228
|
+
const channels = config?.marketingChannels || [];
|
|
1229
|
+
const setConsent = (0, import_react4.useCallback)((channel, value) => {
|
|
1230
|
+
setConsents((prev) => ({ ...prev, [channel]: value }));
|
|
1231
|
+
}, []);
|
|
1232
|
+
const setAllConsents = (0, import_react4.useCallback)((value) => {
|
|
1233
|
+
if (!config) return;
|
|
1234
|
+
const newConsents = {};
|
|
1235
|
+
for (const ch of config.marketingChannels) {
|
|
1236
|
+
newConsents[ch.code] = value;
|
|
1237
|
+
}
|
|
1238
|
+
setConsents(newConsents);
|
|
1239
|
+
}, [config]);
|
|
1240
|
+
const submit = (0, import_react4.useCallback)(async () => {
|
|
1241
|
+
if (!subjectId) {
|
|
1242
|
+
setError("subjectId is required");
|
|
1243
|
+
return null;
|
|
1244
|
+
}
|
|
1245
|
+
if (!apiClientRef.current) {
|
|
1246
|
+
setError("API client not initialized");
|
|
1247
|
+
return null;
|
|
1248
|
+
}
|
|
1249
|
+
setIsSubmitting(true);
|
|
1250
|
+
setError(null);
|
|
1251
|
+
try {
|
|
1252
|
+
const result = await apiClientRef.current.submitConsent({
|
|
1253
|
+
subjectId,
|
|
1254
|
+
subjectType,
|
|
1255
|
+
marketingConsents: consents,
|
|
1256
|
+
consentMethod: "form"
|
|
1257
|
+
});
|
|
1258
|
+
const submission = { consentId: result.consentId, proofHash: result.proofHash };
|
|
1259
|
+
setLastSubmission(submission);
|
|
1260
|
+
setIsSubmitting(false);
|
|
1261
|
+
return submission;
|
|
1262
|
+
} catch (err) {
|
|
1263
|
+
const message = err instanceof Error ? err.message : "Failed to submit consent";
|
|
1264
|
+
setError(message);
|
|
1265
|
+
setIsSubmitting(false);
|
|
1266
|
+
return null;
|
|
1267
|
+
}
|
|
1268
|
+
}, [subjectId, subjectType, consents]);
|
|
1269
|
+
return {
|
|
1270
|
+
channels,
|
|
1271
|
+
consents,
|
|
1272
|
+
privacyNoticeUrl,
|
|
1273
|
+
lastSubmission,
|
|
1274
|
+
setConsent,
|
|
1275
|
+
setAllConsents,
|
|
1276
|
+
submit,
|
|
1277
|
+
isLoading,
|
|
1278
|
+
isSubmitting,
|
|
1279
|
+
error
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
// src/components/MarketingConsentForm.tsx
|
|
1284
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1285
|
+
var MarketingConsentForm = (0, import_react5.forwardRef)(
|
|
1286
|
+
function MarketingConsentForm2({
|
|
1287
|
+
propertyKey,
|
|
1288
|
+
apiUrl,
|
|
1289
|
+
subjectId,
|
|
1290
|
+
subjectType,
|
|
1291
|
+
mode = "simple",
|
|
1292
|
+
simpleLabel,
|
|
1293
|
+
channels: channelFilter,
|
|
1294
|
+
onConsentSubmitted,
|
|
1295
|
+
onConsentChange,
|
|
1296
|
+
autoSubmit = false,
|
|
1297
|
+
className,
|
|
1298
|
+
style,
|
|
1299
|
+
showDescriptions = false,
|
|
1300
|
+
showPrivacyLink = true,
|
|
1301
|
+
privacyLinkText = "Privacy Policy",
|
|
1302
|
+
privacyUrl: privacyUrlOverride
|
|
1303
|
+
}, ref) {
|
|
1304
|
+
const resolvedPropertyKey = propertyKey || "";
|
|
1305
|
+
const {
|
|
1306
|
+
channels,
|
|
1307
|
+
consents,
|
|
1308
|
+
privacyNoticeUrl,
|
|
1309
|
+
setConsent,
|
|
1310
|
+
setAllConsents,
|
|
1311
|
+
submit,
|
|
1312
|
+
isLoading,
|
|
1313
|
+
isSubmitting
|
|
1314
|
+
} = useFormConsent({
|
|
1315
|
+
propertyKey: resolvedPropertyKey,
|
|
1316
|
+
apiUrl,
|
|
1317
|
+
subjectId,
|
|
1318
|
+
subjectType
|
|
1319
|
+
});
|
|
1320
|
+
const privacyUrl = privacyUrlOverride || privacyNoticeUrl;
|
|
1321
|
+
const visibleChannels = channelFilter ? channels.filter((ch) => channelFilter.includes(ch.code)) : channels;
|
|
1322
|
+
(0, import_react5.useImperativeHandle)(ref, () => ({
|
|
1323
|
+
submit: async () => {
|
|
1324
|
+
const result = await submit();
|
|
1325
|
+
if (result && onConsentSubmitted) {
|
|
1326
|
+
onConsentSubmitted({ ...result, consents });
|
|
1327
|
+
}
|
|
1328
|
+
return result;
|
|
1329
|
+
},
|
|
1330
|
+
getConsents: () => consents,
|
|
1331
|
+
reset: () => setAllConsents(false)
|
|
1332
|
+
}), [submit, consents, onConsentSubmitted, setAllConsents]);
|
|
1333
|
+
const handleChange = (channel, value) => {
|
|
1334
|
+
setConsent(channel, value);
|
|
1335
|
+
const updated = { ...consents, [channel]: value };
|
|
1336
|
+
onConsentChange?.(updated);
|
|
1337
|
+
if (autoSubmit) {
|
|
1338
|
+
submit().then((result) => {
|
|
1339
|
+
if (result && onConsentSubmitted) {
|
|
1340
|
+
onConsentSubmitted({ ...result, consents: updated });
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
const handleSimpleChange = (checked) => {
|
|
1346
|
+
setAllConsents(checked);
|
|
1347
|
+
const updated = {};
|
|
1348
|
+
for (const ch of visibleChannels) {
|
|
1349
|
+
updated[ch.code] = checked;
|
|
1350
|
+
}
|
|
1351
|
+
onConsentChange?.(updated);
|
|
1352
|
+
if (autoSubmit) {
|
|
1353
|
+
submit().then((result) => {
|
|
1354
|
+
if (result && onConsentSubmitted) {
|
|
1355
|
+
onConsentSubmitted({ ...result, consents: updated });
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
};
|
|
1360
|
+
if (isLoading) {
|
|
1361
|
+
return null;
|
|
1362
|
+
}
|
|
1363
|
+
const allChecked = visibleChannels.length > 0 && visibleChannels.every((ch) => consents[ch.code]);
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className, style: { fontSize: "14px", ...style }, children: mode === "simple" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { style: { display: "flex", alignItems: "flex-start", gap: "8px", cursor: "pointer" }, children: [
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1366
|
+
"input",
|
|
1367
|
+
{
|
|
1368
|
+
type: "checkbox",
|
|
1369
|
+
checked: allChecked,
|
|
1370
|
+
onChange: (e) => handleSimpleChange(e.target.checked),
|
|
1371
|
+
disabled: isSubmitting,
|
|
1372
|
+
style: { marginTop: "3px" }
|
|
1373
|
+
}
|
|
1374
|
+
),
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1376
|
+
simpleLabel || "I agree to receive marketing communications",
|
|
1377
|
+
showPrivacyLink && privacyUrl && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1378
|
+
". ",
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1380
|
+
"a",
|
|
1381
|
+
{
|
|
1382
|
+
href: privacyUrl,
|
|
1383
|
+
target: "_blank",
|
|
1384
|
+
rel: "noopener noreferrer",
|
|
1385
|
+
style: { textDecoration: "underline" },
|
|
1386
|
+
children: privacyLinkText
|
|
1387
|
+
}
|
|
1388
|
+
)
|
|
1389
|
+
] })
|
|
1390
|
+
] })
|
|
1391
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
1392
|
+
visibleChannels.map((ch) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1393
|
+
"label",
|
|
1394
|
+
{
|
|
1395
|
+
style: { display: "flex", alignItems: "flex-start", gap: "8px", cursor: "pointer" },
|
|
1396
|
+
children: [
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1398
|
+
"input",
|
|
1399
|
+
{
|
|
1400
|
+
type: "checkbox",
|
|
1401
|
+
checked: consents[ch.code] === true,
|
|
1402
|
+
onChange: (e) => handleChange(ch.code, e.target.checked),
|
|
1403
|
+
disabled: isSubmitting,
|
|
1404
|
+
style: { marginTop: "3px" }
|
|
1405
|
+
}
|
|
1406
|
+
),
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
1408
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: ch.name }),
|
|
1409
|
+
showDescriptions && ch.description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { display: "block", color: "#666", fontSize: "12px" }, children: ch.description })
|
|
1410
|
+
] })
|
|
1411
|
+
]
|
|
1412
|
+
},
|
|
1413
|
+
ch.code
|
|
1414
|
+
)),
|
|
1415
|
+
showPrivacyLink && privacyUrl && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1416
|
+
"a",
|
|
1417
|
+
{
|
|
1418
|
+
href: privacyUrl,
|
|
1419
|
+
target: "_blank",
|
|
1420
|
+
rel: "noopener noreferrer",
|
|
1421
|
+
style: { fontSize: "12px", textDecoration: "underline", color: "#666" },
|
|
1422
|
+
children: privacyLinkText
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
1425
|
+
] }) });
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1000
1428
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1001
1429
|
0 && (module.exports = {
|
|
1002
1430
|
ConsentGate,
|
|
1003
1431
|
ConsentIQApiClient,
|
|
1004
1432
|
ConsentIQProvider,
|
|
1433
|
+
ConsentTrigger,
|
|
1005
1434
|
CookieBanner,
|
|
1435
|
+
LanguageSelector,
|
|
1436
|
+
MarketingConsentForm,
|
|
1006
1437
|
PreferenceCenter,
|
|
1007
1438
|
detectCountry,
|
|
1008
1439
|
detectLanguage,
|
|
@@ -1011,5 +1442,6 @@ function withConsentGate(Component, category, FallbackComponent) {
|
|
|
1011
1442
|
useConsent,
|
|
1012
1443
|
useConsentGate,
|
|
1013
1444
|
useConsentIQ,
|
|
1445
|
+
useFormConsent,
|
|
1014
1446
|
withConsentGate
|
|
1015
1447
|
});
|