1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[13996],{3996:(t,s,i)=>{i.r(s),i.d(s,{default:()=>a});var e=i(9568),o=i(4049);class a extends e.Z{init(){this.classList={isLoading:"product-wishlist-loading",addedState:"product-wishlist-added",notAddedState:"product-wishlist-not-added"},this.textsElement=o.Z.querySelector(this.el,".product-wishlist-btn-content",!1),this._getWishlistStorage(),this._wishlistStorage||(this.el.style.display="none",console.warn("No wishlist storage found")),this._registerEvents(),this.initStateClasses()}_getWishlistStorage(){let t=o.Z.querySelector(document,"#wishlist-basket",!1);t&&(this._wishlistStorage=window.PluginManager.getPluginInstanceFromElement(t,"WishlistStorage"))}_registerEvents(){this.el.addEventListener("click",this._onClick.bind(this)),this._wishlistStorage.$emitter.subscribe("Wishlist/onLoginRedirect",this.initStateClasses.bind(this))}initStateClasses(){this._wishlistStorage.has(this.options.productId)?this._addActiveState():this._removeActiveState(),this.el.classList.remove(this.classList.isLoading)}_onClick(t){t.preventDefault(),this.el.classList.contains(this.classList.isLoading)||(this.el.classList.add(this.classList.isLoading),this._wishlistStorage.has(this.options.productId)?this._wishlistStorage.remove(this.options.productId,this.options.router.remove):this._wishlistStorage.add(this.options.productId,this.options.router.add))}_addActiveState(){this.el.classList.remove(this.classList.notAddedState),this.el.classList.add(this.classList.addedState),this.el.setAttribute("title",this.options.texts.remove),this.textsElement&&(this.textsElement.innerHTML=this.options.texts.remove)}_removeActiveState(){this.el.classList.remove(this.classList.addedState),this.el.classList.add(this.classList.notAddedState),this.el.setAttribute("title",this.options.texts.add),this.textsElement&&(this.textsElement.innerHTML=this.options.texts.add)}}a.options={texts:{add:"Add to wishlist",remove:"Remove from wishlist"}}}}]);
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.