PageSourceSearch

https://www.baysf.de/themes/custom/baysf/assets/js/CookieYouTubeBanner.js

js baysf.de collected 2026-10-02 07:38:16 UTC 4,389 bytes, 91 lines download raw bytes

1var __defProp = Object.defineProperty;
2var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3var __publicField = (obj, key, value) => {
4  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5  return value;
6};
7function __vite_legacy_guard() {
8  import.meta.url;
9  import("_").catch(() => 1);
10  (async function* () {
11  })().next();
12}
13;
14import { A as AbstractComponent } from "./AbstractComponent.js";
15class CookieYouTubeBanner extends AbstractComponent {
16  constructor(element) {
17    super(element);
18  }
19  static bindEventListeners() {
20    const closeModalButton = document.querySelector(".close-modal-btn");
21    closeModalButton == null ? void 0 : closeModalButton.addEventListener("click", () => {
22      const modal = document.querySelector(".cookie-modal");
23      this.removeModal(modal);
24    });
25    const openCookieSettingsButton = document.querySelector(".cookie-settings-btn");
26    openCookieSettingsButton == null ? void 0 : openCookieSettingsButton.addEventListener("click", () => {
27      var _a;
28      (_a = Drupal == null ? void 0 : Drupal.eu_cookie_compliance) == null ? void 0 : _a.withdrawAction();
29    });
30  }
31  static isCookieSet(cookieValue) {
32    const cookieName = "cookie-agreed-categories";
33    const cookies = document.cookie.split(";");
34    return cookies.some((cookie) => {
35      const [name, value] = cookie.trim().split("=");
36      return name === cookieName && value.includes(cookieValue);
37    });
38  }
39  static toggleModal(open) {
40    if (!open) {
41      const modal = document.querySelector(".cookie-modal");
42      this.removeModal(modal);
43    } else {
44      this.addModal();
45      this.bindEventListeners();
46    }
47  }
48  static removeModal(modal) {
49    if (modal) {
50      document.body.removeChild(modal);
51    }
52  }
53  static addModal() {
54    if (document.querySelector(".cookie-modal")) {
55      return;
56    }
57    const modal = document.createElement("div");
58    modal.classList.add(
59      "cookie-modal",
60      "fixed",
61      "inset-0",
62      "bg-black",
63      "bg-opacity-50",
64      "flex",
65      "justify-center",
66      "items-center",
67      "z-50"
68    );
69    modal.setAttribute("role", "dialog");
70    modal.setAttribute("aria-modal", "true");
71    modal.setAttribute("aria-labelledby", "cookie-modal-title");
72    modal.setAttribute("aria-describedby", "cookie-modal-description");
73    const modalContent = '\n        <div class="cookie-modal-youtube bg-white rounded-lg shadow-lg p-6 w-full max-w-xl text-black text-center relative">\n            <button class="absolute top-3 right-3 text-gray-600 hover:text-gray-900 close-modal-btn" aria-label="Modal schließen">\n              <i class="icon icon-close" aria-hidden="true"></i>\n            </button>\n            <h2 id="cookie-modal-title" class="text-xl font-bold mb-4">Cookies von Drittanbietern zulassen</h2>\n            <p id="cookie-modal-description" class="mb-[3rem]">Um dieses Video anzusehen, müssen Sie in den Cookie-Einstellungen die Zustimmung zur Verwendung von Drittanbieter-Cookies erteilen. Bitte passen Sie Ihre Cookie-Präferenzen entsprechend an, um das Video abzuspielen.</p>\n            <div class="max-md:flex-col max-md:gap-y-5 flex justify-between">\n                <a href=\'#\' class="bg-slate-300 text-white font-semibold py-2 px-4 rounded cookie-sett
73ings-btn flex items-center max-md:text-center max-md:block">\n                    <span>Cookie Einstellungen öffnen</span>\n                </a>\n                <a target="_blank" href="'.concat(this.youTubeVideoUrl, '" class="bg-white border border-slate-300 text-slate-300 font-semibold py-2 px-4 rounded continue-youtube-btn">\n                    Weiter zu Youtube\n                </a>\n            </div>\n        </div>\n    ');
74    modal.innerHTML = modalContent;
75    document.body.appendChild(modal);
76  }
77}
78__publicField(CookieYouTubeBanner, "selector", ".cookie-modal-youtube");
79__publicField(CookieYouTubeBanner, "componentName", "_cookieyoutubebanner");
80__publicField(CookieYouTubeBanner, "youTubeVideoUrl", "https://www.youtube.com/@myBaySF");
81if (document.readyState === "loading") {
82  document.addEventListener("DOMContentLoaded", () => {
83    CookieYouTubeBanner.init();
84  });
85} else {
86  CookieYouTubeBanner.init();
87}
88export {
89  CookieYouTubeBanner as C,
90  __vite_legacy_guard
91};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.