1"use strict";(self.webpackChunk_medienwerft_hhw_corporate=self.webpackChunk_medienwerft_hhw_corporate||[]).push([[70],{6070:function(t,n,e){e.r(n);var o=e(4692),a=e(1548);class c{constructor(t){this.$form=t,this.consumptionData={},this.$inputItems=t.find("[data-wcc-var]"),this.reset(),this.$inputItems.each((t,n)=>{const e=o(n);this.handleInputSync(e),this.calculateConsumption(e,0)}),this.handleStickyResultBar()}reset(){this.$form[0].reset()}handleInputSync(t){const n=t.find('[type="range"]'),e=t.find('[type="number"]'),a=t.find('[type="radio"]'),c=parseInt(e.attr("min")),s=parseInt(e.attr("max")),i=t.find(".btn.icon-up"),r=t.find(".btn.icon-down");e.on("input change",()=>{let o=parseInt(e.val());const a=o>s;o<c&&(o=c),a&&(o=s),e.val(o),n.val(o),n.trigger("change"),this.calculateConsumption(t,o)}),n.on("input",()=>{const t=parseInt(n.val());e.val(t).trigger("change")}),a.on("change",n=>{const a=o(n.delegateTarget);t.data("wcc-amount",a.data("wcc-amount")),e.length?e.trigger("change"):this.calculateConsumption(t,1)}),i.on("click",()=>{e[0].stepUp(),e.trigger("change")}),r.on("click",()=>{e[0].stepDown(),e.trigger("change")})}calculateConsumption(t,n){const e=Object.assign({},this.consumptionData);e[t.data("wcc-var")]={count:n,amount:t.data("wcc-amount"),person:!!t.data("wcc-person"),duration:t.data("wcc-duration")};const o=e.person?.count||1;let a=0;for(const t in e){if("person"===t)continue;if("toilet"===t&&(e[t].count=1),e[t].count<=0)continue;let n=e[t].count*e[t].amount;"week"===e[t].duration?n/=7:"year"===e[t].duration&&(n/=365),e[t].person||(n/=o),a+=n}if(this.consumptionData=e,a<=0)return;const c=Math.ceil(a),s=Math.round(.417*c);this.$form.find(".wcc-result-liter").text(c),this.updateRatingControl(c>=350?350:c),this.$form.find("#wcc-chart-liter").attr("style",`--liter:${c}`),this.$form.find(".wcc-result-price").text(s)}updateRatingControl(t){const n=this.$form.find("#wcc-rating-control"),e=this.$form.find("#wcc-result-text-addition"),o=this.$form.find("#wcc-result-text-addition-medium"),a=this.$form.find("#wcc-result-text-addition-high"),c=n.data("wcc-low"),s=n.data("wcc-high");e.addClass("d-none"),o.addClass("d-none"),a.addClass("d-none"),t<c?n.css("--icon","var(--icon-low)"):c<=t&&t<s?(n.css("--icon","var(--icon-medium)"),o.removeClass("d-none"),e.removeClass("d-none")):t>=s&&(n.css("--icon","var(--icon-high)"),a.removeClass("d-none"),e.removeClass("d-none")),n.val(t)}handleStickyResultBar(){const t=this.$form.find("#wcc-result-bar"),n=t.prev();let e=!0;function c(){const o=t.offset().top,a=Math.floor(n.offset().top+n.height());e=!(o>=a),e?t.addClass("js_is-sticky"):t.removeClass("js_is-sticky")}c(),o(window).on("scroll.stickyResultBar",(0,a.s)(c,125))}}o(".water-consumption-calculator").each((t,n)=>{new c(o(n))})}}]); 2//# sourceMappingURL=70.67cdcb5721df450a4b2c.js.map
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.