1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[40072],{72:(t,e,i)=>{i.r(e),i.d(e,{default:()=>r});var s=i(4335);class r extends s.A{static #t=this.options={showCounter:!0,liveAreaSelector:"#wishlist-basket-live-area",liveAreaTextAttribute:"data-wishlist-live-area-text"};init(){if(this._getWishlistStorage(),!this._wishlistStorage)throw Error("No wishlist storage found");this._renderCounter(),this._registerEvents(),this._wishlistStorage.load()}_getWishlistStorage(){this._wishlistStorage=window.PluginManager.getPluginInstanceFromElement(this.el,"WishlistStorage")}_renderCounter(){this.options.showCounter&&(this.el.innerHTML=this._wishlistStorage.getCurrentCounter()||"",this._updateLiveArea())}_updateLiveArea(){let t=this._getLiveArea();if(!t)return;let e=this._wishlistStorage.getCurrentCounter()||0,i=t.getAttribute(this.options.liveAreaTextAttribute)||"%counter%";t.innerHTML=`<p>${i.replace("%counter%",e)}</p>`}_getLiveArea(){return document.querySelector(this.options.liveAreaSelector)}_registerEvents(){this.$emitter.subscribe("Wishlist/onProductsLoaded",()=>{this._renderCounter(),window.PluginManager.getPluginInstances("AddToWishlist").forEach(t=>{t.initStateClasses()})}),this.$emitter.subscribe("Wishlist/onProductRemoved",t=>{this._renderCounter(),this._reInitWishlistButton(t.detail.productId)}),this.$emitter.subscribe("Wishlist/onProductAdded",t=>{this._renderCounter(),this._reInitWishlistButton(t.detail.productId)});let t=document.querySelector(".cms-element-product-listing-wrapper");t&&window.PluginManager.getPluginInstanceFromElement(t,"Listing").$emitter.subscribe("Listing/afterRenderResponse",()=>{window.PluginManager.getPluginInstances("AddToWishlist").forEach(t=>{t.initStateClasses()})})}_reInitWishlistButton(t){let e=document.querySelectorAll(".product-wishlist-"+t);e&&e.forEach(t=>{window.PluginManager.getPluginInstanceFromElement(t,"AddToWishlist").initStateClasses()})}}}}]);
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.