PageSourceSearch

https://viessmann-modell.com/theme/cefc283d5ac57f4823e9c8b278f6821…oundation.product-buy-list.plugin.a8fc09.js

js viessmann-modell.com collected 2026-10-02 12:56:38 UTC 5,317 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[36639],{68:(e,t,s)=>{s.d(t,{A:()=>r});class r{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",r=this._createPreparedRequest("GET",e,s);return this._sendRequest(r,null,t)}post(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let n=this._createPreparedRequest("POST",e,r);return this._sendRequest(n,t,s)}delete(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let n=this._createPreparedRequest("DELETE",e,r);return this._sendRequest(n,t,s)}patch(e,t,s){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";r=this._getContentType(t,r);let n=this._createPreparedRequest("PATCH",e,r);return this._sendRequest(n,t,s)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,s){return this._registerOnLoaded(e,s),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,s){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}}},639:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});var r=s(68);let n=window.PluginBaseClass;class i extends n{static #e=this.options={locale:document.documentElement.lang,currencyIso:"EUR",enablePrices:!0,enableAddToCartSingle:!0,enableAddToCartAll:!0,productQuantities:{},discountValue:0};init(){this._priceElements=this.el.querySelectorAll("[data-price]"),this._productListItems=this.el.querySelectorAll("[data-moorl-product-buy-list-item]"),this._buyButton=this.el.querySelector("[data-moorl-product-buy-list-button]"),this._totalPriceElement=this.el.querySelector(".total-price"),this._discountPriceElement=this.el.querySelector(".discount-price"),this._selectedItemsElement=this.el.querySelector(".selected-items"),this._formValuesElement=this.el.querySelector(".form-values"),this._productIds=[],this._client=new r.A(window.accessKey,window.contextToken),this._updateTotalPrice(),this._registerEvents()}_registerEvents(){let e=this;this.el.addEventListener("change",t=>{if(e.el.querySelectorAll("[data-price]").forEach(s=>{t.target===s&&e._updateTotalPrice()}),"SELECT"===t.target.nodeName){let s=t.target.closest("[data-moorl-product-buy-list-item]"),r=t.target.form;if(!s||!r)return;let n=r.action,i=new FormData(r),l={};i.forEach(function(e,t){l[t]=e});let a={};for(let[t,s]of Object.entries(e.options))a[t]=s;let o={switched:t.target.name,options:JSON.stringify(l),quantity:s.dataset.quantity??1,templateOptions:JSON.stringify(a),enablePrices:e.options.enablePrices,enableAddToCartSingle:e.options.enableAddToCartSingle,enableAddToCartAll:e.options.enableAddToCartAll};e._client.get(n+"?"+new URLSearchParams(o).toString(),t=>{s.innerHTML=t,e._updateTotalPrice(),window.PluginManager.initializePlugins()})}})}_updateTotalPrice(){if(!this.options.enableAddToCartAll)return;let e=this,t=new Intl.NumberFormat(this.options.locale,{style:"currency",currency:this.options.currencyIso}),s=0,r=0,n=!0;this._formValuesElement.innerHTML=null,0===this._productIds.length&&this.el.querySelectorAll("[data-price]").forEach(e=>{this._productIds.push(e.value)}),this.el.querySelectorAll("[data-price]").forEach(t=>{if(!t.checked){n=!1;return}this._productIds.includes(t.value)||(n=!1),s+=parseFloat(t.dataset.price)*parseInt(t.dataset.quantity),r++,e._createFormValues(t.value,t.dataset.quantity)}),this._totalPriceElement.innerText=t.format(s),this.options.discountValue>
10&&(n?(this._totalPriceElement.classList.add("striked"),this._discountPriceElement.classList.remove("d-none")):(this._totalPriceElement.classList.remove("striked"),this._discountPriceElement.classList.add("d-none")),this._discountPriceElement.innerText=t.format(s-this.options.discountValue/100*s)),this._selectedItemsElement&&(this._selectedItemsElement.innerText=r),this._buyButton.disabled=0===r}_createFormValues(e,t){this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][id]`,e)),this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][type]`,"product")),this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][referencedId]`,e)),this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][stackable]`,1)),this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][removable]`,1)),this._formValuesElement.appendChild(this._createFormValue(`lineItems[${e}][quantity]`,t))}_createFormValue(e,t){let s=document.createElement("input");return s.type="hidden",s.value=t,s.name=e,s}}}}]);

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.