chefcookie 2.8.9 → 2.9.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/_build/script.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  require("mdn-polyfills/Object.entries");
9
10
  require("mdn-polyfills/Object.values");
10
11
  require("mdn-polyfills/Number.isInteger");
@@ -12,9 +13,10 @@ require("mdn-polyfills/Element.prototype.closest");
12
13
  require("mdn-polyfills/Node.prototype.remove");
13
14
  require("@babel/polyfill/noConflict");
14
15
  var _helper = _interopRequireDefault(require("./_helper"));
15
- var _cookie = _interopRequireDefault(require("cookie"));
16
- // ie11 support
17
-
16
+ var cookie = _interopRequireWildcard(require("cookie"));
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // ie11 support
18
20
  class chefcookie {
19
21
  constructor() {
20
22
  let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -22,10 +24,7 @@ class chefcookie {
22
24
  exclude_ua_regex: /(Mozilla\/5\.0 \(Linux; Android 11; moto g power \(2022\)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/109\.0.0.0 Mobile Safari\/537\.36)|(Mozilla\/5\.0 \(Macintosh; Intel Mac OS X 10_15_7\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/109\.0\.0\.0 Safari\/537\.36)|(Speed Insights)|(Chrome-Lighthouse)|(PSTS[\d\.]+)/,
23
25
  domain: _helper.default.urlHostTopLevel()
24
26
  };
25
- this.config = {
26
- ...defaults,
27
- ...config
28
- };
27
+ this.config = _objectSpread(_objectSpread({}, defaults), config);
29
28
  // add dummy entries for empty groups
30
29
  this.config.settings.forEach((group, i) => {
31
30
  if (!('scripts' in group) || Object.keys(group.scripts).length === 0) {
@@ -320,663 +319,8 @@ class chefcookie {
320
319
  return excluded;
321
320
  }
322
321
  addStyle() {
323
- let css = `
324
- .chefcookie, .chefcookie *
325
- {
326
- box-sizing: border-box;
327
- margin:0;
328
- padding:0;
329
- }
330
- /* try to reset styles */
331
- .chefcookie h2,
332
- .chefcookie a:link,
333
- .chefcookie a:hover,
334
- .chefcookie a:visited
335
- {
336
- color:inherit;
337
- }
338
- .chefcookie
339
- {
340
- position: fixed;
341
- z-index: 2147483647;
342
- left: 0;
343
- right: 0;
344
- bottom: 0;
345
- transform: translateZ(0);
346
- }
347
- .chefcookie--hidden
348
- {
349
- opacity: 0;
350
- pointer-events:none;
351
- }
352
- .chefcookie__inner
353
- {
354
- width:100%;
355
- height:100%;
356
- text-align: center;
357
- white-space: nowrap;
358
- font-size: 0;
359
- overflow-y:auto;
360
- overflow-x:hidden;
361
- max-height:100vh;
362
- }
363
- .chefcookie__box
364
- {
365
- font-size: ${15 + (this.config.style.size - 3)}px;
366
- line-height:1.6;
367
- color:${this.config.style.color_text ?? '#595f60'};
368
- width: 100%;
369
- margin: 0 auto;
370
- display: inline-block;
371
- vertical-align: middle;
372
- white-space: normal;
373
- border-radius: 0;
374
- padding-top: 2em;
375
- padding-bottom: 2em;
376
- padding-left: 3em;
377
- padding-right: 3em;
378
- text-align: left;
379
- }
380
- .chefcookie__message
381
- {
382
- margin-bottom:1.5em;
383
- text-align:justify;
384
- }
385
- .chefcookie__message h2
386
- {
387
- margin-bottom:0.5em;
388
- font-size:2em;
389
- line-height:1.4;
390
- text-transform:uppercase;
391
- font-weight:700;
392
- text-align:left;
393
- }
394
- .chefcookie__message p {
395
- font-size: 1em;
396
- line-height:1.6;
397
- }
398
- .chefcookie__message a,
399
- .chefcookie__message a:focus
400
- {
401
- color:inherit;
402
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
403
- text-decoration:underline;
404
- font-size: 1em;
405
- line-height:1.6;
406
- }
407
- .chefcookie__message a:focus
408
- {
409
- outline:none;
410
- }
411
- @media (hover: hover) {
412
- .chefcookie__message a:hover
413
- {
414
- opacity: 0.5;
415
- color: inherit;
416
- }
417
- }
418
- .chefcookie__message a:active
419
- {
420
- opacity: 0.1;
421
- color: inherit;
422
- }
423
- .chefcookie__buttons
424
- {
425
- margin-top:0.5em;
426
- }
427
- .chefcookie__button,
428
- .chefcookie__button:focus
429
- {
430
- padding: 1em 0.5em;
431
- border: 2px solid ${this.config.style.color_text ?? '#595f60'};
432
- font-weight: bold;
433
- display: block;
434
- color: inherit;
435
- text-decoration: none;
436
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
437
- text-transform: uppercase;
438
- float: left;
439
- text-align: center;
440
- min-width: 21em;
441
- margin-right:3em;
442
- }
443
- .chefcookie__buttons--count-3 .chefcookie__button,
444
- .chefcookie__buttons--count-3 .chefcookie__button:focus {
445
- min-width:15em;
446
- margin-right:1em;
447
- }
448
- .chefcookie__button:last-child
449
- {
450
- margin-right:0;
451
- }
452
- .chefcookie__button:focus
453
- {
454
- outline:none;
455
- }
456
- @media (hover: hover) {
457
- .chefcookie__button:hover
458
- {
459
- opacity: 0.5;
460
- text-decoration:none;
461
- color: inherit;
462
- }
463
- }
464
- .chefcookie__button:active
465
- {
466
- opacity: 0.1;
467
- color: inherit;
468
- }
469
- .chefcookie__buttons:after
470
- {
471
- clear:both;
472
- display:table;
473
- content:"";
474
- }
475
- ${this.config.style.highlight_accept === undefined || this.config.style.highlight_accept === true ? `
476
- .chefcookie__button--accept
477
- {
478
- background-color:${this.config.style.color_highlight ?? this.config.style.color ?? '#ff0000'};
479
- border-color:transparent;
480
- }
481
- .chefcookie__button--accept.chefcookie__button--accept,
482
- .chefcookie__button--accept.chefcookie__button--accept:hover,
483
- .chefcookie__button--accept.chefcookie__button--accept:focus,
484
- .chefcookie__button--accept.chefcookie__button--accept:link,
485
- .chefcookie__button--accept.chefcookie__button--accept:visited
486
- {
487
- color:${this.config.style.color_background ?? '#eeeeee'};
488
- }
489
- ` : ``}
490
- .chefcookie__settings-container
491
- {
492
- height:0;
493
- overflow:hidden;
494
- transition: height ${this.animationSpeed / 1000}s ease-out;
495
- }
496
- .chefcookie__groups
497
- {
498
- list-style-type:none;
499
- }
500
- .chefcookie__groups:after
501
- {
502
- clear:both;
503
- display:table;
504
- content:"";
505
- }
506
- .chefcookie__group
507
- {
508
- float: left;
509
- }
510
- .chefcookie__group:before
511
- {
512
- display:none;
513
- }
514
- .chefcookie__group-title
515
- {
516
- float:left;
517
- width:70%;
518
- min-height: 1.66em;
519
- line-height: 1.66;
520
- display: block;
521
- font-weight:bold;
522
- font-size:1.2em;
523
- line-height:1.7;
524
- text-transform:uppercase;
525
- }
526
- .chefcookie__group-label
527
- {
528
- cursor: pointer;
529
- display:block;
530
- width:100%;
531
- height:100%;
532
- font-size:1em;
533
- line-height:1.6;
534
- }
535
- .chefcookie__group-label:after
536
- {
537
- clear:both;
538
- display:table;
539
- content:""
540
- }
541
- .chefcookie__group--disabled .chefcookie__group-label
542
- {
543
- cursor:default;
544
- }
545
- .chefcookie__group-checkbox
546
- {
547
- opacity: 0;
548
- position:absolute;
549
- display: block;
550
- pointer-events:none;
551
- }
552
- .chefcookie__group--disabled .chefcookie__group-checkbox-icon
553
- {
554
- ${this.config.style.show_disabled_checkbox === undefined || this.config.style.show_disabled_checkbox === false ? `display:none;` : `opacity: 0.75 !important;`}
555
- }
556
- .chefcookie__group-checkbox-icon
557
- {
558
- line-height:2;
559
- display: block;
560
- width: 4em;
561
- height: 2em;
562
- background-color: ${this.config.style.color_background ?? '#eeeeee'};
563
- border: 2px solid ${this.config.style.color_text ?? '#595f60'};
564
- margin: 0;
565
- padding: 0;
566
- position: relative;
567
- border-radius: 2em;
568
- float: right;
569
- }
570
- .chefcookie__group-checkbox-icon:before
571
- {
572
- content: "0";
573
- position: absolute;
574
- top: 0;
575
- left: 45%;
576
- width: 50%;
577
- bottom: 0;
578
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
579
- text-align: center;
580
- font-weight: bold;
581
- font-size: 1em;
582
- line-height: 2;
583
- opacity: 0.25;
584
- color: ${this.config.style.color_text ?? '#595f60'};
585
- }
586
- .chefcookie__group-checkbox-icon:after
587
- {
588
- content: "";
589
- position: absolute;
590
- top: 0;
591
- left: 0;
592
- width: 50%;
593
- bottom: 0;
594
- box-shadow: 0 0 0px 1px ${this.config.style.color_text ?? '#595f60'};
595
- background-color: ${this.config.style.color_text ?? '#595f60'};
596
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
597
- border-radius: 50%;
598
- }
599
- .chefcookie__group-checkbox ~ *
600
- {
601
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
602
- }
603
- .chefcookie__group-checkbox[data-status="0"] ~ *
604
- {
605
- opacity: 0.75;
606
- }
607
- .chefcookie__group-checkbox[data-status="1"] ~ .chefcookie__group-checkbox-icon
608
- {
609
- opacity: 0.85;
610
- }
611
- .chefcookie__group-checkbox[data-status="1"] ~ .chefcookie__group-checkbox-icon:after
612
- {
613
- left:25%;
614
- }
615
- .chefcookie__group-checkbox[data-status="2"] ~ .chefcookie__group-checkbox-icon:after
616
- {
617
- left:50%;
618
- }
619
- .chefcookie__group-checkbox[data-status="1"] ~ .chefcookie__group-checkbox-icon:before,
620
- .chefcookie__group-checkbox[data-status="2"] ~ .chefcookie__group-checkbox-icon:before
621
- {
622
- content: "";
623
- background-color: ${this.config.style.color_text ?? '#595f60'};
624
- top: 30%;
625
- bottom: 30%;
626
- left: 27%;
627
- width: 3px;
628
- }
629
- .chefcookie__group-description
630
- {
631
- width:100%;
632
- clear:both;
633
- padding-top:1em;
634
- display: block;
635
- font-size:0.9em;
636
- line-height:1.5;
637
- text-align:justify;
638
- font-weight: normal;
639
- }
640
- .chefcookie__group-collapse,
641
- .chefcookie__group-collapse:focus {
642
- color:inherit;
643
- text-decoration:underline;
644
- padding-top: 0.5em;
645
- display: block;
646
- }
647
- @media (hover: hover) {
648
- .chefcookie__group-collapse:hover
649
- {
650
- opacity: 0.9;
651
- color: inherit;
652
- text-decoration:underline;
653
- }
654
- }
655
- .chefcookie__scripts
656
- {
657
- list-style-type:none;
658
- height:0;
659
- overflow:hidden;
660
- transition: height ${this.animationSpeed / 1000}s ease-out;
661
- }
662
- .chefcookie__scripts--visible {
663
- height:auto;
664
- }
665
- .chefcookie__script {
666
- margin-bottom:0.5em;
667
- }
668
- .chefcookie__script:before
669
- {
670
- display:none;
671
- }
672
- .chefcookie__script:first-child {
673
- margin-top:1em;
674
- }
675
- .chefcookie__script:last-child {
676
- margin-bottom:0;
677
- }
678
- .chefcookie__script-title
679
- {
680
- float:left;
681
- width:70%;
682
- min-height: 1.66em;
683
- line-height: 1.66;
684
- display: block;
685
- }
686
- .chefcookie__script-label
687
- {
688
- cursor: pointer;
689
- display:block;
690
- width:100%;
691
- height:100%;
692
- }
693
- .chefcookie__script-label:after
694
- {
695
- clear:both;
696
- display:table;
697
- content:""
698
- }
699
- .chefcookie__script--disabled .chefcookie__script-label
700
- {
701
- cursor:default;
702
- }
703
- .chefcookie__script-checkbox
704
- {
705
- opacity: 0;
706
- position:absolute;
707
- display: block;
708
- pointer-events:none;
709
- }
710
- .chefcookie__script--disabled .chefcookie__script-checkbox-icon
711
- {
712
- ${this.config.style.show_disabled_checkbox === undefined || this.config.style.show_disabled_checkbox === false ? `display:none;` : `opacity: 0.75 !important;`}
713
- }
714
- .chefcookie__script-checkbox-icon
715
- {
716
- line-height:1.5;
717
- display: block;
718
- width: 3em;
719
- height: 1.5em;
720
- background-color: ${this.config.style.color_background ?? '#eeeeee'};
721
- border: 1px solid ${this.config.style.color_text ?? '#595f60'};
722
- margin: 0;
723
- padding: 0;
724
- position: relative;
725
- border-radius: 2em;
726
- float: right;
727
- }
728
- .chefcookie__script-checkbox-icon:before
729
- {
730
- content: "0";
731
- position: absolute;
732
- top: 0;
733
- left: 45%;
734
- width: 50%;
735
- bottom: 0;
736
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
737
- text-align: center;
738
- font-size: 0.7em;
739
- line-height: 2;
740
- opacity: 0.25;
741
- color: ${this.config.style.color_text ?? '#595f60'};
742
- }
743
- .chefcookie__script-checkbox-icon:after
744
- {
745
- content: "";
746
- position: absolute;
747
- top: 0;
748
- left: 0;
749
- width: 50%;
750
- bottom: 0;
751
- box-shadow: 0 0 0px 1px ${this.config.style.color_text ?? '#595f60'};
752
- background-color: ${this.config.style.color_text ?? '#595f60'};
753
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
754
- border-radius: 50%;
755
- }
756
- .chefcookie__script-checkbox ~ *
757
- {
758
- opacity: 0.75;
759
- transition: all ${this.animationSpeed / 1000}s ease-in-out;
760
- }
761
- .chefcookie__script-checkbox:checked ~ *
762
- {
763
- opacity:1;
764
- }
765
- .chefcookie__script-checkbox:checked ~ .chefcookie__script-checkbox-icon:after
766
- {
767
- left:50%;
768
- }
769
- .chefcookie__script-checkbox:checked ~ .chefcookie__script-checkbox-icon:before
770
- {
771
- content: "";
772
- background-color: ${this.config.style.color_text ?? '#595f60'};
773
- top: 30%;
774
- bottom: 30%;
775
- left: 27%;
776
- width: 2px;
777
- }
778
-
779
- .chefcookie__script-description
780
- {
781
- width: 100%;
782
- clear: both;
783
- padding-top: 0.5em;
784
- padding-bottom: 0.5em;
785
- display: block;
786
- font-size: 0.8em;
787
- line-height:1.4;
788
- text-align: justify;
789
- }
790
- .chefcookie__script-description-collapse,
791
- .chefcookie__script-description-collapse:focus {
792
- color:inherit;
793
- text-decoration:underline;
794
- padding-top: 0.25em;
795
- padding-bottom: 0.5em;
796
- display: block;
797
- }
798
- @media (hover: hover) {
799
- .chefcookie__script-description-collapse:hover
800
- {
801
- opacity: 0.9;
802
- color: inherit;
803
- text-decoration:underline;
804
- }
805
- }
806
- .chefcookie__script-description-content {
807
- height:0;
808
- overflow:hidden;
809
- transition: height ${this.animationSpeed / 1000}s ease-out;
810
- }
811
- .chefcookie__script-description-content > *:not(:last-child) {
812
- margin-bottom:0.5em;
813
- }
814
- .chefcookie__script-description-content table {
815
- width:100%;
816
- border-collapse: collapse;
817
- table-layout: fixed;
818
- }
819
- .chefcookie__script-description-content table td {
820
- border:1px solid ${this.hexToRgbaStr(this.config.style.color_text ?? '#595f60', 0.1)};
821
- padding: 0.3em 0.5em;
822
- vertical-align:top;
823
- }
824
-
825
- .chefcookie--noscroll body
826
- {
827
- position:fixed;
828
- width: 100%;
829
- overflow:hidden;
830
- }
831
- .chefcookie--fade body:after,
832
- .chefcookie--blur body:after
833
- {
834
- content:"";
835
- position:fixed;
836
- z-index: 2147483644;
837
- top:0;
838
- left:0;
839
- width:100%;
840
- height:100%;
841
- }
842
- .chefcookie--fade body:after
843
- {
844
- background-color: rgba(0, 0, 0, 0.65);
845
- }
846
- .chefcookie--blur body:after
847
- {
848
- backdrop-filter: grayscale(50%) blur(5px);
849
- }
850
- .chefcookie--overlay
851
- {
852
- top: 0;
853
- }
854
- .chefcookie--overlay .chefcookie__inner:before
855
- {
856
- content: '';
857
- display: inline-block;
858
- height: 100%;
859
- vertical-align: middle;
860
- }
861
- .chefcookie--overlay .chefcookie__box
862
- {
863
- width: 95%;
864
- max-width: 60em;
865
- box-shadow: 0 1em 5em -0.5em #000;
866
- background-color: ${this.config.style.color_background ?? '#eeeeee'};
867
- }
868
- .chefcookie--overlay .chefcookie__group
869
- {
870
- height: 13em;
871
- margin-bottom: 4%;
872
- background-color: rgba(${this.config.style.color_background != '' && ['#000', '#000000', 'black'].indexOf(this.config.style.color_background) > -1 ? '255, 255, 255' : '0, 0, 0'}, 0.05);
873
- border: 1px solid rgba(${this.config.style.color_background != '' && ['#000', '#000000', 'black'].indexOf(this.config.style.color_background) > -1 ? '255, 255, 255' : '0, 0, 0'}, 0.01);
874
- width: 48%;
875
- margin-right: 4%;
876
- }
877
- .chefcookie--overlay .chefcookie__group:nth-child(2n)
878
- {
879
- margin-right:0;
880
- }
881
- .chefcookie--overlay.chefcookie--has-scripts .chefcookie__group
882
- {
883
- height:auto;
884
- width: 100%;
885
- margin-right: 0;
886
- margin-bottom: 1em;
887
- }
888
- .chefcookie--overlay .chefcookie__group
889
- {
890
- padding: 1em 1.25em;
891
- }
892
- .chefcookie--bottombar,
893
- .chefcookie--topbar
894
- {
895
- background-color:${this.config.style.color_background ?? '#eeeeee'};
896
- box-shadow: 0 1em 5em -0.5em #000;
897
- }
898
- .chefcookie--bottombar
899
- {
900
- bottom:0;
901
- top:auto;
902
- }
903
- .chefcookie--topbar
904
- {
905
- bottom:auto;
906
- top:0;
907
- position:relative;
908
- }
909
- .chefcookie--bottombar .chefcookie__box,
910
- .chefcookie--topbar .chefcookie__box
911
- {
912
- max-width: 1280px;
913
- }
914
- .chefcookie--bottombar .chefcookie__group,
915
- .chefcookie--topbar .chefcookie__group
916
- {
917
- margin-top: 0px;
918
- margin-bottom: 1.5em;
919
- width: 22%;
920
- margin-right: 4%;
921
- }
922
- .chefcookie--bottombar .chefcookie__group:last-child,
923
- .chefcookie--topbar .chefcookie__group:last-child
924
- {
925
- margin-right:0;
926
- }
927
- .chefcookie--bottombar .chefcookie__groups--count-9 .chefcookie__group,
928
- .chefcookie--topbar .chefcookie__groups--count-9 .chefcookie__group { width: 7.55%; }
929
- .chefcookie--bottombar .chefcookie__groups--count-8 .chefcookie__group,
930
- .chefcookie--topbar .chefcookie__groups--count-8 .chefcookie__group { width: 9.00%; }
931
- .chefcookie--bottombar .chefcookie__groups--count-7 .chefcookie__group,
932
- .chefcookie--topbar .chefcookie__groups--count-7 .chefcookie__group { width: 10.85%; }
933
- .chefcookie--bottombar .chefcookie__groups--count-6 .chefcookie__group,
934
- .chefcookie--topbar .chefcookie__groups--count-6 .chefcookie__group { width: 13.33%; }
935
- .chefcookie--bottombar .chefcookie__groups--count-5 .chefcookie__group,
936
- .chefcookie--topbar .chefcookie__groups--count-5 .chefcookie__group { width: 16.80%; }
937
- .chefcookie--bottombar .chefcookie__groups--count-4 .chefcookie__group,
938
- .chefcookie--topbar .chefcookie__groups--count-4 .chefcookie__group { width: 22.00%; }
939
- .chefcookie--bottombar .chefcookie__groups--count-3 .chefcookie__group,
940
- .chefcookie--topbar .chefcookie__groups--count-3 .chefcookie__group { width: 30.66%; }
941
- .chefcookie--bottombar .chefcookie__groups--count-2 .chefcookie__group,
942
- .chefcookie--topbar .chefcookie__groups--count-2 .chefcookie__group { width: 48%; }
943
- .chefcookie--bottombar .chefcookie__groups--count-1 .chefcookie__group,
944
- .chefcookie--topbar .chefcookie__groups--count-1 .chefcookie__group { width: 100%; }
945
- @media screen and (max-width: 940px)
946
- {
947
- .chefcookie__button,
948
- .chefcookie__button:focus
949
- {
950
- float: none;
951
- margin: 0 0 1em;
952
- text-align: center;
953
- width: 100%;
954
- min-width:0;
955
- }
956
- }
957
- @media screen and (max-width: 840px)
958
- {
959
- .chefcookie__box
960
- {
961
- padding:1em;
962
- }
963
- .chefcookie__message h2
964
- {
965
- font-size:1.5em;
966
- line-height:1.4;
967
- }
968
- .chefcookie .chefcookie__group,
969
- .chefcookie--overlay .chefcookie__group,
970
- .chefcookie--bottombar .chefcookie__group,
971
- .chefcookie--topbar .chefcookie__group
972
- {
973
- float:none;
974
- margin-right:0;
975
- width:100% !important;
976
- height:auto;
977
- }
978
- }
979
- `;
322
+ var _this$config$style$co, _this$config$style$co2, _ref, _this$config$style$co3, _this$config$style$co4, _this$config$style$co5, _this$config$style$co6, _this$config$style$co7, _this$config$style$co8, _this$config$style$co9, _this$config$style$co0, _this$config$style$co1, _this$config$style$co10, _this$config$style$co11, _this$config$style$co12, _this$config$style$co13, _this$config$style$co14, _this$config$style$co15, _this$config$style$co16, _this$config$style$co17;
323
+ let css = "\n .chefcookie, .chefcookie *\n {\n box-sizing: border-box;\n margin:0;\n padding:0;\n }\n /* try to reset styles */\n .chefcookie h2,\n .chefcookie a:link,\n .chefcookie a:hover,\n .chefcookie a:visited\n {\n color:inherit;\n }\n .chefcookie\n {\n position: fixed;\n z-index: 2147483647;\n left: 0;\n right: 0;\n bottom: 0;\n transform: translateZ(0);\n }\n .chefcookie--hidden\n {\n opacity: 0;\n pointer-events:none;\n }\n .chefcookie__inner\n {\n width:100%;\n height:100%;\n text-align: center;\n white-space: nowrap;\n font-size: 0;\n overflow-y:auto;\n overflow-x:hidden;\n max-height:100vh;\n }\n .chefcookie__box\n {\n font-size: ".concat(15 + (this.config.style.size - 3), "px;\n line-height:1.6;\n color:").concat((_this$config$style$co = this.config.style.color_text) !== null && _this$config$style$co !== void 0 ? _this$config$style$co : '#595f60', ";\n width: 100%;\n margin: 0 auto;\n display: inline-block;\n vertical-align: middle;\n white-space: normal;\n border-radius: 0;\n padding-top: 2em;\n padding-bottom: 2em;\n padding-left: 3em;\n padding-right: 3em;\n text-align: left;\n }\n .chefcookie__message\n {\n margin-bottom:1.5em;\n text-align:justify;\n }\n .chefcookie__message h2\n {\n margin-bottom:0.5em;\n font-size:2em;\n line-height:1.4;\n text-transform:uppercase;\n font-weight:700;\n text-align:left;\n }\n .chefcookie__message p {\n font-size: 1em;\n line-height:1.6;\n }\n .chefcookie__message a,\n .chefcookie__message a:focus\n {\n color:inherit;\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n text-decoration:underline;\n font-size: 1em;\n line-height:1.6;\n }\n .chefcookie__message a:focus\n {\n outline:none;\n }\n @media (hover: hover) {\n .chefcookie__message a:hover\n {\n opacity: 0.5;\n color: inherit;\n }\n }\n .chefcookie__message a:active\n {\n opacity: 0.1;\n color: inherit;\n }\n .chefcookie__buttons\n {\n margin-top:0.5em;\n }\n .chefcookie__button,\n .chefcookie__button:focus\n {\n padding: 1em 0.5em;\n border: 2px solid ").concat((_this$config$style$co2 = this.config.style.color_text) !== null && _this$config$style$co2 !== void 0 ? _this$config$style$co2 : '#595f60', ";\n font-weight: bold;\n display: block;\n color: inherit;\n text-decoration: none;\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n text-transform: uppercase;\n float: left;\n text-align: center;\n min-width: 21em;\n margin-right:3em;\n }\n .chefcookie__buttons--count-3 .chefcookie__button,\n .chefcookie__buttons--count-3 .chefcookie__button:focus {\n min-width:15em;\n margin-right:1em;\n }\n .chefcookie__button:last-child\n {\n margin-right:0;\n }\n .chefcookie__button:focus\n {\n outline:none;\n }\n @media (hover: hover) {\n .chefcookie__button:hover\n {\n opacity: 0.5;\n text-decoration:none;\n color: inherit;\n }\n }\n .chefcookie__button:active\n {\n opacity: 0.1;\n color: inherit;\n }\n .chefcookie__buttons:after\n {\n clear:both;\n display:table;\n content:\"\";\n }\n ").concat(this.config.style.highlight_accept === undefined || this.config.style.highlight_accept === true ? "\n .chefcookie__button--accept\n {\n background-color:".concat((_ref = (_this$config$style$co3 = this.config.style.color_highlight) !== null && _this$config$style$co3 !== void 0 ? _this$config$style$co3 : this.config.style.color) !== null && _ref !== void 0 ? _ref : '#ff0000', ";\n border-color:transparent;\n }\n .chefcookie__button--accept.chefcookie__button--accept,\n .chefcookie__button--accept.chefcookie__button--accept:hover,\n .chefcookie__button--accept.chefcookie__button--accept:focus,\n .chefcookie__button--accept.chefcookie__button--accept:link,\n .chefcookie__button--accept.chefcookie__button--accept:visited\n {\n color:").concat((_this$config$style$co4 = this.config.style.color_background) !== null && _this$config$style$co4 !== void 0 ? _this$config$style$co4 : '#eeeeee', ";\n }\n ") : "", "\n .chefcookie__settings-container\n {\n height:0;\n overflow:hidden;\n transition: height ").concat(this.animationSpeed / 1000, "s ease-out;\n }\n .chefcookie__groups\n {\n list-style-type:none;\n }\n .chefcookie__groups:after\n {\n clear:both;\n display:table;\n content:\"\";\n }\n .chefcookie__group\n {\n float: left;\n }\n .chefcookie__group:before\n {\n display:none;\n }\n .chefcookie__group-title\n {\n float:left;\n width:70%;\n min-height: 1.66em;\n line-height: 1.66;\n display: block;\n font-weight:bold;\n font-size:1.2em;\n line-height:1.7;\n text-transform:uppercase;\n }\n .chefcookie__group-label\n {\n cursor: pointer;\n display:block;\n width:100%;\n height:100%;\n font-size:1em;\n line-height:1.6;\n }\n .chefcookie__group-label:after\n {\n clear:both;\n display:table;\n content:\"\"\n }\n .chefcookie__group--disabled .chefcookie__group-label\n {\n cursor:default;\n }\n .chefcookie__group-checkbox\n {\n opacity: 0;\n position:absolute;\n display: block;\n pointer-events:none;\n }\n .chefcookie__group--disabled .chefcookie__group-checkbox-icon\n {\n ").concat(this.config.style.show_disabled_checkbox === undefined || this.config.style.show_disabled_checkbox === false ? "display:none;" : "opacity: 0.75 !important;", "\n }\n .chefcookie__group-checkbox-icon\n {\n line-height:2;\n display: block;\n width: 4em;\n height: 2em;\n background-color: ").concat((_this$config$style$co5 = this.config.style.color_background) !== null && _this$config$style$co5 !== void 0 ? _this$config$style$co5 : '#eeeeee', ";\n border: 2px solid ").concat((_this$config$style$co6 = this.config.style.color_text) !== null && _this$config$style$co6 !== void 0 ? _this$config$style$co6 : '#595f60', ";\n margin: 0;\n padding: 0;\n position: relative;\n border-radius: 2em;\n float: right;\n }\n .chefcookie__group-checkbox-icon:before\n {\n content: \"0\";\n position: absolute;\n top: 0;\n left: 45%;\n width: 50%;\n bottom: 0;\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n text-align: center;\n font-weight: bold;\n font-size: 1em;\n line-height: 2;\n opacity: 0.25;\n color: ").concat((_this$config$style$co7 = this.config.style.color_text) !== null && _this$config$style$co7 !== void 0 ? _this$config$style$co7 : '#595f60', ";\n }\n .chefcookie__group-checkbox-icon:after\n {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 50%;\n bottom: 0;\n box-shadow: 0 0 0px 1px ").concat((_this$config$style$co8 = this.config.style.color_text) !== null && _this$config$style$co8 !== void 0 ? _this$config$style$co8 : '#595f60', ";\n background-color: ").concat((_this$config$style$co9 = this.config.style.color_text) !== null && _this$config$style$co9 !== void 0 ? _this$config$style$co9 : '#595f60', ";\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n border-radius: 50%;\n }\n .chefcookie__group-checkbox ~ *\n {\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n }\n .chefcookie__group-checkbox[data-status=\"0\"] ~ *\n {\n opacity: 0.75;\n }\n .chefcookie__group-checkbox[data-status=\"1\"] ~ .chefcookie__group-checkbox-icon\n {\n opacity: 0.85;\n }\n .chefcookie__group-checkbox[data-status=\"1\"] ~ .chefcookie__group-checkbox-icon:after\n {\n left:25%;\n }\n .chefcookie__group-checkbox[data-status=\"2\"] ~ .chefcookie__group-checkbox-icon:after\n {\n left:50%;\n }\n .chefcookie__group-checkbox[data-status=\"1\"] ~ .chefcookie__group-checkbox-icon:before,\n .chefcookie__group-checkbox[data-status=\"2\"] ~ .chefcookie__group-checkbox-icon:before\n {\n content: \"\";\n background-color: ").concat((_this$config$style$co0 = this.config.style.color_text) !== null && _this$config$style$co0 !== void 0 ? _this$config$style$co0 : '#595f60', ";\n top: 30%;\n bottom: 30%;\n left: 27%;\n width: 3px;\n }\n .chefcookie__group-description\n {\n width:100%;\n clear:both;\n padding-top:1em;\n display: block;\n font-size:0.9em;\n line-height:1.5;\n text-align:justify;\n font-weight: normal;\n }\n .chefcookie__group-collapse,\n .chefcookie__group-collapse:focus {\n color:inherit;\n text-decoration:underline;\n padding-top: 0.5em;\n display: block;\n }\n @media (hover: hover) {\n .chefcookie__group-collapse:hover\n {\n opacity: 0.9;\n color: inherit;\n text-decoration:underline;\n }\n }\n .chefcookie__scripts\n {\n list-style-type:none;\n height:0;\n overflow:hidden;\n transition: height ").concat(this.animationSpeed / 1000, "s ease-out;\n }\n .chefcookie__scripts--visible {\n height:auto;\n }\n .chefcookie__script {\n margin-bottom:0.5em;\n }\n .chefcookie__script:before\n {\n display:none;\n }\n .chefcookie__script:first-child {\n margin-top:1em;\n }\n .chefcookie__script:last-child {\n margin-bottom:0;\n }\n .chefcookie__script-title\n {\n float:left;\n width:70%;\n min-height: 1.66em;\n line-height: 1.66;\n display: block;\n }\n .chefcookie__script-label\n {\n cursor: pointer;\n display:block;\n width:100%;\n height:100%;\n }\n .chefcookie__script-label:after\n {\n clear:both;\n display:table;\n content:\"\"\n }\n .chefcookie__script--disabled .chefcookie__script-label\n {\n cursor:default;\n }\n .chefcookie__script-checkbox\n {\n opacity: 0;\n position:absolute;\n display: block;\n pointer-events:none;\n }\n .chefcookie__script--disabled .chefcookie__script-checkbox-icon\n {\n ").concat(this.config.style.show_disabled_checkbox === undefined || this.config.style.show_disabled_checkbox === false ? "display:none;" : "opacity: 0.75 !important;", "\n }\n .chefcookie__script-checkbox-icon\n {\n line-height:1.5;\n display: block;\n width: 3em;\n height: 1.5em;\n background-color: ").concat((_this$config$style$co1 = this.config.style.color_background) !== null && _this$config$style$co1 !== void 0 ? _this$config$style$co1 : '#eeeeee', ";\n border: 1px solid ").concat((_this$config$style$co10 = this.config.style.color_text) !== null && _this$config$style$co10 !== void 0 ? _this$config$style$co10 : '#595f60', ";\n margin: 0;\n padding: 0;\n position: relative;\n border-radius: 2em;\n float: right;\n }\n .chefcookie__script-checkbox-icon:before\n {\n content: \"0\";\n position: absolute;\n top: 0;\n left: 45%;\n width: 50%;\n bottom: 0;\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n text-align: center;\n font-size: 0.7em;\n line-height: 2;\n opacity: 0.25;\n color: ").concat((_this$config$style$co11 = this.config.style.color_text) !== null && _this$config$style$co11 !== void 0 ? _this$config$style$co11 : '#595f60', ";\n }\n .chefcookie__script-checkbox-icon:after\n {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 50%;\n bottom: 0;\n box-shadow: 0 0 0px 1px ").concat((_this$config$style$co12 = this.config.style.color_text) !== null && _this$config$style$co12 !== void 0 ? _this$config$style$co12 : '#595f60', ";\n background-color: ").concat((_this$config$style$co13 = this.config.style.color_text) !== null && _this$config$style$co13 !== void 0 ? _this$config$style$co13 : '#595f60', ";\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n border-radius: 50%;\n }\n .chefcookie__script-checkbox ~ *\n {\n opacity: 0.75;\n transition: all ").concat(this.animationSpeed / 1000, "s ease-in-out;\n }\n .chefcookie__script-checkbox:checked ~ *\n {\n opacity:1;\n }\n .chefcookie__script-checkbox:checked ~ .chefcookie__script-checkbox-icon:after\n {\n left:50%;\n }\n .chefcookie__script-checkbox:checked ~ .chefcookie__script-checkbox-icon:before\n {\n content: \"\";\n background-color: ").concat((_this$config$style$co14 = this.config.style.color_text) !== null && _this$config$style$co14 !== void 0 ? _this$config$style$co14 : '#595f60', ";\n top: 30%;\n bottom: 30%;\n left: 27%;\n width: 2px;\n }\n\n .chefcookie__script-description\n {\n width: 100%;\n clear: both;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n display: block;\n font-size: 0.8em;\n line-height:1.4;\n text-align: justify;\n }\n .chefcookie__script-description-collapse,\n .chefcookie__script-description-collapse:focus {\n color:inherit;\n text-decoration:underline;\n padding-top: 0.25em;\n padding-bottom: 0.5em;\n display: block;\n }\n @media (hover: hover) {\n .chefcookie__script-description-collapse:hover\n {\n opacity: 0.9;\n color: inherit;\n text-decoration:underline;\n }\n }\n .chefcookie__script-description-content {\n height:0;\n overflow:hidden;\n transition: height ").concat(this.animationSpeed / 1000, "s ease-out;\n }\n .chefcookie__script-description-content > *:not(:last-child) {\n margin-bottom:0.5em;\n }\n .chefcookie__script-description-content table {\n width:100%;\n border-collapse: collapse;\n table-layout: fixed;\n }\n .chefcookie__script-description-content table td {\n border:1px solid ").concat(this.hexToRgbaStr((_this$config$style$co15 = this.config.style.color_text) !== null && _this$config$style$co15 !== void 0 ? _this$config$style$co15 : '#595f60', 0.1), ";\n padding: 0.3em 0.5em;\n vertical-align:top;\n }\n\n .chefcookie--noscroll body\n {\n position:fixed;\n width: 100%;\n overflow:hidden;\n }\n .chefcookie--fade body:after,\n .chefcookie--blur body:after\n {\n content:\"\";\n position:fixed;\n z-index: 2147483644;\n top:0;\n left:0;\n width:100%;\n height:100%;\n }\n .chefcookie--fade body:after\n {\n background-color: rgba(0, 0, 0, 0.65);\n }\n .chefcookie--blur body:after\n {\n backdrop-filter: grayscale(50%) blur(5px);\n }\n .chefcookie--overlay\n {\n top: 0;\n }\n .chefcookie--overlay .chefcookie__inner:before\n {\n content: '';\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n }\n .chefcookie--overlay .chefcookie__box\n {\n width: 95%;\n max-width: 60em;\n box-shadow: 0 1em 5em -0.5em #000;\n background-color: ").concat((_this$config$style$co16 = this.config.style.color_background) !== null && _this$config$style$co16 !== void 0 ? _this$config$style$co16 : '#eeeeee', ";\n }\n .chefcookie--overlay .chefcookie__group\n {\n height: 13em;\n margin-bottom: 4%;\n background-color: rgba(").concat(this.config.style.color_background != '' && ['#000', '#000000', 'black'].indexOf(this.config.style.color_background) > -1 ? '255, 255, 255' : '0, 0, 0', ", 0.05);\n border: 1px solid rgba(").concat(this.config.style.color_background != '' && ['#000', '#000000', 'black'].indexOf(this.config.style.color_background) > -1 ? '255, 255, 255' : '0, 0, 0', ", 0.01);\n width: 48%;\n margin-right: 4%;\n }\n .chefcookie--overlay .chefcookie__group:nth-child(2n)\n {\n margin-right:0;\n }\n .chefcookie--overlay.chefcookie--has-scripts .chefcookie__group\n {\n height:auto;\n width: 100%;\n margin-right: 0;\n margin-bottom: 1em;\n }\n .chefcookie--overlay .chefcookie__group\n {\n padding: 1em 1.25em;\n }\n .chefcookie--bottombar,\n .chefcookie--topbar\n {\n background-color:").concat((_this$config$style$co17 = this.config.style.color_background) !== null && _this$config$style$co17 !== void 0 ? _this$config$style$co17 : '#eeeeee', ";\n box-shadow: 0 1em 5em -0.5em #000;\n }\n .chefcookie--bottombar\n {\n bottom:0;\n top:auto;\n }\n .chefcookie--topbar\n {\n bottom:auto;\n top:0;\n position:relative;\n }\n .chefcookie--bottombar .chefcookie__box,\n .chefcookie--topbar .chefcookie__box\n {\n max-width: 1280px;\n }\n .chefcookie--bottombar .chefcookie__group,\n .chefcookie--topbar .chefcookie__group\n {\n margin-top: 0px;\n margin-bottom: 1.5em;\n width: 22%;\n margin-right: 4%;\n }\n .chefcookie--bottombar .chefcookie__group:last-child,\n .chefcookie--topbar .chefcookie__group:last-child\n {\n margin-right:0;\n }\n .chefcookie--bottombar .chefcookie__groups--count-9 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-9 .chefcookie__group { width: 7.55%; }\n .chefcookie--bottombar .chefcookie__groups--count-8 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-8 .chefcookie__group { width: 9.00%; }\n .chefcookie--bottombar .chefcookie__groups--count-7 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-7 .chefcookie__group { width: 10.85%; }\n .chefcookie--bottombar .chefcookie__groups--count-6 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-6 .chefcookie__group { width: 13.33%; }\n .chefcookie--bottombar .chefcookie__groups--count-5 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-5 .chefcookie__group { width: 16.80%; }\n .chefcookie--bottombar .chefcookie__groups--count-4 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-4 .chefcookie__group { width: 22.00%; }\n .chefcookie--bottombar .chefcookie__groups--count-3 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-3 .chefcookie__group { width: 30.66%; }\n .chefcookie--bottombar .chefcookie__groups--count-2 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-2 .chefcookie__group { width: 48%; }\n .chefcookie--bottombar .chefcookie__groups--count-1 .chefcookie__group,\n .chefcookie--topbar .chefcookie__groups--count-1 .chefcookie__group { width: 100%; }\n @media screen and (max-width: 940px)\n {\n .chefcookie__button,\n .chefcookie__button:focus\n {\n float: none;\n margin: 0 0 1em;\n text-align: center;\n width: 100%;\n min-width:0;\n }\n }\n @media screen and (max-width: 840px)\n {\n .chefcookie__box\n {\n padding:1em;\n }\n .chefcookie__message h2\n {\n font-size:1.5em;\n line-height:1.4;\n }\n .chefcookie .chefcookie__group,\n .chefcookie--overlay .chefcookie__group,\n .chefcookie--bottombar .chefcookie__group,\n .chefcookie--topbar .chefcookie__group\n {\n float:none;\n margin-right:0;\n width:100% !important;\n height:auto;\n }\n }\n ");
980
324
  if ('css_replace' in this.config.style && this.config.style.css_replace !== undefined && this.config.style.css_replace !== null && this.config.style.css_replace !== '') {
981
325
  css = this.config.style.css_replace;
982
326
  }
@@ -1005,55 +349,7 @@ class chefcookie {
1005
349
  }
1006
350
  }
1007
351
  buildDom() {
1008
- document.body.insertAdjacentHTML('afterbegin', `
1009
- <div class="chefcookie chefcookie--${this.config.style.layout} chefcookie--columns-${'columns' in this.config.style ? this.config.style.columns : 'auto'}${'scripts_selection' in this.config && this.config.scripts_selection !== false ? ` chefcookie--has-scripts` : ``} chefcookie--hidden">
1010
- <div class="chefcookie__inner">
1011
- <div class="chefcookie__box">
1012
- <div class="chefcookie__message">${this.translate(this.config.message)}</div>
1013
- <div class="chefcookie__settings-container">
1014
- <ul class="chefcookie__groups chefcookie__groups--count-${this.config.settings.length}">
1015
- ${this.config.settings.map((group, i) => `
1016
- <li class="chefcookie__group${group.cannot_be_modified ? ` chefcookie__group--disabled` : ``}">
1017
- <label class="chefcookie__group-label" for="chefcookie_group_${i}">
1018
- <input${group.cannot_be_modified ? ` disabled="disabled"` : ``} class="chefcookie__group-checkbox" data-status="${this.isCheckboxActiveForGroup(i)}" id="chefcookie_group_${i}" type="checkbox" name="chefcookie_group[]" value="${i}"${this.isCheckboxActiveForGroup(i) === 2 ? ` checked="checked"` : ``} />
1019
- <span class="chefcookie__group-title">${this.translate(group.title)}</span>
1020
- <span class="chefcookie__group-checkbox-icon"></span>
1021
- ${'description' in group && group.description != '' ? `
1022
- <span class="chefcookie__group-description">${this.translate(group.description)}</span>
1023
- ` : ``}
1024
- ${'scripts_selection' in this.config && this.config.scripts_selection === 'collapse' && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? `
1025
- <a href="#" class="chefcookie__group-collapse">${this.getLabel('group_open') != '' ? this.getLabel('group_open') : this.getLabel('settings_open')}</a>
1026
- ` : ``}
1027
- </label>
1028
- ${'scripts_selection' in this.config && this.config.scripts_selection !== false && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? `
1029
- <ul class="chefcookie__scripts chefcookie__scripts--count-${Object.keys(group.scripts).length}${this.config.scripts_selection !== 'collapse' ? ` chefcookie__scripts--visible` : ``}">
1030
- ${Object.keys(group.scripts).map(j => `
1031
- <li class="chefcookie__script${group.cannot_be_modified ? ` chefcookie__script--disabled` : ``}">
1032
- <label class="chefcookie__script-label" for="chefcookie_script_${i}_${j}">
1033
- <input${group.cannot_be_modified ? ` disabled="disabled"` : ``} class="chefcookie__script-checkbox" id="chefcookie_script_${i}_${j}" type="checkbox" name="chefcookie_script[]" value="${i}|${j}"${this.isCheckboxActiveForProvider(i, j) ? ` checked="checked"` : ``} />
1034
- <span class="chefcookie__script-title">${typeof group.scripts[j] === 'object' && group.scripts[j] !== null && 'title' in group.scripts[j] && group.scripts[j].title != '' ? this.translate(group.scripts[j].title) : j}</span>
1035
- <span class="chefcookie__script-checkbox-icon"></span>
1036
- </label>
1037
- ${typeof group.scripts[j] === 'object' && group.scripts[j] !== null && 'description' in group.scripts[j] && group.scripts[j].description != '' ? '<div class="chefcookie__script-description">' + '<a href="#" class="chefcookie__script-description-collapse">' + this.getLabel('details_open') + '</a>' + '<div class="chefcookie__script-description-content">' + this.translate(group.scripts[j].description) + '</div>' + '</div>' : ''}
1038
- </li>
1039
- `).join('')}
1040
- </ul>
1041
- ` : ``}
1042
- </li>
1043
- `).join('')}
1044
- </ul>
1045
- </div>
1046
- <div class="chefcookie__buttons chefcookie__buttons--count-${'show_decline_button' in this.config && this.config.show_decline_button === true ? '3' : '2'}">
1047
- <a href="#chefcookie__settings" class="chefcookie__button chefcookie__button--settings">${this.getLabel('settings_open')}</a>
1048
- <a href="#chefcookie__accept" class="chefcookie__button chefcookie__button--accept cookie-compliance-ok-btn">${this.getLabel(this.config.accept_all_if_settings_closed === undefined || this.config.accept_all_if_settings_closed === false ? 'accept' : 'accept_all')}</a>
1049
- ${'show_decline_button' in this.config && this.config.show_decline_button === true ? `
1050
- <a href="#chefcookie__decline" class="chefcookie__button chefcookie__button--decline">${this.getLabel('decline')}</a>
1051
- ` : ''}
1052
- </div>
1053
- </div>
1054
- </div>
1055
- </div>
1056
- `);
352
+ document.body.insertAdjacentHTML('afterbegin', "\n <div class=\"chefcookie chefcookie--".concat(this.config.style.layout, " chefcookie--columns-").concat('columns' in this.config.style ? this.config.style.columns : 'auto').concat('scripts_selection' in this.config && this.config.scripts_selection !== false ? " chefcookie--has-scripts" : "", " chefcookie--hidden\">\n <div class=\"chefcookie__inner\">\n <div class=\"chefcookie__box\">\n <div class=\"chefcookie__message\">").concat(this.translate(this.config.message), "</div>\n <div class=\"chefcookie__settings-container\">\n <ul class=\"chefcookie__groups chefcookie__groups--count-").concat(this.config.settings.length, "\">\n ").concat(this.config.settings.map((group, i) => "\n <li class=\"chefcookie__group".concat(group.cannot_be_modified ? " chefcookie__group--disabled" : "", "\">\n <label class=\"chefcookie__group-label\" for=\"chefcookie_group_").concat(i, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__group-checkbox\" data-status=\"").concat(this.isCheckboxActiveForGroup(i), "\" id=\"chefcookie_group_").concat(i, "\" type=\"checkbox\" name=\"chefcookie_group[]\" value=\"").concat(i, "\"").concat(this.isCheckboxActiveForGroup(i) === 2 ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__group-title\">").concat(this.translate(group.title), "</span>\n <span class=\"chefcookie__group-checkbox-icon\"></span>\n ").concat('description' in group && group.description != '' ? "\n <span class=\"chefcookie__group-description\">".concat(this.translate(group.description), "</span>\n ") : "", "\n ").concat('scripts_selection' in this.config && this.config.scripts_selection === 'collapse' && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <a href=\"#\" class=\"chefcookie__group-collapse\">".concat(this.getLabel('group_open') != '' ? this.getLabel('group_open') : this.getLabel('settings_open'), "</a>\n ") : "", "\n </label>\n ").concat('scripts_selection' in this.config && this.config.scripts_selection !== false && 'scripts' in group && Object.keys(group.scripts).length > 0 && Object.keys(group.scripts)[0].indexOf('dummy_') === -1 ? "\n <ul class=\"chefcookie__scripts chefcookie__scripts--count-".concat(Object.keys(group.scripts).length).concat(this.config.scripts_selection !== 'collapse' ? " chefcookie__scripts--visible" : "", "\">\n ").concat(Object.keys(group.scripts).map(j => "\n <li class=\"chefcookie__script".concat(group.cannot_be_modified ? " chefcookie__script--disabled" : "", "\">\n <label class=\"chefcookie__script-label\" for=\"chefcookie_script_").concat(i, "_").concat(j, "\">\n <input").concat(group.cannot_be_modified ? " disabled=\"disabled\"" : "", " class=\"chefcookie__script-checkbox\" id=\"chefcookie_script_").concat(i, "_").concat(j, "\" type=\"checkbox\" name=\"chefcookie_script[]\" value=\"").concat(i, "|").concat(j, "\"").concat(this.isCheckboxActiveForProvider(i, j) ? " checked=\"checked\"" : "", " />\n <span class=\"chefcookie__script-title\">").concat(typeof group.scripts[j] === 'object' && group.scripts[j] !== null && 'title' in group.scripts[j] && group.scripts[j].title != '' ? this.translate(group.scripts[j].title) : j, "</span>\n <span class=\"chefcookie__script-checkbox-icon\"></span>\n </label>\n ").concat(typeof group.scripts[j] === 'object' && group.scripts[j] !== null && 'description' in group.scripts[j] && group.scripts[j].description != '' ? '<div class="chefcookie__script-description">' + '<a href="#" class="chefcookie__script-description-collapse">' + this.getLabel('details_open') + '</a>' + '<div class="chefcookie__script-description-content">' + this.translate(group.scripts[j].description) + '</div>' + '</div>' : '', "\n </li>\n ")).join(''), "\n </ul>\n ") : "", "\n </li>\n ")).join(''), "\n </ul>\n </div>\n <div class=\"chefcookie__buttons chefcookie__buttons--count-").concat('show_decline_button' in this.config && this.config.show_decline_button === true ? '3' : '2', "\">\n <a href=\"#chefcookie__settings\" class=\"chefcookie__button chefcookie__button--settings\">").concat(this.getLabel('settings_open'), "</a>\n <a href=\"#chefcookie__accept\" class=\"chefcookie__button chefcookie__button--accept cookie-compliance-ok-btn\">").concat(this.getLabel(this.config.accept_all_if_settings_closed === undefined || this.config.accept_all_if_settings_closed === false ? 'accept' : 'accept_all'), "</a>\n ").concat('show_decline_button' in this.config && this.config.show_decline_button === true ? "\n <a href=\"#chefcookie__decline\" class=\"chefcookie__button chefcookie__button--decline\">".concat(this.getLabel('decline'), "</a>\n ") : '', "\n </div>\n </div>\n </div>\n </div>\n "));
1057
353
  }
1058
354
  getLabel(label) {
1059
355
  if (this.config.labels[label] === undefined) {
@@ -1222,17 +518,16 @@ class chefcookie {
1222
518
  secure: true,
1223
519
  samesite: 'None'
1224
520
  } : {};
1225
- document.cookie = _cookie.default.serialize(cookie_name, value, {
521
+ document.cookie = cookie.stringifySetCookie(cookie_name, value, _objectSpread({
1226
522
  httpOnly: false,
1227
523
  maxAge: 60 * 60 * 24 * days,
1228
524
  path: '/',
1229
- domain: cookie_domain && window.location.hostname.endsWith(cookie_domain) ? cookie_domain : undefined,
1230
- ...options
1231
- });
525
+ domain: cookie_domain && window.location.hostname.endsWith(cookie_domain) ? cookie_domain : undefined
526
+ }, options));
1232
527
  }
1233
528
  getCookie(name) {
1234
529
  const cookie_name = this.getCookieName(name);
1235
- return _cookie.default.parse(document.cookie)[cookie_name];
530
+ return cookie.parseCookie(document.cookie)[cookie_name];
1236
531
  }
1237
532
  isCheckboxActiveForGroup(group_index) {
1238
533
  let group;
@@ -1290,8 +585,8 @@ class chefcookie {
1290
585
  if (el.closest('.chefcookie__group').querySelector('.chefcookie__script-checkbox') === null) {
1291
586
  if (el.checked === true) {
1292
587
  if (this.config.settings[el.value].scripts !== undefined) {
1293
- Object.entries(this.config.settings[el.value].scripts).forEach(_ref => {
1294
- let [scripts__key, scripts__value] = _ref;
588
+ Object.entries(this.config.settings[el.value].scripts).forEach(_ref2 => {
589
+ let [scripts__key, scripts__value] = _ref2;
1295
590
  providers.push(scripts__key);
1296
591
  });
1297
592
  }
@@ -1350,8 +645,8 @@ class chefcookie {
1350
645
  let accept_all = true;
1351
646
  this.config.settings.forEach(settings__value => {
1352
647
  if (settings__value.scripts !== undefined) {
1353
- Object.entries(settings__value.scripts).forEach(_ref2 => {
1354
- let [scripts__key, scripts__value] = _ref2;
648
+ Object.entries(settings__value.scripts).forEach(_ref3 => {
649
+ let [scripts__key, scripts__value] = _ref3;
1355
650
  if (settings.split(',').indexOf(scripts__key) === -1) {
1356
651
  accept_all = false;
1357
652
  return;
@@ -1375,8 +670,8 @@ class chefcookie {
1375
670
  }
1376
671
  this.config.settings.forEach(settings__value => {
1377
672
  if (settings__value.scripts !== undefined) {
1378
- Object.entries(settings__value.scripts).forEach(_ref3 => {
1379
- let [scripts__key, scripts__value] = _ref3;
673
+ Object.entries(settings__value.scripts).forEach(_ref4 => {
674
+ let [scripts__key, scripts__value] = _ref4;
1380
675
  if (scripts__key !== provider) {
1381
676
  return;
1382
677
  }
@@ -1391,8 +686,8 @@ class chefcookie {
1391
686
  autoAcceptBasicScripts() {
1392
687
  this.config.settings.forEach(settings__value => {
1393
688
  if (settings__value.scripts !== undefined && settings__value.initial_tracking === true) {
1394
- Object.entries(settings__value.scripts).forEach(_ref4 => {
1395
- let [scripts__key, scripts__value] = _ref4;
689
+ Object.entries(settings__value.scripts).forEach(_ref5 => {
690
+ let [scripts__key, scripts__value] = _ref5;
1396
691
  this.accept(scripts__key, false);
1397
692
  });
1398
693
  }
@@ -1402,8 +697,8 @@ class chefcookie {
1402
697
  let providers = [];
1403
698
  this.config.settings.forEach(settings__value => {
1404
699
  if (settings__value.scripts !== undefined) {
1405
- Object.entries(settings__value.scripts).forEach(_ref5 => {
1406
- let [scripts__key, scripts__value] = _ref5;
700
+ Object.entries(settings__value.scripts).forEach(_ref6 => {
701
+ let [scripts__key, scripts__value] = _ref6;
1407
702
  this.accept(scripts__key, false);
1408
703
  });
1409
704
  }
@@ -1492,50 +787,19 @@ class chefcookie {
1492
787
  }
1493
788
  if (provider === 'microsoft') {
1494
789
  let script = document.createElement('script');
1495
- script.innerHTML = `
1496
- (function(w,d,t,r,u)
1497
- {
1498
- var f,n,i;
1499
- w[u]=w[u]||[],f=function()
1500
- {
1501
- var o={ti:"${id}", enableAutoSpaTracking: true};
1502
- o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")
1503
- },
1504
- n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function()
1505
- {
1506
- var s=this.readyState;
1507
- s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)
1508
- },
1509
- i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)
1510
- })
1511
- (window,document,"script","//bat.bing.com/bat.js","uetq");
1512
- `;
790
+ script.innerHTML = "\n (function(w,d,t,r,u)\n {\n var f,n,i;\n w[u]=w[u]||[],f=function()\n {\n var o={ti:\"".concat(id, "\", enableAutoSpaTracking: true};\n o.q=w[u],w[u]=new UET(o),w[u].push(\"pageLoad\")\n },\n n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function()\n {\n var s=this.readyState;\n s&&s!==\"loaded\"&&s!==\"complete\"||(f(),n.onload=n.onreadystatechange=null)\n },\n i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)\n })\n (window,document,\"script\",\"//bat.bing.com/bat.js\",\"uetq\");\n ");
1513
791
  document.head.appendChild(script);
1514
792
  this.setLoaded(provider);
1515
793
  }
1516
794
  if (provider === 'linkedin') {
1517
795
  let script = document.createElement('script');
1518
- script.innerHTML = `
1519
- _linkedin_partner_id = "${id}";
1520
- window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];
1521
- window._linkedin_data_partner_ids.push(_linkedin_partner_id);
1522
- `;
796
+ script.innerHTML = "\n _linkedin_partner_id = \"".concat(id, "\";\n window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || [];\n window._linkedin_data_partner_ids.push(_linkedin_partner_id);\n ");
1523
797
  document.body.appendChild(script);
1524
798
  script = document.createElement('script');
1525
- script.innerHTML = `
1526
- (function(l) {if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};
1527
- window.lintrk.q=[]}
1528
- var s = document.getElementsByTagName("script")[0];
1529
- var b = document.createElement("script");
1530
- b.type = "text/javascript";b.async = true;
1531
- b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js";
1532
- s.parentNode.insertBefore(b, s);})(window.lintrk);
1533
- `;
799
+ script.innerHTML = "\n (function(l) {if (!l){window.lintrk = function(a,b){window.lintrk.q.push([a,b])};\n window.lintrk.q=[]}\n var s = document.getElementsByTagName(\"script\")[0];\n var b = document.createElement(\"script\");\n b.type = \"text/javascript\";b.async = true;\n b.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\n s.parentNode.insertBefore(b, s);})(window.lintrk);\n ";
1534
800
  document.body.appendChild(script);
1535
801
  script = document.createElement('noscript');
1536
- script.innerHTML = `
1537
- <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=${id}&fmt=gif" />
1538
- `;
802
+ script.innerHTML = "\n <img height=\"1\" width=\"1\" style=\"display:none;\" alt=\"\" src=\"https://px.ads.linkedin.com/collect/?pid=".concat(id, "&fmt=gif\" />\n ");
1539
803
  document.body.appendChild(script);
1540
804
  this.setLoaded(provider);
1541
805
  }
@@ -1566,7 +830,7 @@ class chefcookie {
1566
830
  if (provider === 'etracker') {
1567
831
  let script;
1568
832
  script = document.createElement('script');
1569
- script.innerHTML = `if(window._etr === undefined) { window._etr = {eoBlocked:true}; }`;
833
+ script.innerHTML = "if(window._etr === undefined) { window._etr = {eoBlocked:true}; }";
1570
834
  document.head.appendChild(script);
1571
835
  script = document.createElement('script');
1572
836
  script.onload = () => {
@@ -1583,19 +847,7 @@ class chefcookie {
1583
847
  }
1584
848
  if (provider === 'matomo') {
1585
849
  let script = document.createElement('script');
1586
- script.innerHTML = `
1587
- var _paq = window._paq = window._paq || [];
1588
- /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
1589
- _paq.push(['trackPageView']);
1590
- _paq.push(['enableLinkTracking']);
1591
- (function() {
1592
- var u="//${id.split('#')[0]}/";
1593
- _paq.push(['setTrackerUrl', u+'matomo.php']);
1594
- _paq.push(['setSiteId', '${id.split('#')[1]}']);
1595
- var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
1596
- g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
1597
- })();
1598
- `;
850
+ script.innerHTML = "\n var _paq = window._paq = window._paq || [];\n /* tracker methods like \"setCustomDimension\" should be called before \"trackPageView\" */\n _paq.push(['trackPageView']);\n _paq.push(['enableLinkTracking']);\n (function() {\n var u=\"//".concat(id.split('#')[0], "/\";\n _paq.push(['setTrackerUrl', u+'matomo.php']);\n _paq.push(['setSiteId', '").concat(id.split('#')[1], "']);\n var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];\n g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);\n })();\n ");
1599
851
  document.head.appendChild(script);
1600
852
  this.setLoaded(provider);
1601
853
  }