PageSourceSearch

https://wiha.com/theme/d526f1b6dff22d973abb0afcbfa55c26/js/storefr…orefront.quantity-selector.plugin.509aff.js

js wiha.com collected 2026-09-24 10:11:28 UTC 2,314 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[71358],{1358:(t,i,e)=>{e.r(i),e.d(i,{default:()=>n});var a=e(9568),s=e(4049);class n extends a.Z{init(){this._input=s.Z.querySelector(this.el,"input.js-quantity-selector"),this._btnPlus=s.Z.querySelector(this.el,".js-btn-plus"),this._btnMinus=s.Z.querySelector(this.el,".js-btn-minus"),this.options.ariaLiveUpdates&&this._initAriaLiveUpdates(),this._registerEvents()}_initAriaLiveUpdates(){if(this.ariaLiveContainer=this.el.nextElementSibling,this.ariaLiveContainer&&this.ariaLiveContainer.hasAttribute("aria-live")&&(this.ariaLiveText=this.ariaLiveContainer.dataset.ariaLiveText,this.ariaLiveProductName=this.ariaLiveContainer.dataset.ariaLiveProductName,"onload"===this.options.ariaLiveUpdateMode)){let t=window.localStorage.getItem("lastQuantityChange");t&&t===this.ariaLiveProductName&&(window.localStorage.removeItem("lastQuantityChange"),window.setTimeout(this._updateAriaLive.bind(this),1e3))}}_registerEvents(){this._btnPlus.addEventListener("click",this._stepUp.bind(this)),this._btnMinus.addEventListener("click",this._stepDown.bind(this)),this._input.addEventListener("keydown",t=>{if(13===t.keyCode)return t.preventDefault(),this._triggerChange(),!1})}_triggerChange(t){let i=new Event("change",{bubbles:!0,cancelable:!1});this._input.dispatchEvent(i),"live"===this.options.ariaLiveUpdateMode?this._updateAriaLive():"onload"===this.options.ariaLiveUpdateMode&&window.localStorage.setItem("lastQuantityChange",this.ariaLiveProductName),"up"===t?this._btnPlus.dispatchEvent(i):"down"===t&&this._btnMinus.dispatchEvent(i)}_stepUp(){let t=this._input.value;this._input.stepUp(),this._input.value!==t&&this._triggerChange("up")}_stepDown(){let t=this._input.value;this._input.stepDown(),this._input.value!==t&&this._triggerChange("down")}_updateAriaLive(){if(!this.options.ariaLiveUpdates||!this.ariaLiveText||!this.ariaLiveContainer)return;let t=this._input.value,i=this.ariaLiveText.replace(this.options.ariaLiveTextValueToken,t);this.options.ariaLiveTextProductToken&&this.ariaLiveProductName&&(i=i.replace(this.options.ariaLiveTextProductToken,this.ariaLiveProductName)),this.ariaLiveContainer.innerHTML=i}}n.options={ariaLiveUpdates:!0,ariaLiveUpdateMode:"live",ariaLiveTextValueToken:"%quantity%",ariaLiveTextProductToken:"%product%"}}}]);

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.