PageSourceSearch

https://www.astridandmiyu.com/cdn/shop/t/1379/assets/announcement-bar.js?v=130330790359863878411789975464

js astridandmiyu.com collected 2026-09-24 21:57:06 UTC 3,953 bytes, 2 lines download raw bytes

1const{getElement}=window.BAO.Utils,{CarouselElement}=window.BAO.Carousel,{useAutoplay}=window.BAO.Carousel.plugins;export class announcementBarCarousel extends CarouselElement{static get requiredElements(){return[]}async connectedCallback(){super.connectedCallback(),this.setupListeners(),this.setupGwpRefresh()}setupGwpRefresh(){this.hasAttribute("data-gwp-refresh")&&(this.refreshSection=this.refreshSection.bind(this),window.BAO.eventBus.addEventListener(window.BAO.EVENTS.PUSH_CART.CHANGED,this.refreshSection))}disconnectedCallback(){super.disconnectedCallback(),this.refreshSection&&window.BAO.eventBus.removeEventListener(window.BAO.EVENTS.PUSH_CART.CHANGED,this.refreshSection)}async refreshSection(){const{sectionRenderer}=window.BAO,html=await sectionRenderer.fetchSingle("announcement-bar"),fresh=sectionRenderer.convertToDOM(html).querySelector("announcement-bar");if(fresh==null){this.style.display="none";return}this.replaceWith(this.ownerDocument.importNode(fresh,!0))}setupListeners(){if(this.els?.dropdownclose?.exists===!0&&this.els.dropdownclose.elements.forEach(element=>{element.addEventListener("click",this.closeDropdown.bind(this))}),this.externalEls?.dropdownclose?.exists===!0&&this.externalEls.dropdownclose.element.addEventListener("click",this.closeDropdown.bind(this)),this.els?.dropdownopen?.exists===!0&&this.els.dropdownopen.elements.forEach(element=>{element.addEventListener("click",this.openDropdown.bind(this))}),this.els?.cart_threshold?.exists===!0){const observer=new MutationObserver(()=>{const pushCartFooter=getElement("div#shopify-section-push-cart-footer"),textLabel=pushCartFooter&&getElement(".prg-ProgressBar_Label",{context:pushCartFooter});!textLabel?.innerText?.length>0||this.els.cart_threshold.elements.forEach(element=>{element.innerText=textLabel?.innerText})});document.addEventListener("DOMContentLoaded",event=>{const pushCartFooter=getElement("div#shopify-section-push-cart-footer");pushCartFooter&&observer.observe(pushCartFooter,{attributes:!0,childList:!0,subtree:!0})})}}openDropdown(e){document.body.classList.add("hd-AnnouncementBar_Dropdown-active");const parentAnnouncement=e.target.closest(".hd-AnnouncementBar_Announcement-hasDropdown");parentAnnouncement&&parentAnnouncement.classList.add("hd-AnnouncementBar_Announcement-openDropdown")}closeDropdown(e){document.body.classList.remove("hd-AnnouncementBar_Dropdown-active");const openDropdown=document.querySelector(".hd-AnnouncementBar_Announcement-openDropdown");openDropdown&&openDropdown.classList.remove("hd-AnnouncementBar_Announcement-openDropdown")}async initialiseCarousel(){this.els?.slider?.element!=null&&(this.carousel=await super.initialiseCarousel())}get options(){return{slides:{perView:1,spacing:0},loop:!0,drag:!1,defaultAnimation:{duration:this.durationOfFade},detailsChanged:carousel=>{carousel.slides.forEach((element,idx)=>{element.style.opacity=carousel.track.details.slides[idx].portion;const isVisible=idx===carousel.track.details.rel;element.style.visibility=isVisible?"visible":"hidden"})},renderMode:"custom",created:carousel=>{carousel.container.setAttribute("data-initialised",!0),setTimeout(()=>{const slideWithCountdown=carousel.slides.find(slide=>slide.classList.contains("hd-AnnouncementBar_Announcement-countdown"));slideWithCountdown?slideWithCountdown.style.position="relative":carousel.slides[0].style.position="relative"},1e3);const highest=Math.max(...carousel.slides.map(item=>item.getBoundingClientRect().height));carousel.container.style.height=`${highest}px`}}}get plugins(){return[useAutoplay(this.durationTillFade,{pauseOnHover:!1})]}get durationTillFade(){return Number(this.dataset.durationTillFade)||5}get durationOfFade(){return Number(this.dataset.durationOfFade*100)||500}}customElements.get("announcement-bar")||customElements.define("announcement-bar",announcementBarCarousel);
2//# sourceMappingURL=/cdn/shop/t/1379/assets/announcement-bar.js.map?v=130330790359863878411789975464

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.