1import { s as sliderWrapper } from './SliderWrapper-Bd41jRQ6.js'; 2import './env-M5RuEq8k.js'; 3import './Video-8viJvtW6.js'; 4import './ConsentWall-vhVi_WG9.js'; 5 6import('./main.js').then(function (n) { return n.t; }); 7import('./main.js').then(function (n) { return n.c; }); 8import('./main.js').then(function (n) { return n.V; }); 9import('./main.js').then(function (n) { return n.u; }); 10const createGallery = async (clickedButton) => { 11 var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; 12 const galleryClass = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.dataset.gallery; 13 const galleryWrapper = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(`.${galleryClass}`); 14 const containerWrapper = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(".Container"); 15 let buttonDialogs; 16 if (galleryWrapper) { 17 if (galleryWrapper === null || galleryWrapper === void 0 ? void 0 : galleryWrapper.querySelector(".GalleryGrid_slides")) { 18 buttonDialogs = galleryWrapper.querySelectorAll(".GalleryGrid_slides .Button-dialog"); 19 } 20 else { 21 buttonDialogs = galleryWrapper === null || galleryWrapper === void 0 ? void 0 : galleryWrapper.querySelectorAll(".Button-dialog"); 22 } 23 } 24 else { 25 buttonDialogs = containerWrapper === null || containerWrapper === void 0 ? void 0 : containerWrapper.querySelectorAll(".Button-dialog"); 26 } 27 const buttonsArray = [...buttonDialogs]; 28 const slideElements = containerWrapper === null || containerWrapper === void 0 ? void 0 : containerWrapper.querySelectorAll(".Slide-element"); 29 const slideElementsArray = slideElements ? [...slideElements] : []; 30 const sliderWrapperEl = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(".SliderWrapper"); 31 let data; 32 if (sliderWrapperEl) { 33 data = { 34 fractionLabel: (_b = (_a = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderContainer")) === null || _a === void 0 ? void 0 : _a.getAttribute("data-fraction-label")) !== null && _b !== void 0 ? _b : "", 35 aria: { 36 labels: { 37 sliderContainer: (_d = (_c = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderContainer")) === null || _c === void 0 ? void 0 : _c.getAttribute("aria-label")) !== null && _d !== void 0 ? _d : "Name des Karussells", 38 sliderControls: (_f = (_e = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderControls")) === null || _e === void 0 ? void 0 : _e.getAttribute("aria-label")) !== null && _f !== void 0 ? _f : "Karussellsteuerung", 39 sliderControlsNext: (_h = (_g = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderControls_next")) === null || _g === void 0 ? void 0 : _g.getAttribute("aria-label")) !== null && _h !== void 0 ? _h : "Nächste Folie", 40 sliderControlsPrev: (_k = (_j = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderControls_prev")) === null || _j === void 0 ? void 0 : _j.getAttribute("aria-label")) !== null && _k !== void 0 ? _k : "Vorherige Folie", 41 }, 42 roledescription: { 43 sliderContainer: (_m = (_l = sliderWrapperEl === null || sliderWrapperEl === void 0 ? void 0 : sliderWrapperEl.querySelector(".SliderContainer")) === null || _l === void 0 ? void 0 : _l.getAttribute("aria-roledescription")) !== null && _m !== void 0 ? _m : "Karussell", 44 swiperSlide: (_p = (_o = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(".swiper-slide")) === null || _o === void 0 ? void 0 : _o.getAttribute("aria-roledescription")) !== null && _p !== void 0 ? _p : "Folie", 45 }, 46 }, 47 }; 48 } 49 else { 50 const triggerEl = containerWrapper; 51 // Check for GalleryGridTiles specific data attributes 52 const galleryGridTiles = galleryWrapper === null || galleryWrapper === void 0 ? void 0 : galleryWrapper.querySelector(".GalleryGrid_tiles"); 53 data = { 54 fractionLabel: (_r = (_q = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-fraction-label")) !== null && _q !== void 0 ? _q : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.getAttribute("data-fraction-label")) !== null && _r !== void 0 ? _r : "von", 55 aria: { 56 labels: { 57 sliderContainer: (_t = (_s = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-sli
57der-name")) !== null && _s !== void 0 ? _s : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.ariaSlider) !== null && _t !== void 0 ? _t : "Name des Karussells Test", 58 sliderControls: (_v = (_u = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-slider-controls")) !== null && _u !== void 0 ? _u : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.ariaControls) !== null && _v !== void 0 ? _v : "Karussellsteuerung", 59 sliderControlsNext: (_x = (_w = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-next-button")) !== null && _w !== void 0 ? _w : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.ariaNext) !== null && _x !== void 0 ? _x : "Nächste Folie", 60 sliderControlsPrev: (_z = (_y = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-previous-button")) !== null && _y !== void 0 ? _y : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.ariaPrevious) !== null && _z !== void 0 ? _z : "Vorherige Folie", 61 swiperSlide: (_0 = triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.ariaSlide) !== null && _0 !== void 0 ? _0 : "Folie", 62 }, 63 roledescription: { 64 sliderContainer: (_2 = (_1 = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-slider-roledescription")) !== null && _1 !== void 0 ? _1 : triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.roleSlider) !== null && _2 !== void 0 ? _2 : "Karussell", 65 swiperSlide: (_3 = triggerEl === null || triggerEl === void 0 ? void 0 : triggerEl.dataset.roleSlide) !== null && _3 !== void 0 ? _3 : "Folie", 66 }, 67 }, 68 }; 69 } 70 if (!buttonDialogs) 71 return; 72 const elementsToMap = galleryWrapper ? buttonsArray : slideElementsArray; 73 const slides = await Promise.all(elementsToMap.map(async (element) => { 74 var _a, _b, _c, _d; 75 const type = element === null || element === void 0 ? void 0 : element.dataset.dialogType; 76 const ariaLabel = galleryWrapper ? ((_a = element === null || element === void 0 ? void 0 : element.closest("li")) === null || _a === void 0 ? void 0 : _a.getAttribute("data-aria-label")) || ((_b = element === null || element === void 0 ? void 0 : element.closest(".swiper-slide")) === null || _b === void 0 ? void 0 : _b.getAttribute("aria-label")) || data.aria.labels.swiperSlide : data.aria.labels.swiperSlide; 77 const ariaRoledescription = galleryWrapper ? ((_c = element === null || element === void 0 ? void 0 : element.closest("li")) === null || _c === void 0 ? void 0 : _c.getAttribute("data-aria-roledescription")) || ((_d = element === null || element === void 0 ? void 0 : element.closest(".swiper-slide")) === null || _d === void 0 ? void 0 : _d.getAttribute("aria-roledescription")) || data.aria.roledescription.swiperSlide : data.aria.roledescription.swiperSlide; 78 return ` 79 <div class="swiper-slide" aria-label="${ariaLabel}" aria-roledescription="${ariaRoledescription}"> 80 ${type === "image" ? await image(element) : await video(element)} 81 </div>`; 82 })); 83 return ` 84 <div class="SliderWrapper"> 85 <div class="SliderContainer swiper" role="region" aria-label="${data.aria.labels.sliderContainer}" aria-roledescription="${data.aria.roledescription.sliderContainer}" data-fraction-label="${data.fractionLabel}"> 86 <div class="SliderControls" role="group" aria-label="${data.aria.labels.sliderControls}"> 87 <div class="SliderControls_pagination"></div> 88 <div class="SliderControls_navigation"> 89 <button class="Button Button-integrated SliderControls_prev swiper-button-disabled" aria-label="${data.aria.labels.sliderControlsPrev}" type="button" disabled> 90 <div class="Icon"><svg data-src="/icons/back-left.svg" data-cache="disabled" height="1.5rem" width="1.5rem" aria-hidden="true" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 192 192" viewBox="0 0 192 192" data-id="svg-loader_1"><path d="M121.171 158.829 58.343 96l62.828-62.829 5.658 5.658L69.657 96l57.172 57.171-5.658 5.658z"></path></svg></div> 91 </button> 92 <button class="Button Button-integrated SliderControls_next" aria-label="${data.aria.labels.sliderControlsNext}" type="button"> 93 <div class="Icon"><svg data-src="/icons/forward-right.svg" data-cache="disabled" height="1.5rem" width="1.5rem" aria-hidden="true" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192" data-id="svg-loader_2">
93<path fill="currentColor" d="M70.829 158.829l-5.658-5.658L122.343 96 65.171 38.829l5.658-5.658L133.657 96l-62.828 62.829z"></path></svg></div> 94 </button> 95 </div> 96 </div> 97 <div class="swiper-wrapper" aria-live="polite"> ${slides.join("")} </div> 98 </div> 99 </div> 100 `; 101}; 102// create the markup for image 103const image = async (clickedButton, type = "image") => { 104 var _a, _b; 105 const imageSrc = clickedButton.dataset.dialogImageSrc; 106 const imageAlt = clickedButton.dataset.dialogImageAlt; 107 const imageTitle = clickedButton.dataset.dialogImageTitle; 108 const imageObjectFit = (_a = clickedButton.dataset.dialogImageObjectFit) !== null && _a !== void 0 ? _a : "contain"; 109 const ariaLabelZoom = clickedButton.dataset.dialogImageAriaLabelZoom; 110 const ariaLabelZoomIn = clickedButton.dataset.dialogImageAriaLabelZoomIn; 111 const ariaLabelZoomOut = clickedButton.dataset.dialogImageAriaLabelZoomOut; 112 // Check if original image has data-ai attribute 113 const originalPicture = (_b = clickedButton.closest(".Image")) === null || _b === void 0 ? void 0 : _b.querySelector(".Image_picture[data-ai]"); 114 const aiLabel = originalPicture === null || originalPicture === void 0 ? void 0 : originalPicture.getAttribute("data-ai"); 115 const hasSticker = !!aiLabel; 116 if (type === "erp") { 117 return ` 118 <figure class="Image"> 119 <picture class="Image_picture"> 120 <source srcset="${imageSrc}" type="image/webp"> 121 <img class="Image_img Image_img-${imageObjectFit}" src="${imageSrc}" alt="${imageAlt}" title="${imageTitle}" loading="lazy"> 122 </picture> 123 </figure> 124 `; 125 } 126 return ` 127 <figure class="Image"> 128 <button class="Dialog_button Dialog_button-zoom" data-zoomed="false" aria-label="${ariaLabelZoom}" aria-pressed="false" data-aria-label-zoom-in="${ariaLabelZoomIn}" data-aria-label-zoom-out="${ariaLabelZoomOut}"> 129 <picture class="Image_picture" ${hasSticker ? `data-ai="${aiLabel}"` : ""}> 130 <source srcset="${imageSrc}" type="image/webp"> 131 <img class="Image_img Image_img-${imageObjectFit}" src="${imageSrc}" alt="${imageAlt}" title="${imageTitle}" loading="lazy"> 132 </picture> 133 </button> 134 ${hasSticker ? `<div class="Sticker Sticker-ai -secondary -background"><p class="Paragraph -size-s -bold">${aiLabel}</p></div>` : ""} 135 </figure> 136 `; 137}; 138// create the markup for video 139const video = async (clickedButton) => { 140 var _a, _b, _c, _d, _e, _f, _g, _h; 141 const data = clickedButton.dataset; 142 const videoProvider = data.dialogVideoProvider; 143 // allgemein 144 const autoplay = data.dialogVideoAutoplay === "true" ? true : false; 145 const loop = data.dialogVideoLoop === "true" ? true : false; 146 const videoTitle = data.dialogVideoTitle; 147 const videoTrackingEnabled = true; 148 const previewImageUrl = (_a = data.dialogVideoPreviewImage) !== null && _a !== void 0 ? _a : "./images/livestyle_application_1.webp"; 149 let video = ""; 150 if (videoProvider === "youtube") { 151 const { createYoutubeMarkup } = await import('./Video-8viJvtW6.js'); 152 const videoWidth = (_b = data.dialogVideoWidth) !== null && _b !== void 0 ? _b : "640"; 153 const videoHeight = (_c = data.dialogVideoHeight) !== null && _c !== void 0 ? _c : "360"; 154 const videoId = (_d = data.dialogVideoId) !== null && _d !== void 0 ? _d : ""; 155 const videoHidden = data.dialogHidden === "true" ? true : false; 156 video = (await createYoutubeMarkup(videoWidth, videoHeight, videoId, autoplay, videoHidden, loop, videoTitle, undefined, videoTrackingEnabled)).outerHTML; 157 return video; 158 } 159 if (videoProvider === "cliplister") { 160 const { createCliplisterMarkup } = await import('./Video-8viJvtW6.js'); 161 const videoAssets = (_e = data.dialogVideoAssets) !== null && _e !== void 0 ? _e : ""; 162 const videoCustomer = parseFloat((_f = data.dialogVideoCustomer) !== null && _f !== void 0 ? _f : "157893"); 163 const videoLang = (_g = data.dialogVideoLang) !== null && _g !== void 0 ? _g : "en"; 164 const aspectRatio = (_h = data.dialogVideoAspectRatio) !== null && _h !== void 0 ? _h : "16:9"; 165 const videoUrl = data.dialogVideoUrl; 166 video = (await createCliplisterMarkup(videoAssets, videoCustomer, videoLang, autoplay, loop, videoUrl, videoTitle, previewImageUrl, aspectRatio, videoTrackingEnabled)).outerHTML; 167 return video; 168 } 169}; 170const threeSixtyModal = async (clickedButton) => { 171 var _a; 172 const { Cliplister360 } = await import('./index-BkaaMuWS.js'); 173 if (!(clickedButton instanceof HTMLElement)) { 174 return; 175 } 176 const customer = clickedButton.dataset.dialogThreesixtyCustomer; 177 const assets = clickedButton.dataset.dialogThreesixtyAssets;
178 const keytype = clickedButton.dataset.dialogThreesixtyKeytype ? parseInt(clickedButton.dataset.dialogThreesixtyKeytype, 10) : 0; 179 const speedx = clickedButton.dataset.speedx ? parseInt(clickedButton.dataset.speedx, 10) : 10; 180 const speedy = clickedButton.dataset.speedy ? parseInt(clickedButton.dataset.speedy, 10) : 10; 181 const multilevel = clickedButton.dataset.multilevel === "false"; 182 const inverted = clickedButton.dataset.inverted === "false"; 183 const backgroundColor = clickedButton.dataset.backgroundcolor ? clickedButton.dataset.backgroundcolor : "#fff"; 184 const aspectRatio = clickedButton.dataset.aspectRatio ? clickedButton.dataset.aspectRatio : "16:9"; 185 if (assets === undefined || customer === undefined) { 186 throw new Error("Missing required data for Cliplister 360"); 187 } 188 const el = Cliplister360.markup(customer, [assets], keytype, speedx, speedy, multilevel, inverted, backgroundColor, aspectRatio); 189 const title = clickedButton.dataset.dialogThreesixtyTitle; 190 const ariaLabel = clickedButton.dataset.dialogThreesixtyAriaLabel; 191 const ariaRoleDescription = clickedButton.dataset.dialogThreesixtyAriaRoleDescription; 192 const wrapper = document.createElement("div"); 193 wrapper.classList.add("Threesixty"); 194 wrapper.setAttribute("role", "button"); 195 wrapper.setAttribute("tabindex", "0"); 196 if (title) { 197 wrapper.setAttribute("title", title); 198 } 199 if (ariaLabel) { 200 wrapper.setAttribute("aria-label", ariaLabel); 201 } 202 if (ariaRoleDescription) { 203 wrapper.setAttribute("aria-roledescription", ariaRoleDescription); 204 } 205 wrapper.innerHTML = ` 206 <div class="Threesixty_icon"> 207 <div class="Icon"><svg height="4rem" width="4rem" aria-hidden="true" aria-label="360 degrees arrow" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192" data-id="svg-loader_1"><path d="M69.164 75.52c0-2.768-1.907-4.358-5.265-4.358h-2.952v-5.128h2.77c3.04 0 4.857-1.543 4.857-4.133 0-2.54-1.635-4.084-4.267-4.084-2.815 0-4.631 1.407-5.9 4.54l-5.811-1.
207635c1.815-5.629 5.854-8.488 11.983-8.488 6.627 0 11.075 3.632 11.075 9.034 0 3.176-1.678 5.4-5.174 6.852 4.04 1.362 5.993 3.905 5.993 7.764 0 5.992-4.722 9.804-12.257 9.804-3.949 0-7.218-1.044-9.578-3.042-1.815-1.543-2.769-3.22-3.404-5.991l6.309-1.588c.998 3.495 2.951 5.038 6.356 5.038 3.313 0 5.265-1.724 5.265-4.585zm13.768 5.901c-2.316-2.768-3.404-6.537-3.404-11.711 0-10.621 5.311-17.476 13.526-17.476 4.449 0 7.581 1.861 9.806 5.81l-4.993 3.224c-1.544-2.634-2.725-3.45-4.857-3.45-3.905 0-6.129 3.45-6.583 10.167 1.68-2.633 4.177-3.949 7.49-3.949 5.947 0 10.032 4.267 10.032 10.486 0 6.672-4.676 11.166-11.665 11.166-3.815 0-7.036-1.452-9.352-4.267zm4.13-6.808c0 3.404 1.998 5.629 5.04 5.629 2.996 0 5.038-2.225 5.038-5.539 0-3.313-2.042-5.539-5.038-5.539-2.997 0-5.04 2.226-5.04 5.449zm19.672-5.857c0-4.402 1.134-8.76 3.086-11.711 1.998-3.087 5.265-4.81 9.124-4.81 7.49 0 12.212 6.49 12.212 16.704 0 4.676-1.09 8.806-3.088 11.939-1.951 3.086-5.265 4.81-9.078 4.81-7.58 0-12.256-6.446-12.256-16.932zm7.309.046c0 7.31 1.77 11.303 4.947 11.303 3.087 0 4.857-4.04 4.857-11.166 0-7.082-1.77-11.122-4.903-11.122-3.086 0-4.901 4.04-4.901 10.985zm21.031-8.307c0-4.766 3.497-8.26 8.354-8.26 4.629 0 8.126 3.494 8.126 8.079 0 4.766-3.541 8.261-8.263 8.261-4.72 0-8.217-3.45-8.217-8.08zm4.903-.181c0 2.678 1.272 4.312 3.36 4.312 2.042 0 3.314-1.588 3.314-4.177 0-2.541-1.316-4.265-3.314-4.265-2.088 0-3.36 1.543-3.36 4.13zM95.981 112H96v-8h-.019c-5.814 0-11.572.218-17.111.65l.62 7.975A213.837 213.837 0 0 1 95.98 112zm-39.568 4.09c4.8-1.174 10.27-2.12 16.255-2.81l-.916-7.947c-6.316.729-12.116 1.733-17.24 2.985l1.9 7.772zm72.647-9.492l5.29-3.565-4.47-6.635-17.286 11.648 11.65 17.286 6.633-4.47-4.455-6.611C145.492 117.313 152 122.365 152 124c0 .751-2.479 4.215-14.604 7.449C126.39 134.384 111.688 136 96 136s-30.39-1.616-41.396-4.551C42.479 128.215 40 124.75 40 124c0-.561 1.701-3.236 10.024-6.07l-2.578-7.574C37.196 113.846 32 118.436 32 124c0 13.741 33.176 20 64 20s64-6.259 64-20c0-10.094-17.323-15.058-30.94-17.402z"></path></svg></div> 208 </div> 209 `; 210 wrapper.appendChild(el); 211 (_a = document.querySelector(".Dialog_body")) === null || _a === void 0 ? void 0 : _a.appendChild(wrapper); 212 Cliplister360.embed().then(() => { 213 Cliplister360.init(el).then((viewerInstance) => { 214 console.log("360° Viewer gestartet", viewerInstance); 215 }); 216 }); 217}; 218const createDialog = async (clickedButton, type = "image") => { 219 var _a, _b; 220 let dialog; 221 let dialogContent; 222 const dialogCloseButtonLabel = clickedButton.dataset.dialogCloseButtonLabel; 223 const dialogAriaLabel = clickedButton.dataset.dialogAriaLabel; 224 const htmlBody = document.querySelector("body"); 225 const gallery = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.dataset.gallery; 226 const galleryGridWrapper = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(".GalleryGrid"); 227 const galleryGridTiles = galleryGridWrapper === null || galleryGridWrapper === void 0 ? void 0 : galleryGridWrapper.querySelector(".GalleryGrid_tiles"); 228 // Use GalleryGridTiles specific attributes if available 229 const finalDialogAriaLabel = (_a = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-aria-dialog")) !== null && _a !== void 0 ? _a : dialogAriaLabel; 230 const finalCloseButtonLabel = (_b = galleryGridTiles === null || galleryGridTiles === void 0 ? void 0 : galleryGridTiles.getAttribute("data-close-button")) !== null && _b !== void 0 ? _b : dialogCloseButtonLabel; 231 dialog = document.createElement("dialog"); 232 dialog.classList.add("Dialog"); 233 dialog.classList.add("Dialog-dynamic"); 234 !gallery ? dialog.classList.add(`Dialog-${type}`) : dialog.classList.add(`Dialog-gallery`); 235 if (finalDialogAriaLabel) 236 dialog.setAttribute("aria-label", finalDialogAriaLabel); 237 dialogContent = ` 238 <div class="Dialog_wrapper"> 239 <div class="Dialog_aspectWrapper"> 240 <div class="Dialog_container Container Container-offgrid -floating"> 241 <div class="Dialog_header"> 242 <button class="Dialog_close Button Button-integrated" aria-label="${finalCloseButtonLabel}"> 243 <div class="Icon"> 244 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192" width="24" height="24" fill="currentColor">
244<path d="M101.657 96l57.172 57.171-5.658 5.658L96 101.657 38.829 158.83l-5.658-5.658L90.343 96 33.17 38.829l5.658-5.658L96 90.343l57.171-57.172 5.658 5.658L101.657 96z"/></svg> 245 </div> 246 </button> 247 </div> 248 <section class="Dialog_body"> 249 ${gallery ? await createGallery(clickedButton) : ""} 250 ${!gallery && type === "image" ? await image(clickedButton, "image") : ""} 251 ${!gallery && type === "erp" ? await image(clickedButton, "erp") : ""} 252 ${!gallery && type === "video" ? await video(clickedButton) : ""} 253 </section> 254 </div> 255 </div> 256 </div> 257 `; 258 document.body.append(dialog); 259 dialog.insertAdjacentHTML("beforeend", dialogContent); 260 dialog.showModal(); 261 // close dialog when clicking outside of .Dialog_aspectWrapper 262 dialog.addEventListener("click", (event) => { 263 const aspectWrapper = dialog.querySelector(".Dialog_aspectWrapper"); 264 if (event.target === dialog || event.target === aspectWrapper) { 265 closeDialog(dialog); 266 } 267 }); 268 // event for close (x) button inside of dialog 269 dialog.querySelectorAll(".Dialog_close").forEach((element) => { 270 element.addEventListener("click", function () { 271 closeDialog(this.closest(".Dialog")); 272 }); 273 }); 274 // Dialog Events 275 // remove dialog markup when it closes 276 dialog.addEventListener("close", () => { 277 setTimeout(() => dialog.remove(), 100); 278 setTimeout(() => htmlBody.style.removeProperty("overflow-y"), 110); 279 }); 280 // Event: Fires when dialog is open 281 dialog.addEventListener("toggle", async () => { 282 const videos = dialog.querySelectorAll(".Video"); 283 const zooms = dialog.querySelectorAll("[data-zoomed]"); 284 htmlBody.style.overflowY = "hidden"; 285 // check if dialog type is video 286 if (videos.length > 0) { 287 const { initDynamicVideo } = await import('./Video-8viJvtW6.js'); 288 // initialize each video with its specific provider 289 videos.forEach((video) => { 290 // Determine provider from the video element itself 291 let provider = "cliplister"; 292 if (video.classList.contains("Video-youtube")) { 293 provider = "youtube"; 294 } 295 initDynamicVideo(provider, video); 296 }); 297 } 298 // check if zoom in dialog 299 if (zooms.length > 0) { 300 const { initZoom } = await import('./SliderWrapper-Bd41jRQ6.js').then(function (n) { return n.Z; }); 301 zooms.forEach((zoom) => { 302 initZoom(zoom); 303 }); 304 } 305 // check if dialog is gallery 306 if (gallery) { 307 const slide = clickedButton === null || clickedButton === void 0 ? void 0 : clickedButton.closest(".Image"); 308 const galleryIndex = slide === null || slide === void 0 ? void 0 : slide.dataset.index; 309 const slider = sliderWrapper(dialog, "fraction", { 310 settings: { 311 autoHeight: false, 312 }, 313 }); 314 if (!galleryIndex) 315 return; 316 slider === null || slider === void 0 ? void 0 : slider.slideTo(parseFloat(galleryIndex), 200, false); 317 } 318 if (type === "threesixty") { 319 await threeSixtyModal(clickedButton); 320 } 321 }); 322}; 323const closeDialog = (element) => { 324 element.close(); 325}; 326const container = document.body; 327container.addEventListener("click", (event) => { 328 const target = event.target.closest("[data-dialog-type]"); 329 if (!target || target.classList.contains("Slide-element")) 330 return; 331 const dialogType = target.dataset.dialogType; 332 createDialog(target, dialogType); 333}); 334//# sourceMappingURL=Dialog-xVGXhfYY.js.map
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.