<turbo-stream action="update" target="mall-map-wrapper"><template><div data-controller="photo" id="mall-photos" itemscope="" itemtype="https://schema.org/ImageGallery"><div class="carousel slide carousel-fade" data-bs-interval="false" data-bs-ride="false" data-bs-touch="true" data-bs-wrap="true" id="main-slide"><div class="carousel-inner"><div class="carousel-item active"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 1" title="Place Ste Foy - Gallery Photo 1" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="high" loading="eager" decoding="auto" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 2" title="Place Ste Foy - Gallery Photo 2" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 3" title="Place Ste Foy - Gallery Photo 3" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 4" title="Place Ste Foy - Gallery Photo 4" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 5" title="Place Ste Foy - Gallery Photo 5" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 6" title="Place Ste Foy - Gallery Photo 6" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg" /></div><div class="carousel-item"><img class="d-block w-100 photo-enlargeable cursor-pointer" alt="Place Ste Foy - Gallery Photo 7" title="Place Ste Foy - Gallery Photo 7" itemprop="image" width="1200" height="800" srcset="https://getoccupi.com/cdn-cgi/image/width=600,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg 600w, https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg 900w, https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg 1200w" sizes="(max-width: 768px) 100vw, 66vw" fetchpriority="auto" loading="lazy" decoding="async" data-action="click-&gt;photo#enlargePhoto" data-photo-url="https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg" src="https://getoccupi.com/cdn-cgi/image/width=900,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg" /></div></div><button aria-label="Previous photo" class="carousel-control-prev" data-action="click-&gt;photo#prevSlide" type="button"><span aria-hidden="true" class="carousel-control-prev-icon"></span></button><button aria-label="Next photo" class="carousel-control-next" data-action="click-&gt;photo#nextSlide" type="button"><span aria-hidden="true" class="carousel-control-next-icon"></span></button></div><div aria-label="Photo thumbnails" class="d-flex overflow-auto gap-1 py-1" id="thumbnail-strip" role="tablist"><div aria-label="View photo 1" aria-selected="true" class="thumbnail-item border-0 p-0 flex-shrink-0 active" data-action="click-&gt;photo#goToSlide" data-slide-index="0" role="tab"><img id="mall_photo_46939" alt="Place Ste Foy - Thumbnail 1" title="Place Ste Foy - Thumbnail 1" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg" /><div class="manage-controls"><a aria-label="Delete photo 1" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46939"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 2" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="1" role="tab"><img id="mall_photo_46940" alt="Place Ste Foy - Thumbnail 2" title="Place Ste Foy - Thumbnail 2" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp" /><div class="manage-controls"><a aria-label="Delete photo 2" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46940"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 3" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="2" role="tab"><img id="mall_photo_46941" alt="Place Ste Foy - Thumbnail 3" title="Place Ste Foy - Thumbnail 3" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp" /><div class="manage-controls"><a aria-label="Delete photo 3" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46941"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 4" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="3" role="tab"><img id="mall_photo_46942" alt="Place Ste Foy - Thumbnail 4" title="Place Ste Foy - Thumbnail 4" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp" /><div class="manage-controls"><a aria-label="Delete photo 4" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46942"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 5" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="4" role="tab"><img id="mall_photo_46943" alt="Place Ste Foy - Thumbnail 5" title="Place Ste Foy - Thumbnail 5" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp" /><div class="manage-controls"><a aria-label="Delete photo 5" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46943"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 6" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="5" role="tab"><img id="mall_photo_46944" alt="Place Ste Foy - Thumbnail 6" title="Place Ste Foy - Thumbnail 6" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg" /><div class="manage-controls"><a aria-label="Delete photo 6" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46944"><i aria-hidden="true" class="ri-close-line"></i></a></div></div><div aria-label="View photo 7" aria-selected="false" class="thumbnail-item border-0 p-0 flex-shrink-0" data-action="click-&gt;photo#goToSlide" data-slide-index="6" role="tab"><img id="mall_photo_46945" alt="Place Ste Foy - Thumbnail 7" title="Place Ste Foy - Thumbnail 7" loading="lazy" itemprop="image" class="object-fit-cover rounded" width="104" height="58" src="https://getoccupi.com/cdn-cgi/image/width=150,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg" /><div class="manage-controls"><a aria-label="Delete photo 7" data-turbo-method="delete" href="/malls/place-ste-foy/mall_photos/46945"><i aria-hidden="true" class="ri-close-line"></i></a></div></div></div></div><div aria-hidden="true" aria-labelledby="mallPhotoEnlargeModalLabel" class="modal fade" id="mallPhotoEnlargeModal" tabindex="-1"><div class="modal-dialog modal-fullscreen"><div class="modal-content bg-transparent border-0 vh-100"><h1 class="visually-hidden" id="mallPhotoEnlargeModalLabel">Place Ste Foy Photo Gallery</h1><button aria-label="Close" class="btn btn-dark btn-lg position-absolute rounded-circle d-flex align-items-center justify-content-center mall-photo-modal-close" data-bs-dismiss="modal" type="button"><i class="ri-close-line fs-4"></i></button><div class="modal-body p-0 h-100 d-flex align-items-center justify-content-center"><div class="carousel slide carousel-fade" data-bs-interval="false" data-bs-ride="false" data-bs-touch="true" data-bs-wrap="true" id="mallPhotoCarousel"><div class="carousel-indicators"><button aria-current="true" aria-label="Slide 1" class="active" data-bs-slide-to="0" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 2" data-bs-slide-to="1" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 3" data-bs-slide-to="2" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 4" data-bs-slide-to="3" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 5" data-bs-slide-to="4" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 6" data-bs-slide-to="5" data-bs-target="#mallPhotoCarousel" type="button"></button><button aria-current="" aria-label="Slide 7" data-bs-slide-to="6" data-bs-target="#mallPhotoCarousel" type="button"></button></div><div class="carousel-inner vh-100"><div class="carousel-item active"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 1" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46939/place-ste-foy-shopping-mall-in-quebec-city-P89DH3.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 2" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46940/PlaceSte-Foy-StephaneGroleau-401-copy.webp" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 3" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46941/06_PlaceSteFoyEXT-V2-StephaneGroleau-0333-B-copy.webp" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 4" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46942/PlaceSte-Foy-StephaneGroleau-436-2-copy.webp" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 5" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46943/01_PlaceSteFoy-INT-StephaneGroleau-0573.webp" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 6" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46944/place-de-la-cite-shopping-mall-and-place-ste-foy-shopping-mall-are-F2AT25.jpg" width="1200" /></div></div><div class="carousel-item"><div class="vh-100 d-flex align-items-center justify-content-center"><img alt="Place Ste Foy - Gallery Photo 7" class="d-block w-100 mh-100 vh-100 object-fit-contain cursor-pointer" data-action="click-&gt;photo#enlargePhoto" decoding="async" height="800" loading="lazy" src="https://getoccupi.com/cdn-cgi/image/width=1200,quality=85,format=auto/https://static.getoccupi.com/uploads/mall_photo/photo/46945/18-08-13-0750_xgaplus.jpg" width="1200" /></div></div></div></div><button class="carousel-control-prev" data-bs-slide="prev" data-bs-target="#mallPhotoCarousel" type="button"><span aria-hidden="true" class="carousel-control-prev-icon"></span><span class="visually-hidden">Previous</span></button><button class="carousel-control-next" data-bs-slide="next" data-bs-target="#mallPhotoCarousel" type="button"><span aria-hidden="true" class="carousel-control-next-icon"></span><span class="visually-hidden">Next</span></button></div></div></div></div><div id="mall-photo-scripts"><script>deletePhoto = function(elementID) {
  var img = document.getElementById(elementID)
  if (!img) return
  var thumb = img.closest('.thumbnail-item')
  if (!thumb) return
  var strip = document.getElementById('thumbnail-strip')
  if (!strip) return
  var thumbs = Array.from(strip.querySelectorAll('.thumbnail-item'))
  var idx = thumbs.indexOf(thumb)

  // Remove carousel item
  var items = document.querySelectorAll('#main-slide .carousel-item')
  if (items[idx]) {
    var wasActive = items[idx].classList.contains('active')
    items[idx].remove()
    if (wasActive) {
      var remaining = document.querySelectorAll('#main-slide .carousel-item')
      if (remaining.length > 0) remaining[0].classList.add('active')
    }
  }

  // Remove thumbnail
  thumb.remove()

  // Re-index thumbnail data-slide-index attributes
  document.querySelectorAll('#thumbnail-strip .thumbnail-item').forEach(function(t, i) {
    t.setAttribute('data-slide-index', i)
  })

  // Also remove from enlargement modal carousel
  var modalItems = document.querySelectorAll('#mallPhotoCarousel .carousel-item')
  if (modalItems[idx]) {
    var wasModalActive = modalItems[idx].classList.contains('active')
    modalItems[idx].remove()
    if (wasModalActive) {
      var remainingModal = document.querySelectorAll('#mallPhotoCarousel .carousel-item')
      if (remainingModal.length > 0) remainingModal[0].classList.add('active')
    }
  }

  // Re-index modal indicators
  var indicators = document.querySelectorAll('#mallPhotoCarousel .carousel-indicators button')
  if (indicators) {
    indicators.forEach(function(btn, i) {
      btn.setAttribute('data-bs-slide-to', i)
      btn.setAttribute('aria-label', 'Slide ' + (i + 1))
    })
  }
}</script></div></template></turbo-stream>