PageSourceSearch

https://www.solarversand.de/theme/0585c81db73db60d576d5204247cf481…-s.unavailable-combination.plugin.0fb3e3.js

js solarversand.de collected 2026-10-07 19:38:01 UTC 2,517 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[36184],{184:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});class i extends window.PluginBaseClass{init(){this._form=this.el.querySelector(this.options.formSelector),this._messageElement=this.el.querySelector(this.options.messageSelector),this._form&&this._messageElement&&Array.isArray(this.options.combinations)&&(this._existingCombinations=new Set(this.options.combinations.filter(e=>Array.isArray(e)&&e.length>0).map(e=>i._createKey(e))),0!==this._existingCombinations.size&&(this._groupCount=this._getGroupCount(),this.el.addEventListener("change",e=>this._onChange(e),!0)))}_onChange(e){let t=this._getSelectedOptionIds();if(t.length<this._groupCount||this._existingCombinations.has(i._createKey(t))){this._hideMessage();return}e.stopPropagation(),this._showMessage(t)}_getGroupCount(){let e=new Set,t="".concat(this.options.radioFieldSelector,",").concat(this.options.selectFieldSelector);return this._form.querySelectorAll(t).forEach(t=>{t.name&&e.add(t.name)}),e.size}_getSelectedOptionIds(){let e=[],t="".concat(this.options.radioFieldSelector,",").concat(this.options.selectFieldSelector);return this._form.querySelectorAll(t).forEach(t=>{t.value&&("radio"!==t.type||t.checked)&&e.push(t.value)}),e}_showMessage(e){this._messageElement.textContent=this.options.message.replace(this.options.messagePlaceholder,this._getCombinationName(e)),this._messageElement.classList.remove("d-none"),this._setPurchaseDisabled(!0)}_hideMessage(){this._messageElement.textContent="",this._messageElement.classList.add("d-none"),this._setPurchaseDisabled(!1)}_setPurchaseDisabled(e){this.options.blockPurchase&&document.querySelectorAll(this.options.buyFormSelector).forEach(t=>{t.classList.toggle("acris-unavailable-combination-locked",e),t.querySelectorAll(this.options.buySubmitSelector).forEach(t=>{t.disabled=e,t.setAttribute("aria-disabled",e?"true":"false")})})}_getCombinationName(e){return e.map(e=>this.options.optionNames[e]).filter(e=>!!e).join(this.options.separator)}static _createKey(e){return[...e].sort().join("|")}}i.options={combinations:[],optionNames:{},message:"",separator:" / ",blockPurchase:!1,formSelector:"[data-variant-switch]",radioFieldSelector:".product-detail-configurator-option-input",selectFieldSelector:".product-detail-configurator-select-input",messageSelector:".acris-unavailable-combination-message",messagePlaceholder:"%combination%",buyFormSelector:"[data-add-to-cart]",buySubmitSelector:'button[type="submit"], .btn-buy'}}}]);

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.