1(self.webpackChunk=self.webpackChunk||[]).push([[85807],{11(e,t,i){"use strict";i.d(t,{A:()=>l});class a{constructor(){return a.instance||(a.instance=this),a.instance}getValueFromPath(e,t){let i=e.replace(/%/g,"").split("."),a=t;for(let e of i){if(null===a||"object"!=typeof a||!(e in a))return;a=a[e]}if("object"!=typeof a||null===a)return a}}let r=Object.freeze(new a);class l{static getValueFromPath(e,t){return r.getValueFromPath(e,t)}}},98(e){!function(t,i){e.exports=i()}(0,function(){return function(e){function t(a){if(i[a])return i[a].exports;var r=i[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,a){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,i){"use strict";function a(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,i,a){return i&&e(t.prototype,i),a&&e(t,a),t}}(),l=function(){function e(){a(this,e)}return r(e,null,[{key:"hash",value:function(t){return e.hex(e.md51(t))}},{key:"md5cycle",value:function(t,i){var a=t[0],r=t[1],l=t[2],n=t[3];a=e.ff(a,r,l,n,i[0],7,-0x28955b88),n=e.ff(n,a,r,l,i[1],12,-0x173848aa),l=e.ff(l,n,a,r,i[2],17,0x242070db),r=e.ff(r,l,n,a,i[3],22,-0x3e423112),a=e.ff(a,r,l,n,i[4],7,-0xa83f051),n=e.ff(n,a,r,l,i[5],12,0x4787c62a),l=e.ff(l,n,a,r,i[6],17,-0x57cfb9ed),r=e.ff(r,l,n,a,i[7],22,-0x2b96aff),a=e.ff(a,r,l,n,i[8],7,0x698098d8),n=e.ff(n,a,r,l,i[9],12,-0x74bb0851),l=e.ff(l,n,a,r,i[10],17,-42063),r=e.ff(r,l,n,a,i[11],22,-0x76a32842),a=e.ff(a,r,l,n,i[12],7,0x6b901122),n=e.ff(n,a,r,l,i[13],12,-0x2678e6d),l=e.ff(l,n,a,r,i[14],17,-0x5986bc72),r=e.ff(r,l,n,a,i[15],22,0x49b40821),a=e.gg(a,r,l,n,i[1],5,-0x9e1da9e),n=e.gg(n,a,r,l,i[6],9,-0x3fbf4cc0),l=e.gg(l,n,a,r,i[11],14,0x265e5a51),r=e.gg(r,l,n,a,i[0],20,-0x16493856),a=e.gg(a,r,l,n,i[5],5,-0x29d0efa3),n=e.gg(n,a,r,l,i[10],9,0x2441453),l=e.gg(l,n,a,r,i[15],14,-0x275e197f),r=e.gg(r,l,n,a,i[4],20,-0x182c0438),a=e.gg(a,r,l,n,i[9],5,0x21e1cde6),n=e.gg(n,a,r,l,i[14],9,-0x3cc8f82a),l=e.gg(l,n,a,r,i[3],14,-0xb2af279),r=e.gg(r,l,n,a,i[8],20,0x455a14ed),a=e.gg(a,r,l,n,i[13],5,-0x561c16fb),n=e.gg(n,a,r,l,i[2],9,-0x3105c08),l=e.gg(l,n,a,r,i[7],14,0x676f02d9),r=e.gg(r,l,n,a,i[12],20,-0x72d5b376),a=e.hh(a,r,l,n,i[5],4,-378558),n=e.hh(n,a,r,l,i[8],11,-0x788e097f),l=e.hh(l,n,a,r,i[11],16,0x6d9d6122),r=e.hh(r,l,n,a,i[14],23,-0x21ac7f4),a=e.hh(a,r,l,n,i[1],4,-0x5b4115bc),n=e.hh(n,a,r,l,i[4],11,0x4bdecfa9),l=e.hh(l,n,a,r,i[7],16,-0x944b4a0),r=e.hh(r,l,n,a,i[10],23,-0x41404390),a=e.hh(a,r,l,n,i[13],4,0x289b7ec6),n=e.hh(n,a,r,l,i[0],11,-0x155ed806),l=e.hh(l,n,a,r,i[3],16,-0x2b10cf7b),r=e.hh(r,l,n,a,i[6],23,0x4881d05),a=e.hh(a,r,l,n,i[9],4,-0x262b2fc7),n=e.hh(n,a,r,l,i[12],11,-0x1924661b),l=e.hh(l,n,a,r,i[15],16,0x1fa27cf8),r=e.hh(r,l,n,a,i[2],23,-0x3b53a99b),a=e.ii(a,r,l,n,i[0],6,-0xbd6ddbc),n=e.ii(n,a,r,l,i[7],10,0x432aff97),l=e.ii(l,n,a,r,i[14],15,-0x546bdc59),r=e.ii(r,l,n,a,i[5],21,-0x36c5fc7),a=e.ii(a,r,l,n,i[12],6,0x655b59c3),n=e.ii(n,a,r,l,i[3],10,-0x70f3336e),l=e.ii(l,n,a,r,i[10],15,-1051523),r=e.ii(r,l,n,a,i[1],21,-0x7a7ba22f),a=e.ii(a,r,l,n,i[8],6,0x6fa87e4f),n=e.ii(n,a,r,l,i[15],10,-0x1d31920),l=e.ii(l,n,a,r,i[6],15,-0x5cfebcec),r=e.ii(r,l,n,a,i[13],21,0x4e0811a1),a=e.ii(a,r,l,n,i[4],6,-0x8ac817e),n=e.ii(n,a,r,l,i[11],10,-0x42c50dcb),l=e.ii(l,n,a,r,i[2],15,0x2ad7d2bb),r=e.ii(r,l,n,a,i[9],21,-0x14792c6f),t[0]=a+t[0]&0xffffffff,t[1]=r+t[1]&0xffffffff,t[2]=l+t[2]&0xffffffff,t[3]=n+t[3]&0xffffffff}},{key:"cmn",value:function(e,t,i,a,r,l){return((t=(t+e&0xffffffff)+(a+l&0xffffffff)&0xffffffff)<<r|t>>>32-r)+i&0xffffffff}},{key:"ff",value:function(t,i,a,r,l,n,o){return e.cmn(i&a|~i&r,t,i,l,n,o)}},{key:"gg",value:function(t,i,a,r,l,n,o){return e.cmn(i&r|a&~r,t,i,l,n,o)}},{key:"hh",value:function(t,i,a,r,l,n,o){return e.cmn(i^a^r,t,i,l,n,o)}},{key:"ii",value:function(t,i,a,r,l,n,o){return e.cmn(a^(i|~r),t,i,l,n,o)}},{key:"md51",value:function(t){for(var i=t.length,a=[0x67452301,-0x10325477,-0x67452302,0x10325476],r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0,n=64;n<=i;n+=64)e.md5cycle(a,e.md5blk(t.substring(n-64,n)));for(t=t.substring(n-64),n=0,l=t.length;n<l;n++)r[n>>2]|=t.charCodeAt(n)<<(n%4<<3);if(r[n>>2]|=128<<(n%4<<3),n>55)for(e.md5cycle(a,r),n=0;n<16;n++)r[n]=0;return r[14]=8*i,e.md5cycle(a,r),a}},{key:"md5blk",value:function(e){for(var t=[],i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}},{key:"rhex",value:function(t){var i="";return i+=e.hexArray[t>>4&15]+e.hexArray[t>>0&15],i+=e.hexArray[t>>12&15]+e.hexArray[t>>8&15],i+=e.hexArray[t>>20&15]+e.hexArray[t>>16&15],i+=e.hexArray[t>>28&15]+e.hexArray[t>>24&15]}},{key:"hex",value:function(t){for(var i=t.length,a=0;a<i;a++)t[a]=e.rhex(t[a]);return t.join("")}}]),e}();l.hexArray=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],t.default=l},function(e,t,i){e.exports=i(0)}])})},154(e,t,i){"use strict";i.d(t,{A:()=>a});class a{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var i of e.entries())t(i[1],i[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(i=>
1{t(e[i],i)});throw Error(`The element type ${typeof e} is not iterable!`)}}},272(e,t,i){var a,r;!function(l,n){void 0!==(r="function"==typeof(a=n)?a.call(t,i,t,e):a)&&(e.exports=r)}(0,function(){"use strict";function e(e){for(var t=[],i=0,a=e.length;i<a;i++)-1===t.indexOf(e[i])&&t.push(e[i]);return t}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var t={},i={"==":function(e,t){return e==t},"===":function(e,t){return e===t},"!=":function(e,t){return e!=t},"!==":function(e,t){return e!==t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t,i){return void 0===i?e<t:e<t&&t<i},"<=":function(e,t,i){return void 0===i?e<=t:e<=t&&t<=i},"!!":function(e){return t.truthy(e)},"!":function(e){return!t.truthy(e)},"%":function(e,t){return e%t},log:function(e){return console.log(e),e},in:function(e,t){return!!t&&void 0!==t.indexOf&&-1!==t.indexOf(e)},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(e,t,i){if(i<0){var a=String(e).substr(t);return a.substr(0,a.length+i)}return String(e).substr(t,i)},"+":function(){return Array.prototype.reduce.call(arguments,function(e,t){return parseFloat(e,10)+parseFloat(t,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(e,t){return parseFloat(e,10)*parseFloat(t,10)})},"-":function(e,t){return void 0===t?-e:e-t},"/":function(e,t){return e/t},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(e,t){return e.concat(t)},[])},var:function(e,t){var i=void 0===t?null:t,a=this;if(void 0===e||""===e||null===e)return a;for(var r=String(e).split("."),l=0;l<r.length;l++)if(null==a||void 0===(a=a[r[l]]))return i;return a},missing:function(){for(var e=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,a=0;a<i.length;a++){var r=i[a],l=t.apply({var:r},this);(null===l||""===l)&&e.push(r)}return e},missing_some:function(e,i){var a=t.apply({missing:i},this);return i.length-a.length>=e?[]:a}};return t.is_logic=function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&1===Object.keys(e).length},t.truthy=function(e){return(!Array.isArray(e)||0!==e.length)&&!!e},t.get_operator=function(e){return Object.keys(e)[0]},t.get_values=function(e){return e[t.get_operator(e)]},t.apply=function(e,a){if(Array.isArray(e))return e.map(function(e){return t.apply(e,a)});if(!t.is_logic(e))return e;var r,l,n,o,s,u=t.get_operator(e),c=e[u];if(Array.isArray(c)||(c=[c]),"if"===u||"?:"==u){for(r=0;r<c.length-1;r+=2)if(t.truthy(t.apply(c[r],a)))return t.apply(c[r+1],a);return c.length===r+1?t.apply(c[r],a):null}if("and"===u){for(r=0;r<c.length&&(l=t.apply(c[r],a),t.truthy(l));r+=1);return l}if("or"===u){for(r=0;r<c.length&&(l=t.apply(c[r],a),!t.truthy(l));r+=1);return l}if("filter"===u)return(o=t.apply(c[0],a),n=c[1],Array.isArray(o))?o.filter(function(e){return t.truthy(t.apply(n,e))}):[];if("map"===u)return(o=t.apply(c[0],a),n=c[1],Array.isArray(o))?o.map(function(e){return t.apply(n,e)}):[];if("reduce"===u)return(o=t.apply(c[0],a),n=c[1],s=void 0!==c[2]?t.apply(c[2],a):null,Array.isArray(o))?o.reduce(function(e,i){return t.apply(n,{current:i,accumulator:e})},s):s;if("all"===u){if(o=t.apply(c[0],a),n=c[1],!Array.isArray(o)||!o.length)return!1;for(r=0;r<o.length;r+=1)if(!t.truthy(t.apply(n,o[r])))return!1;return!0}else if("none"===u){if(o=t.apply(c[0],a),n=c[1],!Array.isArray(o)||!o.length)return!0;for(r=0;r<o.length;r+=1)if(t.truthy(t.apply(n,o[r])))return!1;return!0}else if("some"===u){if(o=t.apply(c[0],a),n=c[1],!Array.isArray(o)||!o.length)return!1;for(r=0;r<o.length;r+=1)if(t.truthy(t.apply(n,o[r])))return!0;return!1}if(c=c.map(function(e){return t.apply(e,a)}),i.hasOwnProperty(u)&&"function"==typeof i[u])return i[u].apply(a,c);if(u.indexOf(".")>0){var d=String(u).split("."),f=i;for(r=0;r<d.length;r++){if(!f.hasOwnProperty(d[r]))throw Error("Unrecognized operation "+u+" (failed at "+d.slice(0,r+1).join(".")+")");f=f[d[r]]}return f.apply(a,c)}throw Error("Unrecognized operation "+u)},t.uses_data=function(i){var a=[];if(t.is_logic(i)){var r=t.get_operator(i),l=i[r];Array.isArray(l)||(l=[l]),"var"===r?a.push(l[0]):l.forEach(function(e){a.push.apply(a,t.uses_data(e))})}return e(a)},t.add_operation=function(e,t){i[e]=t},t.rm_operation=function(e){delete i[e]},t.rule_like=function(e,i){if(i===e||"@"===i)return!0;
1if("number"===i)return"number"==typeof e;if("string"===i)return"string"==typeof e;if("array"===i)return Array.isArray(e)&&!t.is_logic(e);if(t.is_logic(i)){if(t.is_logic(e)){var a=t.get_operator(i),r=t.get_operator(e);if("@"===a||a===r)return t.rule_like(t.get_values(e,!1),t.get_values(i,!1))}return!1}if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;for(var l=0;l<i.length;l+=1)if(!t.rule_like(e[l],i[l]))return!1;return!0}return!1},t})},563(e,t,i){"use strict";function a(e,t){var i,a,r,l,n,o,s,u,c;if(!e)return null;if("now"===(e=e.trim().replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()))return null===t||isNaN(t)?new Date().getTime()/1e3|0:0|t;if(!isNaN(i=Date.parse(e)))return i/1e3|0;if("now"===e)return new Date().getTime()/1e3;if(!isNaN(i=Date.parse(e)))return i/1e3;if(a=e.match(/^(\d{2,4})-(\d{2})-(\d{2})(?:\s(\d{1,2}):(\d{2})(?::\d{2})?)?(?:\.(\d+)?)?$/))return new Date(a[1]>=0&&a[1]<=69?+a[1]+2e3:a[1],parseInt(a[2],10)-1,a[3],a[4]||0,a[5]||0,a[6]||0,a[7]||0)/1e3;function d(e,t,i){var a,n=l[t];void 0!==n&&(0==(a=n-r.getDay())?a=7*i:a>0&&"last"===e?a-=7:a<0&&"next"===e&&(a+=7),r.setDate(r.getDate()+a))}function f(e){var t=e.split(" "),i=t[0],a=t[1].substring(0,3),l=/\d+/.test(i),o=("last"===i?-1:1)*("ago"===t[2]?-1:1);if(l&&(o*=parseInt(i,10)),n.hasOwnProperty(a)&&!t[1].match(/^mon(day|\.)?$/i))return r["set"+n[a]](r["get"+n[a]]()+o);if("wee"===a)return r.setDate(r.getDate()+7*o);if("next"===i||"last"===i)d(i,a,o);else if(!l)return!1;return!0}if(r=t?new Date(1e3*t):new Date,l={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},n={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},u="([+-]?\\d+\\s"+(s="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)")+"|(last|next)\\s"+s+")(\\sago)?",!(a=e.match(RegExp(u,"gi"))))return!1;for(c=0,o=a.length;c<o;c++)if(!f(a[c]))return!1;return r.getTime()/1e3}i.d(t,{I:()=>a})},592(e,t,i){"use strict";i.d(t,{Kq:()=>o,Ay:()=>d});class a{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return a.isIPhoneDevice()||a.isIPadDevice()}static isNativeWindowsBrowser(){return a.isIEBrowser()||a.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":a.isTouchDevice(),"is-ios":a.isIOSDevice(),"is-native-windows":a.isNativeWindowsBrowser(),"is-iphone":a.isIPhoneDevice(),"is-ipad":a.isIPadDevice(),"is-ie":a.isIEBrowser(),"is-edge":a.isEdgeBrowser()}}}let r="modal-backdrop",l="modal-backdrop-open",n="no-scroll",o=350,s={ON_CLICK:"backdrop/onclick"};class u{constructor(){return u.instance||(u.instance=this),u.instance}create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(n),setTimeout(function(){t.classList.add(l),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this._getBackdrops().forEach(e=>e.classList.remove(l)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(n)}_dispatchEvents(){let e=a.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(r)&&document.dispatchEvent(new CustomEvent(s.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${r}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(e=>e.remove())}_exists(){return document.querySelectorAll(`.${r}`).length>0}_getTemplate(){return`<div class="${r}"></div>`}}let c=Object.freeze(new u);class d{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;c.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;c.remove(e)}static SELECTOR_CLASS(){return r}}},607(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{A:()=>CalculatorServiceUtil});var json_logic_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(272),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(json_logic_js__WEBPACK_IMPORTED_MODULE_0__),_include_strtotime_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(563),_exceptions_calculation_exception__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(891);class CalculatorServiceSingleton{constructor(){return this.calculationCache={}
1,CalculatorServiceSingleton.instance||(CalculatorServiceSingleton.instance=this),CalculatorServiceSingleton.instance}clearCache(){Object.keys(this.calculationCache).forEach(e=>delete this.calculationCache[e])}async calculate(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=this,l=null;try{if("api"===e.type&&"POST"===e.options.api.method){let i=(e.options.api.variables||"").trim();if(i&&"*"!==i){let e={};i.split(",").forEach(i=>{if(i=i.trim()){if(i.includes(".")){let a=i.split("."),r=t;for(let e=0;e<a.length;e++)r=r[a[e]];e[a[a.length-a.length+1]]=r}else void 0!==t[i]?e[i]=t[i]:t.fields&&t.fields[i]&&(e[i]=t.fields[i].value)}}),t=e}}let i=this.getCacheKey(t,e),a=null;if(r.calculationCache[i])a=r.calculationCache[i];else{let n="";"pro"===e.type?n=e.jsonFormula:"simple"===e.type&&(n=e.stringFormula),l=r.replaceHtmlEntities(n),"pro"===e.type&&null!==e.jsonFormula?a=await r.evaluateProRule(JSON.parse(l.replace(/[<][\s]+/g,"<")),t):"simple"===e.type&&null!==e.stringFormula?a=await r.evaluateSimpleRule(l,t):"api"===e.type&&null!==e.options.api&&void 0!==e.options.api.url&&(a=await r.evaluateApiRule(e,t)),r.calculationCache[i]=a}return Promise.resolve(a)}catch(n){let r="Error in "+(i?i.toLowerCase():"")+" calculation";throw a&&(a.label||a.key)&&(r+=" of "+(a.label||"")+" ("+(a.key||"")+")"),r+=". "+n.message+', Formel: "'+l+'"',new _exceptions_calculation_exception__WEBPACK_IMPORTED_MODULE_2__.A(r,i,e,l,t,n,a)}}getCacheKey(e,t){let{quantity:i,value:a,...r}=e;return"api"===t.type&&"GET"===t.options.api.method?this.hashCacheKey(JSON.stringify(t.id)):this.hashCacheKey(JSON.stringify(t.id)+":"+JSON.stringify(r))}hashCacheKey(e){return this.cyrb53(e,0).toString(36)+":"+this.cyrb53(e,1).toString(36)}cyrb53(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0xdeadbeef^t,a=0x41c6ce57^t;for(let t=0,r;t<e.length;t++)i=Math.imul(i^(r=e.charCodeAt(t)),0x9e3779b1),a=Math.imul(a^r,0x5f356495);return i=Math.imul(i^i>>>16,0x85ebca6b)^Math.imul(a^a>>>13,0xc2b2ae35),0x100000000*(2097151&(a=Math.imul(a^a>>>16,0x85ebca6b)^Math.imul(i^i>>>13,0xc2b2ae35)))+(i>>>0)}evaluateApiRule(e,t){return fetch(e.options.api.url,{method:e.options.api.method,body:"POST"===e.options.api.method?JSON.stringify(t):null}).then(e=>e.json())}evaluateProRule(e,t){return this.addCustomRules(t),Promise.resolve(json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().apply(e,t))}replaceHtmlEntities(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}convertToDate(e,t){return("today"===e||"heute"===e)&&(e="now"),(0,_include_strtotime_js__WEBPACK_IMPORTED_MODULE_1__.I)(e)}convertToNet(e,t){return"net"===t.context.taxState||"tax-free"===t.context.taxState?e:e*(t.product.taxRate/100+1)}convertToGross(e,t){return"gross"===t.context.taxState?e:e/(t.product.taxRate/100+1)}addCustomRules(e){json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("net",t=>this.convertToNet(t,e)),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("netto",t=>this.convertToNet(t,e)),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("brutto",t=>this.convertToGross(t,e)),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("gross",t=>this.convertToGross(t,e));let t=function(e){return 1==arguments.length?null===e?0:e.length:arguments.length};json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("length",t);let i=function(e,t){let i=parseFloat((t+="").replace(",","."));if(e=parseFloat((e+"").replace(",",".")),isNaN(t.replace(",",".")))return!1;if(parseInt(e,10)===e)return i%e==0;var a=i/e;return 1e-8>Math.abs(parseInt(Math.round(a),10)-a)};function a(e){let t=e.length,i={},a=e.slice();for(a.sort();t--;){let e=a[t];
1if(/nul|nan|infini/i.test(String(e))&&(e=String(e)),i[JSON.stringify(e)])return!0;i[JSON.stringify(e)]=!0}return!1}json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("stepsize",i),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("date",t=>this.convertToDate(t,e)),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("datum",t=>this.convertToDate(t,e)),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("floor",function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Math.floor(e/t)*t}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("ceil",function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Math.ceil(e/t)*t}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("round",function(e,t){return Number(Math.round(e+"e+"+t)+"e-"+t)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("pad",function(e,t){return void 0===t&&(t=2),Number(e).toFixed(t)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("sqrt",function(e){return Math.sqrt(e)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("pow",function(e,t){return Math.pow(e,t)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("unique",function(e){return!a(e)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("matrix",function(){let e=arguments.length;if(e<2)return console.error("matrix: not enough arguments"),!1;let t=arguments[e-1],i=null,a=e-1;Array.isArray(t)||(i=t,a=e-2);let r=arguments,l=arguments[a],n=!1,o=[],s=[],u=e=>!isNaN(parseFloat(e))&&isFinite(e),c=(e,t,i)=>u(e)&&u(t)?i(parseFloat(e),parseFloat(t)):i(e,t);for(let e=0;e<a;e++){let t=o.length?o:l;o=[],t.forEach(function(t,a){null==i&&c(r[e],t[e],(e,t)=>e>=t)?(o.push(t),(void 0===s[e]||c(s[e],t[e],(e,t)=>e<t))&&(s[e]=t[e])):"=="===i&&String(r[e])===String(t[e])?(o.push(t),(void 0===s[e]||c(s[e],t[e],(e,t)=>e<t))&&(s[e]=t[e])):"ceil"===i&&c(r[e],t[e],(e,t)=>e<=t)?(o.push(t),(void 0===s[e]||c(s[e],t[e],(e,t)=>e>t))&&(s[e]=t[e])):"startsWith"===i&&(r[e]+"").startsWith(t[e])&&(o.push(t),s[e]||(s[e]=t[e]))})}return 1===o.length?n=o[0][a]:o.length>1&&o.forEach(function(e){JSON.stringify(e.slice(0,a))===JSON.stringify(s)&&(n=e[a])}),n}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("regexFind",function(){let e=arguments.length;if(e<2)return console.error("regexFind: not enough arguments"),!1;let t=arguments[0].toString(),i=arguments[1],a=arguments[2]?parseInt(arguments[2],10)-1:0,r=arguments[3]?arguments[3]:"",l=void 0!==arguments[4]?arguments[4]:0,n=t.match(new RegExp(i,r.toString()));return n?n[a]:l}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("replace",function(){let e=arguments.length;if(3!==e)return console.error("replace operator: not enough arguments"),arguments[0];let t=arguments[0].toString(),i=arguments[1],a=arguments[2];return t.replaceAll(i,a)}),json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().add_operation("replaceApply",function(){let t;let i=Array.from(arguments);function a(e){let t=e.length;if(t<2)return{replacements:[],template:null};let i=[],r=null;if(3===t&&"string"==typeof e[0])i.push([e[0],e[1]]),r=e[2];else{if(!(2===t&&Array.isArray(e[0])))return{replacements:[],template:null};e[0].length>0&&Array.isArray(e[0][0])?i=e[0].slice():i.push(e[0]),r=e[1]}if(null!==r&&"object"==typeof r&&void 0!==r.replaceApply){let e=a(r.replaceApply);i=i.concat(e.replacements),r=e.template}return{replacements:i,template:r}}let{replacements:r,template:l}=a(i);if(0===r.length||null===l)return null;let n=l;if(null!==n&&"object"==typeof n&&json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().is_logic(n)&&(n=json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().apply(n,e)),null==n)return null;for(let t of("string"!=typeof n&&(n=JSON.stringify(n)),r)){let i;if(!Array.isArray(t)||t.length<2)continue;let a=t[0],r=t[1];if("string"==typeof(i=null!==r&&"object"==typeof r&&json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().is_logic(r)?json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().apply(r,e):r))n=n.replaceAll(a,i);else if("number"==typeof i)n=(n=n.replaceAll('"'+a+'"',String(i))).replaceAll(a,String(i));else if("boolean"==typeof i){let e=i?"true":"false";n=(n=n.replaceAll('"'+a+'"',e)).replaceAll(a,e)}else if(Array.isArray(i)||null!==i&&"object"==typeof i){let e=JSON.stringify(i);n=(n=n.replaceAll('"'+a+'"',e)).replaceAll(a,e)}}try{t=JSON.parse(n)}catch(e){return console.error("replaceApply: JSON parse error:",e.message,"json:",n),null}return null!==t&&"object"==typeof t&&json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().is_logic(t)?json_logic_js__WEBPACK_IMPORTED_MODULE_0___default().apply(t,e):t})}evaluateSimpleRule(formula,ruleData){let that=this;formula=that.replaceDottedVariables(formula,ruleData),Object.keys(ruleData).forEac
1h(function(e){"fields"!==e&&"product"!==e&&(formula=formula.replace(RegExp(e,"g"),ruleData[e]))});try{if(-1!==formula.indexOf("fields"))throw Error("Fields are not replaced correctly, check the formula: "+formula);if(-1!==formula.indexOf("[object Object]"))throw Error("Formula is not replaced correctly, check the formula: "+formula);try{function net(e){return that.convertToNet(e,ruleData)}function netto(e){return that.convertToNet(e,ruleData)}function gross(e){return that.convertToGross(e,ruleData)}function brutto(e){return that.convertToGross(e,ruleData)}let calcResult=eval(formula);return Promise.resolve(calcResult)}catch(e){throw Error("Error in formula: "+formula+", "+e.message)}}catch(e){return Promise.reject(e)}}replaceDottedVariables(e,t){return e.replace(/\b([\w.]+)\b(?![\w."])/g,function(e,i){let a=i.split("."),r=t;for(let e of a)if(void 0===(r=r[e]))break;return"string"==typeof r&&(r="'"+r+"'"),"object"==typeof r&&(r=JSON.stringify(r)),void 0!==r?r:e})}getFallbackValue(e){let t=e.fallbackType,i=e.fallbackValue;return t&&""!==t?this.castToFallbackType(i,t):""}castToFallbackType(e,t){if(!t||""===t||"null"===t)return e;switch(t){case"number":if(null===e||""===e||void 0===e)return 0;if("number"==typeof e)return e;if("boolean"==typeof e)return+!!e;let i=String(e).replace(",","."),a=i.includes(".")?parseFloat(i):parseInt(i,10);return isNaN(a)?0:a;case"string":if(null==e)return"";if("boolean"==typeof e)return e?"true":"false";if("object"==typeof e)try{let t=JSON.stringify(e);return void 0===t?"":t}catch(e){return""}return String(e);case"boolean":if("boolean"==typeof e)return e;if("true"===e||"1"===e||1===e)return!0;if("false"===e||"0"===e||0===e||null===e||""===e)return!1;return!!e;default:return e}}}let CalculatorServiceInstance=Object.freeze(new CalculatorServiceSingleton);class CalculatorServiceUtil{static calculateWithoutCommoncalculationCache(e,t,i){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return CalculatorServiceInstance.calculate(e,t,i,a)}static calculate(e,t,i){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return CalculatorServiceInstance.calculate(e,t,i,a)}static clearCache(){CalculatorServiceInstance.clearCache()}static getFallbackValue(e){return CalculatorServiceInstance.getFallbackValue(e)}static castToFallbackType(e,t){return CalculatorServiceInstance.castToFallbackType(e,t)}}},807(e,t,i){"use strict";i.r(t),i.d(t,{default:()=>ea});var a=i(98),r=i.n(a),l=i(154);class n{constructor(){return n.instance||(n.instance=this),n.instance}update(e,t,i,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";if(null==e||isNaN(e)){for(let e=0;e<t.length;e++)if(t[e]){t[e].querySelectorAll("span").forEach(e=>e.remove());var n=t[e].innerHTML;n=(n=n.replace(/ /g," ")).replace(/\d{1,3}(?:[\u202F ,.â]\d{3})*(?:[,.]\d+)?|NaN|---/g,"---"),t[e].innerHTML=n}return}e<0&&(e=0);for(let s=0;s<t.length;s++){if(!t[s])continue;let u=this;var o=u._formatPrice(e,i,a,r);t[s].querySelectorAll("span").forEach(e=>e.remove());var n=t[s].innerHTML;if(n=n.replace(/ /g," "),n=0===r?n.replace(/\d{1,3}(?:[\u202F ,.â]\d{3})*|NaN|---/g,o):n.replace(/\d{1,3}(?:[\u202F ,.â]\d{3})*(?:[,.]\d{2})|NaN|---/g,o),t[s].innerHTML=n,""!==l){let e=document.createElement("span");e.className="product-detail-price-prefix",e.textContent=l,t[s].insertAdjacentElement("afterbegin",e),t[s].insertAdjacentText("afterbegin"," ")}let c=t[s].nextElementSibling;c&&"META"===c.tagName&&c.setAttribute("content",this._round(e,2))}}_round(e,t){return Number(Math.round(e+"e"+t)+"e-"+t).toFixed(t)}_formatPrice(e,t,i,a){let r=this;var l=e;return l=r._toFixed(l,a),r._number_format(l,a,t,i)}_number_format(e,t,i,a){var r=e.toString().split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,a),r.join(i)}_toFixed(e,t){return(+(Math.round(+(e+"e"+t))+"e"+-t)).toFixed(t)}countDigitsAfterDecimal(e,t,i){let a=RegExp("\\"+t+"\\d{3}","g"),r=e.replace(a,""),l="."===t?",":".",n=r.split(l)[1];return n?n.length:0}}let o=Object.freeze(new n);class s{static update(e,t,i,a,r,l){o.update(e,t,i,a,r,l)}static formatPrice(e,t,i,a){return o._formatPrice(e,t,i,a)}static countDigitAfterDecimalPart(e,t){return o.countDigitsAfterDecimal(e,t)}}class u{constructor(){return u.instance||(u.instance=this),u.instance}readConfig(e){let t=this;return t._getConfigFromUrl(e)}writeConfig(e,t,i){let a=this.extractKeyValuePair(i),r=t+"="+a;if(document.location.hash.indexOf(t)>0){let e=t+"=.*";document.location.hash=document.location.hash.replace(RegExp(e,"g"),r)}else document.location.hash+=r;let l={};try{l=JSON.parse(localStorage.getItem("neonCfg")),(null===l||"string"==typeof l)&&(l={})}catch(e){l={}}l[e]=a,localStorage.setItem("neonCfg",JSON.stringify(l))}clearConfig(){localStorage.removeItem("neonCfg")}extractKeyValuePair(e){let t=this,i=[];return e.forEach(function(e){if(null!=e){if(Array.isArray(e)){let a=t.extractKeyValuePair(e);""!==a&&i.push(a)}else i.push(e.key+"::"+e.value)}}),i.join("--")}_getConfigFromUrl(e){let t=document.location.hash.replace("#"+e+"=",""),i=[];return""!==t&&(i=t.split("--").map(function(e){let[t,i]=e.split("::");return{key:t,value:i=decodeURIComponent(i)}})),i}}let c=Object.freeze(new u);class d{static readConfig(){return c.readConfig("neonCfg")}static writeConfig(e,t){c.writeConfig(e,"neonCfg",t)}static clearConfig(){c.clearConfig()}static extractKeyValuePair(e){return c.extractKeyValuePair(e)}}var f=i(607);class p{constructor(){return p.instance||(p.instance=this),p.instance}async calculateHiddenMedia(e,t,i){let a={groups:{}};for(let r of e.mediaGroups){let e=!0;if(r.visibilityCalculationId&&r.visibilityCalculation&&(r.visibilityCalculation.stringFormula||r.visibilityCalculation.jsonFormula))try{e=await f.A.calculate(r.visibilityCalculation,t,"Media Group Visibility")}catch(e){throw i(e),e}if(a.groups[r.id]={isHidden:!e,hiddenMediaIds:[]},e){if(r.medias&&r.medias.length>0){for(let e of r.medias)if(null!=e.media&&e.visibilityCalculationId&&e.visibilityCalculation&&(e.visibilityCalculation.stringFormula||e.visibilityCalculation.jsonFormula))try{await f.A.calculate(e.visibilityCalculation,t,"Image Visibility")||a.groups[r.id].hiddenMediaIds.push(e.media.id)}catch(e){throw i(e),e}}}else if(r.medias&&r.medias.length>0)for(let e of r.medias)e.media&&e.media.id&&a.groups[r.id].hiddenMediaIds.push(e.media.id)}return a}getAdditionalMediaIds(e){let t=[];return e.filter(e=>"select"===e.config.type&&"image"===e.config.options.selectType).forEach(function(e){!0===e.config.options.isSelectImageActiveImageVisibleInImageView&&e.config.valueGroups.forEach(function(i){i.values.forEac
1h(function(i){let a=e.value()===i.value&&null!==i.options;!0===e.config.options.isMultiselect&&(a=e.value().map(e=>e.value).includes(i.value)&&null!==i.options),a&&("media"===i.options.imageSourceType&&i.mediaId?t.push(i.mediaId):"productCustomField"===i.options.imageSourceType&&i.options.mediaProductCustomFieldId&&t.push(i.options.mediaProductCustomFieldId))})})}),t}}let h=new p,g="neonConfiguratorGalleryCover",m="neonConfiguratorGalleryCover__image",y="neonConfiguratorGalleryCover--withOverlay",v="data-neon-gallery-cover-skip",b=150,_=3e3,C={end:()=>Promise.resolve()};class S{constructor(){return S.instance||(S.instance=this),S.instance}begin(e){let{showOverlay:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e?.parentElement;if(!i)return C;this._removeCovers(i);let a=this._getActiveSlide(e);if(!a||!this._isInViewport(a))return C;let r=Array.from(a.querySelectorAll("img")).filter(e=>!e.closest(`[${v}]`));if(0===r.length)return C;let l=this._buildCover(i,a,r);return"static"===window.getComputedStyle(i).position&&(i.style.position="relative"),i.appendChild(l),t&&(l.neonOverlayTimeout=setTimeout(()=>l.classList.add(y),b)),{end:async()=>{clearTimeout(l.neonOverlayTimeout),await this._waitForActiveSlideImages(e),l.remove()}}}_removeCovers(e){e.querySelectorAll(`.${g}`).forEach(e=>{clearTimeout(e.neonOverlayTimeout),e.remove()})}_getActiveSlide(e){let t=e.querySelector("[data-gallery-slider]");if(t){let e=window.PluginManager?.getPluginInstanceFromElement?.(t,"GallerySlider");if(e?._slider){let t=e._slider.getInfo(),i=t.slideItems[t.cloneCount+e.getCurrentSliderIndex()];if(i)return i}let i=t.querySelector("[data-gallery-slider-container] .gallery-slider-item");if(i)return i}return e.querySelector(".gallery-slider-single-image")}_isInViewport(e){let t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1;let i=window.innerHeight||document.documentElement.clientHeight;return t.bottom>0&&t.top<i}_buildCover(e,t,i){let a=e.getBoundingClientRect(),r=t.getBoundingClientRect(),l=document.createElement("div");return l.className=g,l.setAttribute("aria-hidden","true"),l.style.top=`${r.top-a.top}px`,l.style.left=`${r.left-a.left}px`,l.style.width=`${r.width}px`,l.style.height=`${r.height}px`,i.forEach(e=>{let t=document.createElement("img");t.src=e.currentSrc||e.src,t.className=m,t.alt="",l.appendChild(t)}),l}_waitForActiveSlideImages(e){let t=this._getActiveSlide(e);return Promise.race([Promise.all((t?Array.from(t.querySelectorAll("img")):[]).map(e=>this._imageReady(e))),new Promise(e=>setTimeout(e,_))]).then(()=>void 0)}_imageReady(e){return"function"==typeof e.decode?e.decode().catch(()=>void 0):e.complete&&e.naturalWidth>0?Promise.resolve():new Promise(t=>{e.addEventListener("load",t,{once:!0}),e.addEventListener("error",t,{once:!0})})}}let F=new S;class E{constructor(){return E.instance||(E.instance=this),E.instance}getActiveSlideImageSrcs(e){let t=e?.querySelector("[data-gallery-slider]");if(!t)return[];let i=window.PluginManager.getPluginInstanceFromElement(t,"GallerySlider");if(!i?._slider)return[];let a=i.getCurrentSliderIndex(),r=i._slider.getInfo(),l=r.slideItems[r.cloneCount+a];if(!l)return[];let n=[];return l.querySelectorAll("[data-full-image]").forEach(e=>{let t=e.getAttribute("data-full-image");t&&n.push(t)}),n}restoreSlideByImageSrcs(e,t){if(!t||0===t.length)return;let i=e?.querySelector("[data-gallery-slider]");if(!i)return;let a=window.PluginManager.getPluginInstanceFromElement(i,"GallerySlider");if(!a?._slider)return;let r=a._slider.getInfo(),{slideItems:l,slideCount:n,cloneCount:o}=r,s=new Set(t),u=-1;for(let e=0;e<n;e++){for(let t of l[o+e].querySelectorAll("[data-full-image]"))if(s.has(t.getAttribute("data-full-image"))){u=e;break}if(-1!==u)break}if(u<=0)return;let c=r.container;c.classList.add("no--transition"),a._slider.goTo(u),c.classList.remove("no--transition"),c.offsetHeight}replaceGallery(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=document.querySelector("[data-neonconfigurator-imagegallerygetter]");if(!a)return Promise.resolve(!0);let r=i.skipSlideRestore?[]:this.getActiveSlideImageSrcs(e),l={};
1Array.from(a.elements).forEach(e=>{e.name&&!e.disabled&&"submit"!==e.type&&(l[e.name]=e.value)}),Object.assign(l,t);let n=F.begin(e,{showOverlay:!!i.showOverlay});return fetch(a.action,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(e=>{if(!e.ok)throw Error("Network error");return e.text()}).then(t=>(e.innerHTML=t,window.PluginManager.initializePlugins())).then(()=>(this.restoreSlideByImageSrcs(e,r),!0)).catch(e=>!1).finally(()=>n.end())}async update(e){let{galleryContainer:t,configuration:i,ruleData:a,fields:r,previousImageSet:l,logError:n}=e,o=await h.calculateHiddenMedia(i,a,n),s=h.getAdditionalMediaIds(r),u=s.length===l.additionalMediaIds.length&&s.every((e,t)=>e===l.additionalMediaIds[t]),c=JSON.stringify(o)!==JSON.stringify(l.hiddenMediaStructure);return(!u||c)&&await this.replaceGallery(t,{hiddenMediaStructure:o,additionalMediaIds:s,configurationId:i.id},{skipSlideRestore:!!i.isSliderResetOnImageUpdateActive,showOverlay:!!i.isImageLoadingOverlayActive})?(l.additionalMediaIds=s,l.hiddenMediaStructure=o,{updated:!0,additionalMediaIds:s,hiddenMediaStructure:o}):{updated:!1}}}let A=new E;var P=i(891);let x=".nav-main, header, .header-main, .top-bar, .is-sticky, [data-sticky-header]",k=20,V=2;function w(e){let t;let i=parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0;if(i>0)return i;let a="string"==typeof e&&""!==e.trim()?e:x;try{t=document.querySelectorAll(a)}catch(e){t=document.querySelectorAll(x)}let r=[];t.forEach(e=>{let t=window.getComputedStyle(e);if("fixed"!==t.position&&"sticky"!==t.position)return;let i=e.getBoundingClientRect();i.height<=0||i.bottom<=0||r.push(i)}),r.sort((e,t)=>e.top-t.top);let l=0;return r.forEach(e=>{!(e.top>l+V)&&e.bottom>l&&(l=e.bottom)}),l}function q(e,t){let i=Math.max(0,e);if(t){window.scrollTo({top:i,behavior:"smooth"});return}let a=document.documentElement,r=a.style.scrollBehavior;a.style.scrollBehavior="auto",window.scrollTo(0,i),a.style.scrollBehavior=r}function D(e,t,i,a){let r=t.getBoundingClientRect().top-i;0!==r&&q(window.scrollY+r,!1),window.requestAnimationFrame(function(){let i=t.getBoundingClientRect().top,r=w(a)+k,l=e.getBoundingClientRect().bottom-window.innerHeight,n=i;i<r?n=r:l>0&&(n=Math.max(r,i-l)),Math.abs(n-i)>=1&&q(window.scrollY+(i-n),!0)})}class M{constructor(e,t,i,a,r){this._isVisible=!0,this.groupConfiguration=null;let l=this;this.el=e,this.$emitter=a,this.groupConfiguration=t,this.stickyHeaderSelectors=r;let n=this.el.querySelector(".neonConfigurator__group__header");if(null!==n){n.addEventListener("click",function(e){let t=n.getBoundingClientRect().top;null!==i.fieldgroupSettings&&"accordion"===i.fieldgroupSettings.openCloseBehavior&&l.el.parentElement.querySelectorAll(".neonConfigurator__group--boxed").forEach(e=>e.classList.add("neonConfigurator__group--closed")),l.el.classList.toggle("neonConfigurator__group--closed"),document.querySelectorAll(".neonConfigurator__infoLink").forEach(e=>e.tooltip&&e.tooltip.hide()),l.el.classList.contains("neonConfigurator__group--closed")||D(l.el,n,t,l.stickyHeaderSelectors)});let e=this.el.querySelector(".neonConfigurator__group__buttonContinue");null!==e&&e.addEventListener("click",function(e){e.preventDefault();let t=Array.from(l.el.parentElement.querySelectorAll(".neonConfigurator__group")),a=t.indexOf(l.el),r=t.slice(a+1).find(e=>"none"!==window.getComputedStyle(e).display),n=r?r.getBoundingClientRect().top:0;if(null!==i.fieldgroupSettings&&"accordion"===i.fieldgroupSettings.openCloseBehavior&&(l.el.parentElement.querySelectorAll(".neonConfigurator__group--boxed").forEach(e=>e.classList.add("neonConfigurator__group--closed")),l.el.classList.add("neonConfigurator__group--closed")),r){if(r.classList.remove("neonConfigurator__group--closed"),!i.fieldgroupSettings||!i.fieldgroupSettings.disableAutoScrollOnContinue){q(window.scrollY+(r.getBoundingClientRect().top-n),!1);let e=w(l.stickyHeaderSelectors);q(r.getBoundingClientRect().top+window.scrollY-e-k,!0)}document.querySelectorAll(".neonConfigurator__infoLink").forEach(e=>e.tooltip&&e.tooltip.hide())}})}}open(){this.el.classList.remove("neonConfigurator__group--closed")}close(){this.el.classList.add("neonConfigurator__group--closed")}hide(){this._isVisible=!1,this.el.style.display="none"}show(){this._isVisible=!0,this.el.style.display=""}isVisible(){return this._isVisible}hasVisibilityCalculation(){return null!==this.groupConfiguration.visibilityCalculation&&(null!==this.groupConfiguration.visibilityCalculation.stringFormula||null!==this.groupConfiguration.visibilityCalculation.jsonFormula)}visibilityCalculation(){return this.groupConfiguration.visibilityCalculation}}class I{constructor(e,t,i,a,r){this.metaInformation={},this.forbiddenKeyCodes=[],this.config=null,this._isVisible=!0,this._isDisabled=!1,this.group=null,this.uploadRunningCount=0;let l=this;this.$emitter=a,this._el=e,this._key=e.dataset.neonConfiguratorFieldKey,this._id=e.dataset.neonConfiguratorFieldId,this._fieldConfiguration=t,this.config=t,this.group=i,this.configuratorPlugin=r,this.initEventHandlers(),l.domField().addEventListener("keydown",function(e){l.forbiddenKeyCodes.includes(e.ke
1yCode)&&e.preventDefault()}),this.registerEventHandler(),this.setFieldNameAttribute()}get id(){return this._id}set id(e){this._id=e}get el(){return this._el}set el(e){this._el=e}get key(){return this._key}set key(e){this._key=e}initEventHandlers(){let e=this;e._el.querySelectorAll("*[data-neon-configurator-field-reset]").forEach(t=>{t.addEventListener("click",function(t){e.reset()})})}getDefaultValue(){throw Error("Abstract method getDefaultValue() must be implemented by "+this.constructor.name)}isDefaultValueNeeded(){let e=!this.isVisible()||this.isDisabled()||!this.group.isVisible();return(!e||!!this.hasVisibilityCalculation()||!this._fieldConfiguration.isVisibleInCart)&&e}value(){throw"implement value"+this.constructor.name}valueLabel(){return this.isVisible()&&!this.isDisabled()?this.value():""}isAvailableInCart(){return!0}attributes(){return{}}reset(){this.publishFieldChangeEvent()}price(){}quantity(){}needsValueUpdateOnRefresh(){return!1}getValueForUniqueIdHash(){return JSON.stringify(this.value())}calculateNewValue(){return Promise.resolve()}callbackBeforeUpdate(e){return Promise.resolve()}callbackBeforeUpdateSubcalculationAware(e){return Promise.resolve()}validations(){return this._fieldConfiguration.validations}hasVisibilityCalculation(){if(this._fieldConfiguration.visibilityCalculation){let{type:e,stringFormula:t,jsonFormula:i}=this._fieldConfiguration.visibilityCalculation;if("simple"===e)return null!==t;if("pro"===e)return null!==i}}hasValues(){return!1}visibleValueCount(){return 1}visibilityCalculation(){return this._fieldConfiguration.visibilityCalculation}hide(e){this._isVisible=!1,this._fieldConfiguration.options.visibilityRules&&"hidden"!==this._fieldConfiguration.options.visibilityRules?"disabled"===this._fieldConfiguration.options.visibilityRules&&(this._el.disabled=!0,this._el.classList.add("neonConfigurator__field--disabled"),this._el.querySelectorAll("input, select, textarea").forEach(e=>{e.disabled=!0}),this._isDisabled=!0):(this._el.style.display="none",this._isDisabled=!1),e||(this._el.disabled=!1,this._el.querySelectorAll("input, select, textarea").forEach(e=>{e.disabled=!0}))}show(){this._isVisible=!0,this._isDisabled=!1,this._fieldConfiguration.options.visibilityRules&&"hidden"!==this._fieldConfiguration.options.visibilityRules?"disabled"===this._fieldConfiguration.options.visibilityRules&&(this._el.disabled=!1,this._el.querySelectorAll("input").forEach(e=>{e.disabled=!1}),this._el.classList.remove("neonConfigurator__field--disabled")):(this._el.style.display="",this._el.querySelectorAll("input, select, textarea").forEach(e=>{e.disabled=!1})),this._el.querySelectorAll("input[type=file],input[type=button],input[type=text],input[type=number],input[type=hidden],input[type=radio],input[type=checkbox], select, textarea").forEach(e=>{e.disabled=!1})}validate(e){let t=this,i=[];return!1===this._isVisible?Promise.resolve(!0):(t.validations().forEach(function(a){let r=Object.assign({},e);"object"==typeof a.options&&Object.assign(r,a.options),r.value=t.value(),i.push(f.A.calculate(a.calculation,r,"Validation",{label:t._fieldConfiguration.label,key:t.key}).then(e=>(e?a.alwaysShowValidationInfo&&(t._el.querySelector('*[data-neon-configurator-field-validation-id="'+a.id+'"]').style.display=""):t.markFieldAndValidationMessageAsErroneous(a),e)).catch(e=>(t.configuratorPlugin?.logError(e),t.markFieldAndValidationMessageAsErroneous(a),!1)))}),Promise.all(i).then(e=>e.every(e=>e)))}markFieldAndValidationMessageAsErroneous(e){let t=this,i=t.domField().querySelector('*[data-neon-configurator-field-validation-id="'+e.id+'"]');i.classList.add("neonConfigurator__field__validations__validation--hasError"),i.style.display="",t.domField().classList.add("neonConfigurator__field--hasError"),t.domField().closest(".neonConfigurator__group").classList.add("neonConfigurator__group--hasError");let a=t.domField().closest(".neonConfigurator__group").querySelector(".neonConfigurator__group__buttonContinue");a&&(a.disabled=!0)}isValid(){let e=this;return!e._el.classList.contains("neonConfigurator__field--hasError")}changeValueVisibility(){}async updateVisibility(e){let t=!0;this.hasVisibilityCalculation()&&(t=await f.A.calculate(this.visibilityCalculation(),e,"Field visibility",{label:this._fieldConfiguration.label,key:this.key}));let i=t&&this._fieldConfiguration.isVisibleInConfiguration;this.resetValueOptionsFromInitCache(),this.group.isVisible()?i?this.show():this.hide(t):(i=!1,this.hide(!1));let a=e.repetition?` (Repetition #${e.repetition.number})`:"";for(let t of(this.$emitter.publish("afterFieldVisibilityUpdated",{isVisible:i,field:this,ruleData:e,visibilityCalculation:this.visibilityCalculation(),message:"Field"+a+' "'+this.key+'", is '+(i?"visible":"not visible")+', current value: "'+this.value()+'"'}),this._fieldConfiguration.valueGroups))for(let i of t.values)if(null!==i.visibilityCalculation&&(null!==i.visibilityCalculation.stringFormula||null!==i.visibilityCalculation.jsonFormula)){let t=await f.A.calculate(i.visibilityCalculation,e,"Fieldvalue visibility",{field:this.key,value:i.label});this.$emitter.publish("afterFieldValueVisibilityUpdated",{isValueVisible:t,field:this,value:i.label,ruleData:e,calculation:i.visibilityCalculation,message:'Field "'+this.key+'", value "'+this.value()+'" is '+(t?"visible":"not visible")}),await this.changeValueVisibility(i,t)}return await this.afterVisibilityChanged(),this.hasValues()&&0===this.visibleValueCount()&&!this._fieldConfiguration.isModalSelection&&(this.hide(!1),this.$emitter.publish("afterFieldVisibilityUpdated",{isVisible:!1,field:this,reason:"noValues"})),i}afterVisibilityChanged(){return Promise.resolve()}resetValueOptionsFromInitCache(){}domField(){return this._el}setValue(e){let t=this.domField().querySelector("input, select, textarea");return t&&(t.value=e),Promise.resolve()}getCheckedDomFields(){let e=[];return this.domField().querySelectorAll("input:checked").forEach(t=>{e.push(t)}),e}isVisible(){return this._isVisible&&void 0!==this.domField()}isDisabled(){return this._isDisabled}getKey(){return this._key}openModalSelection(){}setFieldNameAttribute(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}isRepeatField(e){return void 0!==e&&this.config.parentId}getUrlConfig(){return{key:this.config.key+(this.config.parentId?"["+this._el.getAttribute("data-neon-configurator-field-repeat-index")+"]":""),value:encodeURIComponent(this.value())}}registerEventHandler(){}publishFieldChangeEvent(){this.removeUntouchedClass(),this.$emitter.publish("fieldChange",{field:this})}publishDebounceFieldChangeEvent(){clearTimeout(this._debounceTimeout),this._debounceTimeout=setTimeout(()=>{this.publishFieldChangeEvent()},200)}removeUntouchedClass(){this.domField().classList.remove("neonConfigurator__field--isUntouched")}getAllSubconfigurations(){}}class T extends I{constructor(e,t,i,a,r){super(e,t,i,a,r),this.forbiddenKeyCodes=[],this.config.options.isMultiline||(this.forbiddenKeyCodes=[13])}getDefaultValue(){return""}value(){return this.isDefaultValueNeeded()?this.getDefaultValue():this.getFormElement().value}setValue(e){return this.getFormElement().value=e,Promise.resolve()}registerEventHandler(){let e=this;e.getFormElement().addEventListener("input",()=>{e.publishDebounceFieldChangeEvent()}),e.getFormElement().addEventListener("change",()=>{e.publishDebounceFieldChangeEvent()})}reset(){this.getFormElement().value="",super.reset()}getFormElement(){return this.config.options.isMultiline?this.domField().querySelector("textarea"):this.domField().querySelector('input[type="text"]')}}class L extends T{reset(){this.domField().querySelector('input[type="number"]').value="",I.prototype.reset.call(this)}registerEventHandler(){let e=this,t=e.domField().querySelector('input[type="number"]'),i=e.domField().querySelectorAll(".js-btn-plus, .js-btn-minus");t.addEventListener("keyup",function(){e.publishDebounceFieldChangeEvent()}),t.addEventListener("wheel",function(){e.publishDebounceFieldChangeEvent()}
1),i.forEach(t=>{t.addEventListener("click",function(){e.publishDebounceFieldChangeEvent()})}),t.addEventListener("click",function(e){e.target.focus(),e.target.select()})}getDefaultValue(){return 0}value(){if(this.isDefaultValueNeeded())return this.getDefaultValue();let e=parseFloat(this.domField().querySelector('input[type="number"]').value.replace(",","."));return isNaN(e)?this.getDefaultValue():e}valueLabel(){if(this.isDefaultValueNeeded())return"";let e=this.value();return this._fieldConfiguration.options.afterLabel&&(e+=" "+this._fieldConfiguration.options.afterLabel),e}setValue(e){return this.domField().querySelector('input[type="number"]').value=e,Promise.resolve()}}class N extends T{getDefaultValue(){return{default:"",timestamp:""}}value(){let e=this.getDefaultValue();if(!this.isDefaultValueNeeded()){let t=this.getDatePicker().selectedDates;t.length>0&&(e.default=this.getDateFormatted(),e.timestamp=t[0].getTime()/1e3)}return e}setValue(e){return this.getFormElement().value=e,this.getDatePicker().setDate(e,!1),Promise.resolve()}valueLabel(){return this.getDateFormatted()}getDateFormatted(){return this.isVisible()&&!this.isDisabled()?this.getFormElement().value:""}getUrlConfig(){return{key:this.config.key+(this.config.parentId?"["+this.domField().dataset.neonConfiguratorFieldRepeatIndex+"]":""),value:this.getDateFormatted()}}reset(){this.getDatePicker().clear(),super.reset()}registerEventHandler(){let e=this;e.getFormElement().addEventListener("change",function(){e.publishDebounceFieldChangeEvent()})}needsValueUpdateOnRefresh(){return!0}calculateNewValue(e,t,i){let a=this.getDatePicker();if(void 0!==a){let r=this.getDateFormat(a);this._fieldConfiguration.validations.forEach(l=>{"minDate"===l.type||"maxDate"===l.type?a.set(l.type,this.getLimitDate(l)):"disabledDates"===l.type&&this.disableDates(l,e,t,a,r,i)})}return Promise.resolve()}getDatePicker(){let e=this.domField().querySelector("input");return this.getDatePickerInstance(e).flatpickrElement}disableDates(e,t,i,a,r){arguments.length>5&&void 0!==arguments[5]&&arguments[5];let l=[];if(e.options.date.isDisabledByWeekdayEnabled){let t={monday:1,tuesday:2,wednesday:3,thursday:4,friday:5,saturday:6,sunday:0};l.push(function(i){let a=!1;return e.options.date.disabledWeekdays.forEach(function(e){i.getDay()===t[e]&&(a=!0)}),a})}if(e.options.date.isDisabledByListEnabled){let t=e.options.date.disabledDatelist.split(",").map(function(e){return e.trim()});l=l.concat(t)}if(e.options.date.isDisabledByFormulaEnabled){let i=f.A.calculate(e.calculation,t,"disabled date validation");l=l.concat(i)}a.set("dateFormat","Y-m-d"),a.set("disable",l),a.set("dateFormat",r)}getDateFormat(e){return e.config.dateFormat}getLimitDate(e){let t=this,i=null;if("today"===e.options.date.mode)i="today";else if("fixDate"===e.options.date.mode)i=new Date(e.options.date.fixDate);else if("fieldPlusX"===e.options.date.mode){let a=t.configuratorPlugin.fields.find(t=>t.config.id===e.options.date.plusXFieldId);void 0!==a&&(i=a.getDatePicker().latestSelectedDateObj)}else"todayPlusX"===e.options.date.mode&&(i=new Date);if(null!=i&&("todayPlusX"===e.options.date.mode||"fieldPlusX"===e.options.date.mode)){let t=e.options.date.plusX;"weeks"===e.options.date.plusXType?t*=7:"months"===e.options.date.plusXType?t*=30:"years"===e.options.date.plusXType&&(t*=365),i=i.fp_incr(t)}return i}getDatePickerInstance(e){return PluginManager.getPluginInstanceFromElement(e,"DatePicker")}}class R extends I{getDefaultValue(){return"number"===this.config.options.calculationResultFormat?0:""}price(){return 0}value(){if(this.isDefaultValueNeeded())return this.getDefaultValue();let e=this.domField().querySelector('input[type="hidden"]').value;return"number"===this.config.options.calculationResultFormat&&(e=parseFloat(e)),e}setValue(e){return this.domField().querySelector(".neonConfigurator__field__value").innerHTML=e,this.removeUntouchedClass(),Promise.resolve()}needsValueUpdateOnRefresh(){return!0}calculateNewValue(e,t,i){let a=this;if(null!==this._fieldConfiguration.options.commoncalculation&&void 0!==this._fieldConfiguration.options.commoncalculation&&null!==this._fieldConfiguration.options.commoncalculation.calculation){let e=i[this._fieldConfiguration.options.commoncalculation.key];return a.setHiddenField(e),a.setValue(a.formatCalculationResult(e))}return Promise.resolve()}formatCalculationResult(e){return e=this.formatNumber(e),this._fieldConfiguration.options.afterLabel&&(e+=" "+this._fieldConfiguration.options.afterLabel),e}setHiddenField(e){this.domField().querySelector('input[type="hidden"]').value=this.formatForInternalUse(e)}formatNumber(e){let t=this;return"number"===this.config.options.calculationResultFormat&&(this.numberFormater=new Intl.NumberFormat(document.documentElement.getAttribute("lang")||"de-DE",{minimumFractionDigits:this.config.options.calculationResultDecimalPlaces,maximumFractionDigits:this.config.options.calculationResultDecimalPlaces}),e=this.numberFormater.format(e)),"price"===this.config.options.calculationResultFormat&&(e=this._convertTaxMode(e),e=s.formatPrice(e,t.configuratorPlugin.decimalSign,t.configuratorPlugin.thousandSeparator,t.configuratorPlugin.decimalDigitCount)),e}_convertTaxMode(e){let t=this.config.options.calculationResultTaxMode,i=this.configuratorPlugin.options.configuration.priceEnterMode,a=1+this.configuratorPlugin.options.product.taxRate/100;return t&&t!==i?"net"===t&&("gross"===i||"manual"===i)?e/a:"gross"===t&&"net"===i?e*a:e:e}formatForInternalUse(e){return"number"===this.config.options.calculationResultFormat&&(this.numberFormater=new Intl.NumberFormat("en-US",{minimumFractionDigits:this.config.options.calculationResultDecimalPlaces,maximumFractionDigits:this.config.options.calculationResultDecimalPlaces}),e=this.numberFormater.format(e).replace(/,/g,"")),e}getUrlConfig(){return null}registerEventHandler(){}}var O=i(860);class $ extends I{constructor(e,t,i,a,r){super(e,t,i,a,r),this.forbiddenKeyCodes=[],this.subconfigurations=[],this.initValueSearch()}initValueSearch(){let e;let t=this.el.querySelector("[data-neon-configurator-value-search]");if(!t)return;let i=this;this._valueSearchContainer=t,this._valueSearchInput=t.querySelector('input[type="search"]'),this._valueSearchClear=t.querySelector("[data-neon-configurator-value-search-clear]"),this._valueSearchStatus=t.querySelector("[data-neon-configurator-value-search-status]"),this._valueSearchNoResults=t.querySelector("[data-neon-configurator-value-search-noresults]"),this._valueSearchUrl=t.dataset.neonConfiguratorValueSearchUrl,this._valueSearchRequestSeq=0,this._valueSearchReopenedGroups=null,this._valueSearchInput.addEventListener("input",function(){clearTimeout(e),e=setTimeout(()=>i.performValueSearch(),400)}),this._valueSearchInput.addEventListener("keydown",function(t){"Enter"===t.key&&(t.preventDefault(),clearTimeout(e),i.performValueSearch())}),this._valueSearchClear.addEventListener("click",function(){i._valueSearchInput.value="",i.resetValueSearch()})}async performValueSearch(){let e=this._valueSearchInput.value.trim();if(0===e.length){this.resetValueSearch();return}if(e.length<2)return;let t=++this._valueSearchRequestSeq;try{let i=await fetch(this._valueSearchUrl+"?search="+encodeURIComponent(e),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)throw Error("Value search failed with status "+i.status);let a=await i.json();if(t!==this._valueSearchRequestSeq)return;this.applyValueSearchResult(new Set(a.valueIds),e)}catch(e){t===this._valueSearchRequestSeq&&this.resetValueSearch(),console.error("Value search failed for field "+this.id,e)}}valueSearchTileMatches(e,t,i){if(t.has(e.dataset.neonConfiguratorValueId))return!0;let a=e.querySelector("label"),r=(a?a.textContent:e.textContent).toLowerCase();return i.every(e=>r.includes(e))}applyValueSearchResult(e,t){let i=t.toLowerCase().split(/\s+/).filter(
1Boolean),a=this.el.querySelector("[data-field-value-wrapper]")||this.el;this.el.classList.add("neonConfigurator__field--valueSearchActive"),null===this._valueSearchReopenedGroups&&(this._valueSearchReopenedGroups=Array.from(a.querySelectorAll(".neonConfigurator__field__valueGroup--closed")),this._valueSearchReopenedGroups.forEach(e=>e.classList.remove("neonConfigurator__field__valueGroup--closed")));let r=0;a.querySelectorAll(".neonConfigurator__field__value").forEach(t=>{let a=this.valueSearchTileMatches(t,e,i);t.classList.toggle("neonConfigurator__field__value--searchHidden",!a),a&&(r+=1)});let l=1===r?this._valueSearchContainer.dataset.neonConfiguratorValueSearchCountTextSingular:this._valueSearchContainer.dataset.neonConfiguratorValueSearchCountText;this._valueSearchStatus.textContent=l.replace("%count%",r),this._valueSearchStatus.hidden=!1,this._valueSearchNoResults.hidden=0!==r,this._valueSearchClear.hidden=!1}resetValueSearch(){this._valueSearchRequestSeq+=1;let e=this.el.querySelector("[data-field-value-wrapper]")||this.el;this.el.classList.remove("neonConfigurator__field--valueSearchActive"),e.querySelectorAll(".neonConfigurator__field__value--searchHidden").forEach(e=>e.classList.remove("neonConfigurator__field__value--searchHidden")),null!==this._valueSearchReopenedGroups&&(this._valueSearchReopenedGroups.forEach(e=>e.classList.add("neonConfigurator__field__valueGroup--closed")),this._valueSearchReopenedGroups=null),this._valueSearchStatus.hidden=!0,this._valueSearchNoResults.hidden=!0,this._valueSearchClear.hidden=!0}isDefaultValueNeeded(){return super.isDefaultValueNeeded()||0===this.getCheckedDomFields().length}getDefaultValue(){return this.config.options.isMultiselect?[]:""}value(){let e=this,t=this.getCheckedDomFields();if(this.isDefaultValueNeeded())return this.getDefaultValue();if(!this.config.options.isMultiselect)return t[0].value;{let i=[];
1return t.forEach(function(t){let a=t.closest(".neonConfigurator__field__value").dataset.neonConfiguratorValueId,r=e.getPriceOfValue(a);if(e._fieldConfiguration.options.isQuantitySelectionActive){let l=e.userQuantityOfValue(a);l>0&&i.push({value:t.value,quantity:l,price:r,configuration:e.getSubconfiguration(a)})}else{let l={value:t.value,price:r},n=e.getSubconfiguration(a);void 0!==n&&(l.configuration=n);let o=e.getQuantityDomFields(a);if(o&&o.length>0){let e=o[0];l.quantity=parseInt(e.value||1),o.forEach(e=>{"INPUT"===e.tagName?e.value=l.quantity:e.innerHTML=l.quantity})}else l.quantity=1;i.push(l)}}),i}}price(){let e=this,t=0;if(!e.isVisible())return t;let i=e.value();return!e.arePricesLoaded()&&e.loadedPrices?t=e.config.options.isMultiselect?e.loadedPrices.reduce((e,t)=>parseFloat((t.price+"").replace(",","."))+e,0):e.loadedPrices.filter(e=>e.value===i)[0].price:e._fieldConfiguration.valueGroups.forEach(function(a){a.values.forEach(function(a){Array.isArray(i)?e.value().forEach(function(i){a.value!==i.value||e.isPriceEmpty(a)||(t+=parseFloat(a.price.replace(",","."))*e.userQuantityOfValue(a.id))}):a.value!==i||(a.usePriceFromLinkedProductConfiguration?t=void 0!==e.getSubconfiguration(a.id)?e.getSubconfiguration(a.id).price:0:e.isPriceEmpty(a)||(t=parseFloat(a.price.replace(",","."))))})}),parseFloat((t+"").replace(",","."))}arePricesLoaded(){let e=this;if(0===e._fieldConfiguration.valueGroups.length)return!0;let t=e._fieldConfiguration.valueGroups[0];return!(""!==e.value()&&e.value().length>0&&(0===t.values.length||1===t.values.length&&t.values[0].value!==e.value())&&e._fieldConfiguration.isModalSelection&&e._fieldConfiguration.isModalUseAjax)}registerEventHandler(){let e=this;this._$modalTrigger=this.domField().querySelector("[data-neon-configurator-modalselection]"),this._fieldConfiguration.isModalSelection&&this._fieldConfiguration.options.isQuantitySelectionActive&&this.syncCheckedStateWithQuantities(),this.updateModalTriggerLabel(),this.domField().addEventListener("change",function(t){let i=t.target.closest(".neonConfigurator__field__value").dataset.neonConfiguratorValueId;e.enableOrDisableQuantityFields(i),e.ensureImagesLoaded(),e.updateModalTriggerLabel(),e.publishDebounceFieldChangeEvent()}),this._$modalTrigger&&this._$modalTrigger.addEventListener("click",function(t){if(t.preventDefault(),"true"===this.dataset.neonConfiguratorModalAjax){let t=this.dataset.neonConfiguratorModalAjaxUrl,i={htmlFieldId:this.dataset.neonHtmlFieldId,uniqueConfigurationId:this.dataset.neonUniqueConfigurationId};e.domField().querySelector(".neonConfigurator__field__input").classList.add("loading");let a=e.value();e.config.options.isMultiselect&&(a=a.map(e=>e.value).join(",")),e.showTriggerLoading(e._$modalTrigger),e.getFieldContent(t,i).then(t=>{let i=e._fieldConfiguration.isModalSelection,r=e._fieldConfiguration.isModalUseAjax,l=new DOMParser().parseFromString(t,"text/html"),n=l.querySelector("[data-neon-configurator-field-config]");e._fieldConfiguration=JSON.parse(n.dataset.neonConfiguratorFieldConfig),e._fieldConfiguration.isModalSelection=i,e._fieldConfiguration.isModalUseAjax=r;let o=l.querySelectorAll(".neonConfigurator__field__values");Array.from(e.domField().querySelectorAll(".neonConfigurator__field__values")).forEach((e,t)=>{e.innerHTML=o[t]?.innerHTML||""}),e._fieldConfiguration.options.isQuantitySelectionActive&&e.syncCheckedStateWithQuantities(),e.setValue(a,!1).then(()=>{e.setFieldNameAttribute(),e.domField().querySelectorAll(".neonConfigurator__field__input").forEach(e=>{e.classList.remove("loading")}),e._$modalTrigger.dataset.neonConfiguratorModalAjax="false",e._fieldConfiguration.options.isQuantitySelectionActive&&e.syncCheckedStateWithQuantities();let t=e.domField().cloneNode(!0);e.openModal(t).then(()=>{e.hideTriggerLoading(e._$modalTrigger);let t=document.querySelector(".js-pseudo-modal");e.initModalSearch(t),e.initModalPropertyFilter(t)})})})}else{e._fieldConfiguration.options.isQuantitySelectionActive&&e.syncCheckedStateWithQuantities();let t=e.domField().cloneNode(!0);e.openModal(t).then(()=>{let t=document.querySelector(".js-pseudo-modal");e.initModalSearch(t),e.initModalPropertyFilter(t)})}})}getFieldContent(e,t){return fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(t)}).then(e=>e.text())}showTriggerLoading(e){e.disabled=!0,e._originalText=e.innerHTML;let t=e.dataset.neonConfiguratorModalLoadingText||"";e.innerHTML='<span class="spinner-border spinner-border-sm me-2" role="status" aria-hidden="true"></span>'+t}hideTriggerLoading(e){e.disabled=!1,e._originalText&&(e.innerHTML=e._originalText),this.updateModalTriggerLabel()}updateModalTriggerLabel(){let e=this._$modalTrigger;if(!e)return;let t=e.querySelector("[data-neon-configurator-modal-label]");if(!t)return;let i=this.hasSelectedValue(),a=i?e.dataset.neonConfiguratorModalLabelSelected:e.dataset.neonConfiguratorModalLabelEmpty;void 0!==a&&t.textContent!==a&&(t.textContent=a),e.classList.toggle("neonConfigurator__field__modalSelection--hasSelection",i)}publishFieldChangeEvent(){this.updateModalTriggerLabel(),super.publishFieldChangeEvent()}hasSelectedValue(){return null!==this.domField().querySelector("[data-neon-configurator-field-value]:checked")}openModal(e){let t=this;if(t.config.options.isMultiselect){let t=document.createElement("div");t.className="neonConfigurator__modalSelection__footer",t.innerHTML='<div class="btn btn-primary">OK</div>',e.appendChild(t)}let i=document.createElement("div");return i.style.display="contents",i.className=`neonConfigurator--modal neonConfigurator--${t.configuratorPlugin.options.configuration.id}`,i.appendChild(e),new Promise(e=>{let a=new O.A(i.outerHTML,!0);a.open(function(){let i=a.getModal();
1i.querySelectorAll("img").forEach(e=>{e.dataset.srcset&&!e.getAttribute("srcset")&&(e.srcset=e.dataset.srcset),e.dataset.src&&!e.getAttribute("src")&&(e.src=e.dataset.src)}),i.querySelectorAll(".neonConfigurator__field__value").forEach(e=>{let t=e.querySelector("label"),i=e.querySelector("[data-neon-configurator-field-value]");t.getAttribute("for")?(t.setAttribute("for",`${t.getAttribute("for")}_modal`),i.id=t.getAttribute("for")):(i.id=`${i.id}_modal`,t.setAttribute("for",i.id))});let r=function(e){let i=e.id.replace("_modal",""),a=document.getElementById(i);if(a.closest(".neonConfigurator__field__value").querySelectorAll("img").forEach(e=>{e.dataset.srcset&&!e.srcset?e.srcset=e.dataset.srcset:e.dataset.src&&!e.src&&(e.src=e.dataset.src),!e.src&&e.dataset.src&&(e.src=e.dataset.src)}),t._fieldConfiguration.options.isQuantitySelectionActive){let t=e.closest(".neonConfigurator__field__value"),i=a.closest(".neonConfigurator__field__value"),r=t.querySelector(".js-quantity-selector"),l=i.querySelector(".js-quantity-selector");if(r&&l){let e=parseInt(r.value);l.value=r.value,a.checked=e>0;let t=i.querySelector(".neonConfigurator__quantityLabel");if(e>0){if(!t){(t=document.createElement("span")).className="neonConfigurator__quantityLabel";let e=i.querySelector(".neonConfiguratorImageField__value__label__text__content, .neonConfiguratorButtonField__value__label");e&&e.parentNode.insertBefore(t,e)}t.textContent=e+" x "}else t&&t.remove()}}else a.checked=e.checked},l=function(e){let i=e.id.replace("_modal",""),a=document.getElementById(i);if(t._fieldConfiguration.options.isQuantitySelectionActive){let t=e.closest(".neonConfigurator__field__value"),i=a.closest(".neonConfigurator__field__value"),r=t.querySelector(".js-quantity-selector"),l=i.querySelector(".js-quantity-selector");r&&l&&(r.value=l.value,e.checked=parseInt(l.value)>0)}else e.checked=a.checked};i.querySelectorAll(t.getDomInputField()).forEach(e=>{l(e)}),t.config.options.isMultiselect?i.querySelector(".neonConfigurator__modalSelection__footer .btn-primary").addEventListener("click",function(){i.querySelectorAll(t.getDomInputField()).forEach(e=>{r(e)}),t.updateModalTriggerLabel(),t.hideModalDialog(a),t.publishDebounceFieldChangeEvent()}):i.querySelectorAll(t.getDomInputField()).forEach(e=>{e.addEventListener("change",function(e){r(e.target),t.updateModalTriggerLabel(),t.hideModalDialog(a),t.publishDebounceFieldChangeEvent()})});let n=i.querySelector(".neonConfigurator__field__label__inlineContent");n&&a._setModalTitle(n.textContent.replace(":","")),window.PluginManager.initializePlugins().then(()=>{Array.from(document.querySelectorAll('[data-bs-toggle1="tooltip"]')).forEach(e=>{new bootstrap.Tooltip(e)}),e()})})})}initModalSearch(e){let t;let i=e.querySelector("[data-neon-configurator-modalsearch]");if(!i)return;let a=this;this._modalSearchTerm="";let r=i.querySelector('input[type="search"]'),l=i.querySelector('button[type="submit"]'),n=()=>{a._modalSearchTerm=r.value.toLowerCase(),a.applyModalFilters(e)};r.addEventListener("input",function(){clearTimeout(t),t=setTimeout(n,500)}),r.addEventListener("keydown",function(e){"Enter"===e.key&&(e.preventDefault(),n())}),l.addEventListener("click",function(e){e.preventDefault(),n()})}initModalPropertyFilter(e){let t=e.querySelector("[data-neon-configurator-modalpropertyfilter]");if(!t)return;let i=this;this._modalActiveFacets=new Map;let a=new Map;if(e.querySelectorAll(".neonConfigurator__field__value").forEach(e=>{this.parseValueProperties(e).forEach(e=>{a.has(e.groupId)||a.set(e.groupId,{name:e.groupName,options:new Map});let t=a.get(e.groupId);e.options.forEach(e=>{t.options.has(e.id)||t.options.set(e.id,{name:e.name,position:e.position??null})})})}),0===a.size){t.classList.add("neonConfigurator__field__modalPropertyFilter--empty");return}t.classList.remove("neonConfigurator__field__modalPropertyFilter--empty");let r="neonConfigurator__field__modalPropertyFilter",l=t.querySelector("[data-neon-configurator-modalpropertyfilter-toggle]"),n=t.querySelector("[data-neon-configurator-modalpropertyfilter-body]"),o=t.querySelector("[data-neon-configurator-modalpropertyfilter-groups]");this._modalPropertyCheckboxes=[],this._modalPropertyGroupEls=[],this._modalPropertyResetButton=t.querySelector("[data-neon-configurator-modalpropertyfilter-reset]"),this._modalPropertyNoResults=t.querySelector("[data-neon-configurator-modalpropertyfilter-noresults]");let s=t.querySelector("[data-neon-configurator-modalpropertyfilter-promoted]"),u=t.dataset.neonConfiguratorModalpropertyfilterPromotedGroup;if(this._modalPromotedGroupId=s&&u&&a.has(u)?u:null,this._modalPromotedButtons=[],l&&n&&!l._neonToggleBound&&
1(l._neonToggleBound=!0,l.addEventListener("click",function(){let e="true"===l.getAttribute("aria-expanded");l.setAttribute("aria-expanded",e?"false":"true"),l.classList.toggle("collapsed",e),n.hidden=e})),this._modalPropertyResetButton&&!this._modalPropertyResetButton._neonResetBound&&(this._modalPropertyResetButton._neonResetBound=!0,this._modalPropertyResetButton.addEventListener("click",function(){i.resetModalPropertyFilter(e)})),this._modalPromotedGroupId){let t=a.get(this._modalPromotedGroupId);s.innerHTML="",Array.from(t.options.entries()).sort((e,t)=>{let i=e[1].position??Number.MAX_SAFE_INTEGER,a=t[1].position??Number.MAX_SAFE_INTEGER;return i!==a?i-a:e[1].name.localeCompare(t[1].name,void 0,{sensitivity:"base"})}).forEach(t=>{let[a,l]=t,n=document.createElement("button");n.type="button",n.className=`${r}__promoted__option btn`,n.dataset.optionId=a,n.textContent=l.name,n.addEventListener("click",function(){i.togglePromotedOption(e,a)}),s.appendChild(n),i._modalPromotedButtons.push(n)})}let c=Array.from(a.keys()).some(e=>e!==this._modalPromotedGroupId);l&&(l.hidden=!c),n&&!c&&(n.hidden=!0),o&&(o.innerHTML="",a.forEach((t,a)=>{if(a===i._modalPromotedGroupId)return;let l=document.createElement("div");l.className=`${r}__group`;let n=document.createElement("div");n.className=`${r}__group__title`,n.textContent=t.name,l.appendChild(n);let s=document.createElement("div");s.className=`${r}__group__options`,Array.from(t.options.entries()).sort((e,t)=>e[1].name.localeCompare(t[1].name,void 0,{sensitivity:"base"})).forEach(t=>{let[l,n]=t,o=document.createElement("label");o.className=`${r}__option`;let u=document.createElement("input");u.type="checkbox",u.className=`${r}__option__input form-check-input`,u.value=l;let c=document.createElement("span");c.className=`${r}__option__label`,c.textContent=n.name,u.addEventListener("change",function(){i.updateActiveFacet(a,l,u.checked),o.classList.toggle(`${r}__option--active`,u.checked),i.applyModalFilters(e)}),o.appendChild(u),o.appendChild(c),s.appendChild(o),i._modalPropertyCheckboxes.push({input:u,label:o,groupId:a})}),l.appendChild(s),o.appendChild(l),i._modalPropertyGroupEls.push({groupId:a,el:l})}))}togglePromotedOption(e,t){let i=this._modalPromotedGroupId;if(!i)return;this._modalActiveFacets||(this._modalActiveFacets=new Map);let a=this._modalActiveFacets.get(i),r=!!a&&a.has(t);this._modalActiveFacets.delete(i),r||this.updateActiveFacet(i,t,!0);let l="neonConfigurator__field__modalPropertyFilter__promoted__option--active";(this._modalPromotedButtons||[]).forEach(e=>{e.classList.toggle(l,!r&&e.dataset.optionId===t)}),this.applyModalFilters(e)}resetModalPropertyFilter(e){this._modalActiveFacets=new Map;let t="neonConfigurator__field__modalPropertyFilter";(this._modalPropertyCheckboxes||[]).forEach(e=>{let{input:i,label:a}=e;i.checked=!1,a.classList.remove(`${t}__option--active`)}),(this._modalPromotedButtons||[]).forEach(e=>{e.classList.remove(`${t}__promoted__option--active`)}),this.applyModalFilters(e)}parseValueProperties(e){if(void 0!==e._neonValueProperties)return e._neonValueProperties;let t=[],i=e.dataset.neonConfiguratorValueProperties;if(i)try{t=JSON.parse(i)||[]}catch(e){t=[]}return e._neonValueProperties=t,t}updateActiveFacet(e,t,i){this._modalActiveFacets||(this._modalActiveFacets=new Map);let a=this._modalActiveFacets.get(e);a||(a=new Set,this._modalActiveFacets.set(e,a)),i?a.add(t):a.delete(t),0===a.size&&this._modalActiveFacets.delete(e)}applyModalFilters(e){let t=this._modalSearchTerm||"",i=t?RegExp(t,"i"):null,a=e.querySelectorAll(".neonConfigurator__field__value");this.narrowFilterOptionsToPromotedSelection(a,i);let r=this._modalActiveFacets||new Map,l=0;a.forEach(e=>{let t=!0;if(i){let a=e.querySelector("label");a&&i.test(a.textContent)||(t=!1)}if(t&&r.size>0){let i=this.parseValueProperties(e),a=new Map;for(let[e,l]of(i.forEach(e=>{a.set(e.groupId,new Set(e.options.map(e=>e.id)))}),r)){if(0===l.size)continue;let i=a.get(e),r=!1;if(i){for(let e of l)if(i.has(e)){r=!0;break}}if(!r){t=!1;break}}}e.style.display=t?"":"none",t&&(l+=1)}),this._modalPropertyResetButton&&(this._modalPropertyResetButton.hidden=0===r.size),this._modalPropertyNoResults&&(this._modalPropertyNoResults.hidden=0!==l)}narrowFilterOptionsToPromotedSelection(e,t){let i="neonConfigurator__field__modalPropertyFilter",a=this._modalPromotedGroupId,r=a?(this._modalActiveFacets||new Map).get(a):null,l=this._modalPropertyCheckboxes||[],n=this._modalPropertyGroupEls||[];
1if(!r||0===r.size){l.forEach(e=>{let{label:t}=e;t.hidden=!1}),n.forEach(e=>{let{el:t}=e;t.hidden=!1});return}let o=new Set;e.forEach(e=>{if(t){let i=e.querySelector("label");if(!i||!t.test(i.textContent))return}let i=this.parseValueProperties(e),l=i.find(e=>e.groupId===a);l&&l.options.some(e=>r.has(e.id))&&i.forEach(e=>{e.groupId!==a&&e.options.forEach(e=>{o.add(e.id)})})}),l.forEach(e=>{let{input:t,label:a,groupId:r}=e,l=o.has(t.value);a.hidden=!l,!l&&t.checked&&(t.checked=!1,a.classList.remove(`${i}__option--active`),this.updateActiveFacet(r,t.value,!1))}),n.forEach(e=>{let{groupId:t,el:i}=e,a=l.some(e=>e.groupId===t&&!e.label.hidden);i.hidden=!a})}hideModalDialog(e){if(void 0!==e.close){e.close();try{e._modalInstance.hide()}catch(e){}}}getUrlConfig(){return{key:this.config.key+(this.config.parentId?"["+this.domField().dataset.neonConfiguratorFieldRepeatIndex+"]":""),value:this.config.options.isMultiselect?this.value().map(e=>e.value):this.value()}}valueLabel(){let e=this.getCheckedDomFields();if(this.isDefaultValueNeeded())return"";if(0===e.length)return this.config.options.isMultiselect?[]:"";if(!this.config.options.isMultiselect)return e[0].dataset.label;{let t=[];return e.forEach(function(e){t.push(e.dataset.label)}),t}}attributes(){let e=this,t={};return this.config.fieldvalueAttributes.forEach(function(e){"string"===e.dataType?t[e.key]=e.defaultValue??"":"number"===e.dataType&&(t[e.key]=parseFloat(null==e.defaultValue?0:(e.defaultValue+"").replace(",",".")))}),e.isVisible()&&this.config.valueGroups.forEach(function(i){i.values.forEach(function(i){i.value===e.value()&&Object.values(i.attributes).forEach(function(e){t[e.key]=e.content})})}),t}reset(){this.domField().querySelectorAll(this.getDomInputField()).forEach(e=>{e.checked=!1}),this.domField().querySelectorAll(".js-quantity-selector").forEach(e=>{e.value=0}),super.reset()}setValue(e){let t,i=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=this;t=a.config.options.isMultiselect?e.split(","):[e];let r=!1;return new Promise(t=>{if(!r&&a._fieldConfiguration.isModalSelection&&a._fieldConfiguration.isModalUseAjax){let r;fetch(r=i?a._$modalTrigger.dataset.neonConfiguratorModalAjaxRendervalueUrl.replace("_VALUESTORENDER_",e):a._$modalTrigger.dataset.neonConfiguratorModalAjaxRendervalueUrl.replace("_VALUESTORENDER_","")).then(e=>e.text()).then(e=>{a.domField().querySelector("[data-field-value-wrapper]").innerHTML=e,t()})}else t()}).then(()=>{let e=this.domField().querySelectorAll(this.getDomInputField());a.domField().querySelectorAll("img").forEach(function(e){void 0===e.dataset.srcset||e.srcset?void 0===e.dataset.src||e.src||(e.src=e.dataset.src):e.srcset=e.dataset.srcset}),t.forEach(function(t){let i=t??"";e.forEach(function(e){if(e.value===i){r=!0;let t=e.closest(".neonConfigurator__field__value").dataset.neonConfiguratorValueId;
1a.enableOrDisableQuantityFields(t),e.closest(".neonConfigurator__field__value").querySelectorAll("img").forEach(function(e){void 0!==e.dataset.srcset?e.srcset=e.dataset.srcset:void 0!==e.dataset.src&&(e.src=e.dataset.src)}),e.checked=!0}})})})}changeValueOptionsVisibility(e,t,i,a){a?"hidden"===i.options.visibilityRules?t.style.display="":"disabled"===i.options.visibilityRules&&(e.disabled=!1,t.classList.remove("neonConfigurator__field--disabled"),t.querySelectorAll("input, select, textarea").forEach(e=>{e.disabled=!1})):"hidden"===i.options.visibilityRules?t.style.display="none":"disabled"===i.options.visibilityRules&&(e.disabled=!0,t.classList.add("neonConfigurator__field--disabled"),t.querySelectorAll("input, select, textarea").forEach(e=>{e.disabled=!0}))}changeValueVisibility(e,t){let i=this,a=this.domField().querySelector('input[value="'+e.value+'"]'),r=a.closest(".neonConfigurator__field__value"),l=[];return e.options.visibilityRules||(e.options.visibilityRules="hidden"),this.changeValueOptionsVisibility(a,r,e,t),!t&&a.checked&&(i.domField().querySelectorAll(".neonConfigurator__field__value input").forEach(e=>{e.checked=!1}),i.config.valueGroups.forEach(function(e){e.values.forEach(function(e){e.isDefault&&l.push(i.setValue(e.value))})})),Promise.all(l).then(()=>t)}afterVisibilityChanged(){let e=this,t=[];if(e.isVisible()&&e.config.options.isFirstVisibleValueDefault&&e.hasValues()&&!1===e.isValueSelected()){let i=!1;e.config.valueGroups.forEach(function(a){a.values.forEach(function(a){let r=e.domField().querySelector('.neonConfigurator__field__value:not(.neonConfigurator__field--disabled)[data-neon-configurator-value-id="'+a.id+'"]');!i&&r&&"none"!==r.style.display&&(t.push(e.setValue(a.value)),i=!0)})})}return Promise.all(t)}isValueSelected(){let e=this;return e.domField().querySelectorAll("input:checked").length>0}hasValues(){return!0}visibleValueCount(){let e=this.domField().querySelectorAll(".neonConfigurator__field__value"),t=0;return e.forEach(function(e){"none"!==e.style.display&&t++}),t}userQuantityOfValue(e){let t=this.domField().querySelector('[data-neon-configurator-value-id="'+e+'"]').querySelector(".js-quantity-selector");return t?parseInt(t.value):1}getPriceOfValue(e){let t=this,i=0;return t.loadedPrices?i=t.loadedPrices.filter(t=>t.value===e)[0].price:t._fieldConfiguration.valueGroups.forEach(function(a){a.values.forEach(function(a){if(a.id===e){let e=t.getSubconfiguration(a.id);i=void 0!==e?e.price:a.price}})}),parseFloat((i+"").replace(",","."))*t.configuratorPlugin.taxFactor}quantity(){let e=this,t=0;if(!e.isVisible())return t;let i=e.value();if(Array.isArray(i))i.forEach(function(e,i){void 0!==e.quantity&&(t+=parseInt(e.quantity))});else{let i=e.getCheckedDomFields();if(1===i.length){let a=i[0].closest(".neonConfigurator__field__value").dataset.neonConfiguratorValueId,r=e.getQuantityDomFields(a);if(r&&r.length>0){let e=Array.from(r).find(e=>"INPUT"===e.tagName);t=e?parseInt(e.value||1):1}else t=1}}return t}getQuantityFields(){return this.domField().querySelectorAll(".js-quantity-selector")}getValueForUniqueIdHash(){let e=this,t="";return e.isVisible()&&e._fieldConfiguration.options.isQuantitySelectionActive&&e.getQuantityFields().forEach(function(e){t+=e.value+";"}),JSON.stringify(this.value())+t}isPriceEmpty(e){return void 0===e.price||null==e.price||""===e.price||"0"===e.price}getDomInputField(){return"[data-neon-configurator-field-value]"}getCheckedDomFields(){var e=[];return this.domField().querySelectorAll(this.getDomInputField()).forEach(function(t){t.checked&&e.push(t)}),e}async callbackBeforeUpdate(e){let t=this;if(!t.arePricesLoaded()){let e={method:"GET",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}};if(t.config.options.isMultiselect){let i=await fetch("/widgets/configurator/ajax/getPricesOfValues/"+t.value().map(e=>e.value).join(",")+"/field/"+t._fieldConfiguration.id+"/product/"+t.configuratorPlugin.options.product.id,e),a=await i.json();t.loadedPrices=a.prices}else{let i=await fetch("/widgets/configurator/ajax/getPriceOfValue/"+t.value()+"/field/"+t._fieldConfiguration.id+"/product/"+t.configuratorPlugin.options.product.id,e),a=await i.json();t.loadedPrices=a.prices}}}async callbackBeforeUpdateSubcalculationAware(e){return this.updateProductQuantityIfNecessary(e)}updateProductQuantityIfNecessary(e){let t=this,i=[];return t._fieldConfiguration.valueGroups.forEach(function(a){a.values.forEac
1h(function(a){a.hasProduct&&i.push(t.updateValueProductQuantity(a,e))})}),Promise.all(i)}updateValueProductQuantity(e,t){let i=this.configuratorPlugin.getQuantity();return null!==e.productQuantityCalculation&&(null!==e.productQuantityCalculation.stringFormula||null!==e.productQuantityCalculation.jsonFormula)&&(i=f.A.calculate(e.productQuantityCalculation,t,"Value Product Quantity")),i.then(t=>{let i=this.getQuantityDomFields(e.id);this.getPriceDisplayFieldIfAbsolute(e.id),i&&i.length>0&&(null===t?i.forEach(e=>{"INPUT"!==e.tagName&&(e.style.display="none")}):i.forEach(e=>{"INPUT"===e.tagName?e.value=t:(e.style.display="",e.innerHTML=t)}))})}getPriceDisplayFieldIfAbsolute(e){return this.domField()?.querySelector('[data-neon-configurator-value-id="'+e+'"]')?.querySelector('.neonConfigurator__price[data-neon-configurator-field-value-price-display="absolute"]')}getQuantityDomFields(e){return this.domField()?.querySelector('[data-neon-configurator-value-id="'+e+'"]')?.querySelectorAll("[data-neon-configurator-field-value-product-quantity]")}getAllQuantityDomField(){return this.domField().querySelectorAll("input[data-neon-configurator-field-value-product-quantity]")}enableOrDisableQuantityFields(e){let t=this;t.disableAllQuantityFields();let i=t.getQuantityDomFields(e);i&&i.length>0&&i.forEach(e=>{"INPUT"===e.tagName&&(e.disabled=!1)})}disableAllQuantityFields(){let e=this;e.getAllQuantityDomField().forEach(function(e){e.disabled=!0})}setSubconfiguration(e,t){this.subconfigurations[e]=t,this.updateCurrentSubconfigurationInUi(e)}updateCurrentSubconfigurationInUi(e){let t=this;t.getCheckedDomFields().forEach(function(i){let a=Object.values(t.subconfigurations[e].fields).map(function(e){return"<strong>"+e.label+"</strong>: "+e.value});i.closest(".neonConfigurator__field__value").querySelector("[data-neon-configurator-subconfiguration-currentstate]").innerHTML=a.join('<span class="divider"> | </span>')})}getSubconfiguration(e){return this.subconfigurations[e]}getAllSubconfigurations(){let e=this,t=null;if(!e.config.options.isMultiselect){let i=null;e.getCheckedDomFields().forEach(function(e){i=e.closest(".neonConfigurator__field__value").dataset.neonConfiguratorValueId}),t=null!==i&&void 0!==this.subconfigurations[i]?this.subconfigurations[i]:null}return t}syncCheckedStateWithQuantities(){this.domField().querySelectorAll(".neonConfigurator__field__value").forEach(e=>{let t=e.querySelector("[data-neon-configurator-field-value]"),i=e.querySelector(".js-quantity-selector");t&&i&&(t.checked=parseInt(i.value)>0)})}ensureImagesLoaded(){let e=this;e.domField().querySelectorAll("img").forEach(function(e){e.dataset.srcset&&!e.srcset?e.srcset=e.dataset.srcset:e.dataset.src&&(!e.src||e.src===location.href)&&(e.src=e.dataset.src)}
1),e.getCheckedDomFields().forEach(function(e){e.closest(".neonConfigurator__field__value").querySelectorAll("img").forEach(function(e){e.dataset.src&&(!e.src||e.src===location.href)&&(e.src=e.dataset.src),e.dataset.srcset&&!e.srcset&&(e.srcset=e.dataset.srcset)})})}}class U extends ${}class j extends ${}class B extends I{constructor(e,t,i,a,r){super(e,t,i,a,r),this.$productQuantity=null,this.$valueInitCache=0,this.noSelectElement=!1,this.domField().querySelector("select")&&(this.$valueInitCache=this.domField().querySelector("select").innerHTML,this.noSelectElement=!0)}getDefaultValue(){return null}value(){return this.isDefaultValueNeeded()?this.getDefaultValue():this.domField().querySelector("select").value}valueLabel(){let e=this.domField().querySelector("select option:checked");return this.isVisible()&&!this.isDisabled()&&null!==e?e.dataset.label:""}setValue(e){let t=e??"";return this.domField().querySelectorAll("select option").forEach(e=>{e.value===t?e.selected=!0:e.selected=!1}),Promise.resolve()}attributes(){let e={};return this.config.fieldvalueAttributes.forEach(t=>{"string"===t.dataType?e[t.key]=t.defaultValue??"":"number"===t.dataType&&(e[t.key]=parseFloat(null==t.defaultValue?0:(t.defaultValue+"").replace(",",".")))}),this.isVisible()&&this.config.valueGroups.forEach(t=>{t.values.forEach(t=>{t.value===this.value()&&Object.values(t.attributes).forEach(t=>{e[t.key]=t.content})})}),e}reset(){let e=this.domField().querySelector("select");e&&e.options.length>0&&(e.selectedIndex=0),super.reset()}changeValueVisibility(e,t){let i=this.domField().querySelector(`option[value="${e.value}"]`);return t?(i.style.display="",i.hidden=!1):i.remove(),Promise.resolve(t)}resetValueOptionsFromInitCache(){let e=this.domField().querySelector("select"),t=e,i=null;if(t.selectedIndex>=0&&t.options.length>0&&(i=t.options[t.selectedIndex].value),e.innerHTML=this.$valueInitCache,null!==i){let t=e.querySelector(`option[value="${i}"]`);t&&(t.selected=!0)}}afterVisibilityChanged(){if(!this.noSelectElement)return Promise.resolve();let e=this.domField().querySelector("select option:checked");if(null==e)return Promise.resolve();let t=[],i="none"===getComputedStyle(e).display;if(this.isVisible()&&this.config.options.isFirstVisibleValueDefault&&this.hasValues()&&i){let e=!1;this.domField().querySelectorAll("select option").forEach(t=>{e||(t.selected=!0,e=!0)})}return this.updateProductQuantityHint(),Promise.all(t)}hasValues(){return this.config.valueGroups.length>0&&this.config.valueGroups.reduce((e,t)=>e+t.values.length,0)>0}price(){let e=this,t=0;return e.isVisible()?(e._fieldConfiguration.valueGroups.forEach(function(i){i.values.forEach(function(i){if(i.value===e.value()){if(void 0===i.price||null==i.price||""===i.price||"0"===i.price)return 0;t=i.price}})}),parseFloat((t+"").replace(",","."))):0}getSelectedValueConfiguration(){let e=this.value();for(let t of this._fieldConfiguration.valueGroups){let i=t.values.find(t=>t.value===e);if(void 0!==i)return i}return null}async callbackBeforeUpdateSubcalculationAware(e){await this.updateProductQuantity(e),this.updateProductQuantityHint()}async updateProductQuantity(e){this.$productQuantity=null;let t=this.getSelectedValueConfiguration();if(null===t||!t.hasProduct||null==t.productQuantityCalculation||null===t.productQuantityCalculation.stringFormula&&null===t.productQuantityCalculation.jsonFormula)return;let i=parseInt(await f.A.calculate(t.productQuantityCalculation,e,"Value Product Quantity"));this.$productQuantity=i||1}updateProductQuantityHint(){let e=this.domField().querySelector("select");if(!e||(e.querySelectorAll("option").forEach(e=>{void 0!==e.dataset.neonConfiguratorOriginalText&&(e.textContent=e.dataset.neonConfiguratorOriginalText,delete e.dataset.neonConfiguratorOriginalText)}),null===this.$productQuantity))return;let t=e.querySelector("option:checked");null!==t&&(t.dataset.neonConfiguratorOriginalText=t.textContent,t.textContent=this.$productQuantity+" x "+t.textContent.trim())}quantity(){return this.isVisible()?this.$productQuantity??1:0}visibleValueCount(){let e=this.domField().querySelectorAll("select option"),t=0;
1return e.forEach(e=>{"none"!==getComputedStyle(e).display&&t++}),t}registerEventHandler(){this.domField().querySelector("select").addEventListener("change",()=>{this.publishDebounceFieldChangeEvent()})}}class H extends B{constructor(e,t,i,a,r){super(e,t,i,a,r),this._$rangeInputField=this.domField(),this._$rangeValuesField=this._el.querySelector(".range-values"),this._$rangeValueField=this._el.querySelector(".range-values > input"),this._$rangeValueTextField=this._el.querySelector(".range-value-text"),this.updateRangeInputField(),this.updateSliderLabel()}getDefaultValue(){return null}value(){return this.isDefaultValueNeeded()?this.getDefaultValue():this._$rangeValueField.value}valueLabel(){return this.isVisible()&&!this.isDisabled()?this._$rangeValueTextField.querySelector(".range-value-text-label").textContent:""}setValue(e){return this._$rangeValueField.value=e,this.updateRangeInputField(),this.updateSliderLabel(),Promise.resolve()}resetValueOptionsFromInitCache(){}visibleValueCount(){let e=this._$rangeValuesField.querySelectorAll("span[data-range-value]"),t=0;return e.forEach(e=>{"none"!==getComputedStyle(e).display&&t++}),t}changeValueVisibility(e,t){let i=this._$rangeValuesField.querySelector(`[data-range-value="${e.value}"]`);return t?(i.style.display="",i.hidden=!1,i.disabled=!1,this._$rangeInputField.disabled=!1):(i.style.display="none",i.hidden=!0,i.disabled=!0),this._$rangeValueField.value===e.value&&!1===t&&(this._$rangeValueField.value="",this._$rangeValueTextField.innerHTML=" "),this.updateRangeInputField(),Promise.resolve()}updateRangeInputField(){let e=Array.from(this._$rangeValuesField.querySelectorAll("span[data-range-value]:not([hidden])"));e.length>0&&(this._$rangeInputField.max=e.length-1);let t=this._$rangeValueField.value;e.forEach((e,i)=>{e.dataset.rangeValue===t&&(this._$rangeValueTextField.textContent=e.dataset.rangeValueLabel,this._$rangeInputField.value=i)})}registerEventHandler(){this.domField().addEventListener("input",()=>{this.updateSliderLabel()})}updateSliderLabel(){let e=this.getValueFromInputfield(),t=Array.from(this._$rangeValuesField.querySelectorAll("span[data-range-value]:not([hidden])")),i=t[e]?.dataset.rangeValue,a=t[e]?.querySelector("*[data-range-value-label]")?.innerHTML;this._$rangeValueField.value=i||"",this._$rangeValueTextField.innerHTML=a||"",this.publishFieldChangeEvent()}getValueFromInputfield(){return this.domField().value}domField(){return this._el.querySelector('input[type="range"]')}}class G extends I{constructor(e,t,i,a,r){super(e,t,i,a,r),this.repetitions=[],this.uppercaseAlphabet=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"],this.lowercaseAlphabet=[..."abcdefghijklmnopqrstuvwxyz"];let l=this.domField().querySelector("[data-add-button]"),n=this.domField().querySelector("[data-remove-button]");null!==l&&null!==n&&(l.addEventListener("click",this.onAddRepetitionClicked.bind(this)),n.addEventListener("click",this.onRemoveRepetitionClicked.bind(this))),this._blueprintRepetition=this.domField().querySelector("[data-is-blueprint]"),this._blueprintRepetition.remove();let o=this;this.domField().querySelectorAll(".neonConfigurator__field__repetition").forEach((e,t)=>{o.addRepetitionToObjectStore(e,t)}),this.updateRepeatIndexAndNumbers()}onAddRepetitionClicked(e){e.preventDefault(),this.addRepetition(!1)}onRemoveRepetitionClicked(e){this.removeRepetition(e,!1)}addRepetition(e){let t=this,i=this.addNewRepetitionToDom();t.updateRepeatIndexAndNumbers(),t.addRepetitionToObjectStore(i,t.repetitionCount()-1),this.publishFieldStructureChange(e)}removeRepetition(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=this.removeRepetitionFromDom(e);this.updateRepeatIndexAndNumbers(),this.removeRepetitionFromObjectStore(i.getAttribute("data-repetition-index")),this.publishFieldStructureChange(t)}removeRepetitionByIndex(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this;i.domField().querySelectorAll(".neonConfigurator__field__repetition")[e].remove(),this.updateRepeatIndexAndNumbers(),this.removeRepetitionFromObjectStore(e),i.publishFieldStructureChange(t)}addNewRepetitionToDom(){let e=this._blueprintRepetition.cloneNode(!0);e.removeAttribute("data-is-blueprint");let t="_"+Date.now()+"_"+Math.floor(1e4*Math.random());e.querySelectorAll("input[id], select[id], textarea[id]").forEach(i=>
1{let a=i.getAttribute("id");if(a){let r=a+t;i.setAttribute("id",r);let l=e.querySelector(`label[for="${a}"]`);l&&l.setAttribute("for",r)}}),e.querySelectorAll('input[type="radio"][name], input[type="checkbox"][name]').forEach(e=>{let i=e.getAttribute("name");i&&e.setAttribute("name",i+t)});let i=e.querySelector("[data-remove-button]");return null!==i&&i.addEventListener("click",this.onRemoveRepetitionClicked.bind(this)),this.domField().querySelector("[data-repetition-container]").appendChild(e),e}addRepetitionToObjectStore(e,t){let i=this,a=[];i.config.children.forEach(function(e){let r=i.domField().querySelectorAll('[data-neon-configurator-field-id="'+e.id+'"]')[t],l=Z.create(r,e,i.group,i.$emitter,i.configuratorPlugin);l.setFieldNameAttribute(t),a.push(l)}),i.repetitions.push(a)}removeRepetitionFromObjectStore(e){this.repetitions.splice(e,1)}removeRepetitionFromDom(e){let t=e.currentTarget.closest(".neonConfigurator__field__repetition");return t.remove(),t}updateRepeatIndexAndNumbers(){let e=this;this.domField().querySelectorAll(".neonConfigurator__field__repetition").forEach((t,i)=>{t.classList.add("neonConfigurator__field__repetition--"+(i+1)),t.setAttribute("data-repetition-index",i),e.updateNumber(t,i),t.querySelectorAll(".neonConfigurator__field").forEach(e=>{e.setAttribute("data-neon-configurator-field-repeat-index",i)})})}updateNumber(e,t){let i=e.querySelector(".neonConfigurator__field__repetition__title__number"),a=this.domField().querySelectorAll(".neonConfigurator__field__repetition").length;if(this.config.options.repeaterHideNumberingIfSingleRepetition&&a<=1){i.innerHTML="";return}"lowercaseLetters"===this.config.options.repeaterRepeatNumberPattern?i.innerHTML=this.lowercaseAlphabet[t]:"uppercaseLetters"===this.config.options.repeaterRepeatNumberPattern?i.innerHTML=this.uppercaseAlphabet[t]:"romanUppercase"===this.config.options.repeaterRepeatNumberPattern?i.innerHTML=this.convertToRoman(t+1):i.innerHTML=t+1}getDefaultValue(){return{fields:[],count:0}}value(){let e=[];return this.isDefaultValueNeeded()?this.getDefaultValue():(this.repetitions.forEach(function(t,i){let a={};t.forEach(function(e){a[e.key]={value:e.value(),label:e.config.label,price:e.isVisible()?e.price():0,index:i,number:i+1}}),e.push(a)}),{fields:e,count:this.repetitions.length})}async updateVisibility(e){let t=await super.updateVisibility(e);if(t)for(let t=0;t<this.repetitions.length;t++)for(let i of this.repetitions[t]){let a=JSON.parse(JSON.stringify(e));a.repetition={index:t,number:t+1,fields:this.value().fields[t]},a.repetitionNumber=t+1,await i.updateVisibility(a)}return t}setValue(e){if(e>this.repetitionCount())for(let t=this.repetitionCount();t<e;t++)this.addRepetition(!1);return Promise.resolve()}repetitionCount(){return this.domField().querySelectorAll(".neonConfigurator__field__repetition").length}callbackBeforeUpdate(e){return this.updateRepetitions(e)}updateRepetitions(e){let t=this;return"calculation"===t.config.options.repeaterRepeatCountMode?f.A.calculate(this.config.repetitioncountCalculation.calculation,e,"Repetition count").then(e=>{if(e!==this.repetitionCount()){if(e>this.repetitionCount())for(let t=this.repetitionCount();t<e;t++)this.addRepetition(!0);else for(let t=this.repetitionCount();t>e;t--)this.removeRepetitionByIndex(t-1,!0);this.publishFieldStructureChange(!1)}}):Promise.resolve()}publishFieldStructureChange(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||this.$emitter.publish("fieldStructureChange",{field:this})}convertToRoman(e){var t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},i="";for(var a of Object.keys(t)){var r=Math.floor(e/t[a]);e-=r*t[a],i+=a.repeat(r)}return i}getUrlConfig(){let e=this,t=[{key:this.config.key,value:this.repetitionCount()}];return this.repetitions.forEach(function(i){i.forEach(function(i){let a=i.getUrlConfig();null!==a&&t.push(e.namespaceUrlConfig(a))})}),t}namespaceUrlConfig(e){let t=this;return Array.isArray(e)?e.map(function(e){return t.namespaceUrlConfig(e)}):{key:this.config.key+"["+e.key+"]",value:e.value}}
1reset(){this.repetitions.forEach(e=>{e.forEach(e=>{e.reset()})}),super.reset()}registerEventHandler(){}}class Q extends I{getDefaultValue(){return null}value(){return this.getDefaultValue()}price(){return 0}setValue(e){return Promise.resolve()}needsValueUpdateOnRefresh(){return!1}getUrlConfig(){return null}registerEventHandler(){}isAvailableInCart(){return!1}}class J extends I{constructor(e,t,i,a,r){super(e,t,i,a,r),this.$gallery=null,this.stockID=null,this.$gallery=this.domField().querySelector("[data-neonconfigurator-adobestockgallerygetter]"),this.$galleryImages=this.domField().querySelector(".neonAdobeStock__gallery__images__container"),this.searchInputTimeout=null}getDefaultValue(){return null}value(){let e=this.getCheckedDomFields();if(this.isDefaultValueNeeded())return this.getDefaultValue();let t=Array.from(e).map(e=>e.dataset.value);return{images:t,imageCount:t.length}}setValue(e){if(this.config.options.isMultiselect){let t=e.split(","),i=this.domField().querySelectorAll(this.getDomInputField());t.forEach(function(e){i.forEach(function(t){t.value===e&&(t.checked=!0)})})}else this.domField().querySelectorAll(this.getDomInputField()).forEach(function(t){t.value===e&&(t.checked=!0)});return Promise.resolve()}reset(){this.domField().querySelectorAll(this.getDomInputField()).forEach(e=>{e.checked=!1}),super.reset()}initEventHandlers(){this.refresh("")}refresh(e){let t=this;this.getAdobeStockGallery(e).then(function(e){t.$gallery.innerHTML=e}).then(()=>{t.domField().querySelector("[data-neonAdobeStockGallery-action-reload]").addEventListener("click",e=>{e.target.classList.add("loading"),t.refresh()}),t.domField().querySelector("[data-neonAdobeStockGallery-search]").addEventListener("keydown",function(e){[13].includes(e.keyCode)&&e.preventDefault()}),t.domField().querySelector("[data-neonAdobeStockGallery-search]").addEventListener("input",e=>{clearTimeout(t.searchInputTimeout),t.searchInputTimeout=setTimeout(()=>{let i="&key="+e.target.value,a=t.domField().querySelector("[data-neonAdobeStockGallery-category]").value;""!==a&&(i+="&category_id="+a),t.refreshImages(i)},500)}),t.domField().querySelector("[data-neonAdobeStockGallery-category]").addEventListener("change",e=>{let i="&category_id="+e.target.value,a=t.domField().querySelector("[data-neonAdobeStockGallery-search]").value;""!==a&&(i+="&key="+a),t.refreshImages(i)}),t.domField().querySelectorAll(".neonAdobeStock__gallery__image").forEach(e=>{e.addEventListener("click",e=>{t.publishFieldChangeEvent()})}),t.domField().querySelectorAll("[data-neonAdobeStockGallery-action-prev],[data-neonAdobeStockGallery-action-next]").forEach(e=>{e.addEventListener("click",function(){let e="&page="+this.dataset.page,i=t.domField().querySelector("[data-neonAdobeStockGallery-category]").value;""!==i&&(e+="&category_id="+i);let a=t.domField().querySelector("[data-neonAdobeStockGallery-search]").value;""!==a&&(e+="&key="+a),t.refreshImages(e)})}),PluginManager.initializePlugin("NeonConfiguratorAlternativeModal","[data-neon-configurator-alternative-modal]"),this.setFieldNameAttribute()})}refreshImages(e){let t=this;this.getAdobeStockGalleryImages(e).then(function(e){t.$galleryImages.innerHTML=e}).then(()=>{t.domField().querySelector(".neonAdobeStock__gallery__images__container").classList.remove("loading"),t.domField().querySelectorAll(".neonAdobeStock__gallery__image").forEach(e=>{e.addEventListener("click",e=>{t.publishFieldChangeEvent()})}),t.domField().querySelectorAll("[data-neonAdobeStockGallery-action-prev],[data-neonAdobeStockGallery-action-next]").forEach(e=>{e.addEventListener("click",function(){let e="&page="+this.dataset.page,i=t.domField().querySelector("[data-neonAdobeStockGallery-category]").value;""!==i&&(e+="&category_id="+i);let a=t.domField().querySelector("[data-neonAdobeStockGallery-search]").value;""!==a&&(e+="&key="+a),t.refreshImages(e)})}),PluginManager.initializePlugin("NeonConfiguratorAlternativeModal","[data-neon-configurator-alternative-modal]"),this.setFieldNameAttribute()})}getAdobeStockGallery(e){if(this.$gallery=this.domField().querySelector("[data-neonconfigurator-adobestockgallerygetter]"),this.domField().querySelector(".neonAdobeStock__gallery__images").classList.add("loading"),0!==this.$gallery.length)return new Promise((t,i)=>{fetch(this.$gallery.dataset.action+e).then(e=>e.text()).then(function(e){e?t(e):i("No response text available")})})}getAdobeStockGalleryImages(e){if(this.$galleryImages=this.domField().querySelector(".neonAdobeStock__gallery__images__container"),this.$galleryImages.classList.add("loading"),0!==this.$galleryImages.length)return new Promise((t,i)=>{fetch(this.$galleryImages.dataset.action+e).then(e=>e.text()).then(function(e){e?t(e):i("No response text available")})})}getDomInputField(){return"[data-neon-configurator-field-value]"}getCheckedDomFields(){let e=[];return this.domField().querySelectorAll(this.getDomInputField()).forEac
1h(t=>{t.checked&&e.push(t)}),e}}class z{static #e=this.STATES={initialized:"initialized",uploading:"uploading",uploadSuccessfull:"uploadSuccessfull",uploadFailed:"uploadFailed"};constructor(e,t,i){this.selectors={template:"*[data-neon-configurator-field-multi-upload-template]",fileList:"*[data-neon-configurator-field-multi-upload-filelist]",fileName:"*[data-neon-configurator-field-multi-upload-filecard-name]",fileSize:"*[data-neon-configurator-field-multi-upload-filecard-size]",fileProgress:"*[data-neon-configurator-field-multi-upload-filecard-progress]",fileProgressLabel:"*[data-neon-configurator-field-multi-upload-filecard-progressLabel]",removeFile:"*[data-neon-configurator-field-multi-upload-filecard-remove]",messages:"*[data-neon-configurator-field-multi-upload-filecard-messages]",image:"*[data-neon-configurator-field-multi-upload-filecard-image]",icon:"*[data-neon-configurator-field-multi-upload-filecard-icon]",quantity:"*[data-neon-configurator-field-multi-upload-filecard-quantity]",validationMessages:"*[data-neon-configurator-field-multi-upload-filecard-validationMessage]"},this.classes={error:"neonConfigurator__field--multiUpload__container__files__card--error",success:"neonConfigurator__field--multiUpload__container__files__card--success"},this.messages={serverError:null,validationErrors:[],validationNotes:[]},this.$card=null,this.$messagesContainer=null,this.uploadStatus="initialized";let a=this;a.file=e,a.endpoint=t,a.field=i,a.createCard(e)}getValueInfo(){return{id:this.file.id,name:this.file.name,url:this.getFileUrl(),size:this.file.size,extension:this.file.name.split(".").pop().toLowerCase(),type:this.file.type,quantity:this.getAttributes().quantity}}getFileUrl(){let e=this;return e.file instanceof Blob?window.URL.createObjectURL(e.file):e.file.url}upload(){let e=this.prepareUpload();this.startUpload(e)}hasError(){let e=this;return null!==e.messages.serverError||e.messages.validationErrors.length>0}createCard(e){let t=this,i=t.field.domField().querySelector(t.selectors.template);if(t.$card=i.cloneNode(!0),t.$fileList=t.field.domField().querySelector(t.selectors.fileList),t.$fileList.appendChild(t.$card),t.$card.querySelector(t.selectors.fileName).textContent=e.name,t.$card.querySelector(t.selectors.fileSize).textContent=t.getFileSizeInMB(e),t.setProgress(0),t.$card.querySelector(t.selectors.removeFile).addEventListener("click",function(){t.remove()}),t.$messagesContainer=t.$card.querySelector(t.selectors.messages),e.type.includes("image")){let i=t.$card.querySelector(t.selectors.image);i.setAttribute("src",t.getFileUrl(e)),i.style.display="block",t.$card.querySelector(t.selectors.icon).style.display="none"}t.$card.style.display="block",t.$quantity=t.$card.querySelector(t.selectors.quantity),t.$quantity&&t.$quantity.addEventListener("change",function(){t.triggerEvent("quantityChanged")}),window.PluginManager.initializePlugins()}setProgress(e){let t=this;t.$card.querySelector(t.selectors.fileProgress).style.width=e+"%",t.$card.querySelector(t.selectors.fileProgressLabel).textContent=e+"%"}getFileSizeInMB(e){let t=e.size/1024/1024;return((t=Math.round(100*t)/100)+"").replace(".",",")+" MB"}prepareUpload(){let e=this;var t=new XMLHttpRequest;return t.upload.addEventListener("progress",function(t){if(e.uploadStatus=z.STATES.uploading,t.loaded<=e.file.size){var i=Math.round(t.loaded/e.file.size*100);e.setProgress(i)}}),t.addEventListener("error",function(t){e.addServerErrorMessage("Fehler beim Dateiupload")}),t.addEventListener("load",function(i){if(200!==t.status)e.uploadStatus=z.STATES.uploadFailed,e.addServerErrorMessage(e.getServerErrorMessage(i.target.responseText)),e.triggerEvent("uploaded");else{let t=JSON.parse(i.target.responseText);e.setUploadSuccessful(t.file)}}),t}setUploadSuccessful(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,i=this;i.file=e,i.uploadStatus=z.STATES.uploadSuccessfull,i.setProgress(100),setTimeout(function(){i.$card.classList.add(i.classes.success)},t),i.triggerEvent("uploaded")}startUpload(e){let t=this;t.uploadStatus=z.STATES.uploading,t.triggerEvent("uploading");let i=new FormData;i.append("action","upload"),i.append("file",t.file),t.field&&t.field.config&&t.field.config.id&&i.append("fieldId",t.field.config.id),e.open("post",t.endpoint),e.send(i),t.clearMessages()}addServerErrorMessage(e){let t=this;t.messages.serverError=e,t.updateMessagesOutput()}getServerErrorMessage(e){try{let t=JSON.parse(e);if(t&&t.message)return t.message}catch(e){}return"Fehler beim Dateiupload"}addValidationMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this;
1t?i.messages.validationNotes.push(e):i.messages.validationErrors.push(e),i.updateMessagesOutput()}clearMessages(){let e=this;e.messages.validationErrors=[],e.messages.validationNotes=[],e.updateMessagesOutput()}updateMessagesOutput(){let e=this;if(e.$messagesContainer.innerHTML="",e.messages.serverError){let t=document.createElement("div");t.className="neonConfigurator__field--multiUpload__container__files__card__messages__message neonConfigurator__field--multiUpload__container__files__card__messages__message--error",t.textContent=e.messages.serverError,e.$messagesContainer.appendChild(t)}e.messages.validationErrors.forEach(function(t){let i=document.createElement("div");i.className="neonConfigurator__field--multiUpload__container__files__card__messages__message neonConfigurator__field--multiUpload__container__files__card__messages__message--error",i.textContent=t,e.$messagesContainer.appendChild(i)}),e.messages.validationNotes.forEach(function(t){let i=document.createElement("div");i.className="neonConfigurator__field--multiUpload__container__files__card__messages__message",i.textContent=t,e.$messagesContainer.appendChild(i)}),e.$messagesContainer.style.display="block",e.hasError()&&e.$card.classList.add(e.classes.error)}remove(){this.$card.remove(),this.triggerEvent("removed")}triggerEvent(e){this.$card.dispatchEvent(new CustomEvent(e,{bubbles:!0}))}addEventListener(e,t){this.$card.addEventListener(e,t)}getAttributes(){let e=1;return this.$quantity&&this.$quantity.value&&(e=this.$quantity.value),{quantity:e}}setQuantity(e){this.$quantity.value=e}}class W extends I{initEventHandlers(){let e=this,t=e.domField().querySelector('[data-neon-configurator-field-multi-upload-dropzone="true"]');try{if(e.urls=JSON.parse(t.dataset.neonConfiguratorFieldMultiUrls),!e.urls.upload)throw Error("Upload URL is not defined")}catch(e){throw Error(e)}let i=e.domField().querySelector('input[type="file"]');
1i.addEventListener("change",function(t){t.preventDefault(),e.handleFiles(t.target.files||t.dataTransfer.files),i.value=""}),t.addEventListener("drop",function(i){i.preventDefault(),t.classList.remove("is-dragover"),e.handleFiles(i.dataTransfer.files)}),t.addEventListener("dragover",function(e){e.preventDefault()}),t.addEventListener("dragenter",function(e){e.preventDefault(),t.classList.add("is-dragover")}),t.addEventListener("dragleave",function(e){t.classList.remove("is-dragover")}),t.addEventListener("click",function(e){i.click()})}getDefaultValue(){return{files:[],totalFileSize:0,fileCount:0}}value(){if(this.isDefaultValueNeeded())return this.getDefaultValue();{let e=this.fileCards.filter(function(e){return e.uploadStatus!==z.STATES.uploadFailed}).map(function(e){return e.getValueInfo()});return{files:e,totalFileSize:e.reduce(function(e,t){return e+t.size},0),fileCount:e.length}}}getUrlConfig(){let e=Object.values(this.value().files).map(function(e){let t="f:"+e.id;return e.quantity&&(t+="=q:"+e.quantity),t});return{key:super.getUrlConfig().key,value:e}}setValue(e){let t=this;return e.split(",").forEach(function(e){let i=e.split("="),a=i.filter(function(e){return e.startsWith("f:")})[0].substr(2),r=i.filter(function(e){return e.startsWith("q:")});1===r.length?t.loadFileInfo(a,r[0].substr(2)):t.loadFileInfo(a)}),Promise.resolve()}reset(){this.clearMessages(),this.removeFiles()}removeFiles(){let e=this;for(let t of e.fileCards)t.remove();e.fileCards=[],e.publishFieldChangeEvent()}handleFiles(e){let t=this;if(void 0!==e&&0!==e.length){for(let t of e)this.createFilecard(t);t.publishFieldChangeEvent()}}createFilecard(e,t){let i=this,a=new z(e,this.urls.upload,i);return a.addEventListener("uploading",function(){i.publishFieldChangeEvent()}),a.addEventListener("uploaded",function(){i.publishFieldChangeEvent()}),a.addEventListener("removed",function(){i.fileCards=i.fileCards.filter(function(e){return e!==a}),i.publishFieldChangeEvent()}),a.addEventListener("quantityChanged",function(){i.publishFieldChangeEvent()}),void 0!==t&&a.setQuantity(t),i.fileCards.push(a),a}isValid(){let e=this;return super.isValid()&&0===e.runningUploadCount()}runningUploadCount(){let e=this;return e.fileCards.reduce(function(e,t){return e+ +(t.uploadStatus===z.STATES.uploading)},0)}validate(e){let t=this;t.fileCards.forEach(e=>{e.clearMessages()});let i=t.validations().filter(function(e){return!e.options.isFileValidation}),a=t.validations().filter(function(e){return e.options.isFileValidation});return this.executeFieldValidations(i,e).then(function(){t.executeFileValidations(a,e).then(function(e){return e.failedValidations.forEach(function(e){t.markFieldAndValidationMessageAsErroneous(e)}),e.alwaysVisibleValidationMessages.forEach(function(e){t.el.querySelector('*[data-neon-configurator-field-validation-id="'+e.id+'"]').style.display="block"}),t.fileCards.forEach(e=>{e.hasError()||e.uploadStatus!==z.STATES.initialized||e.upload()}),e})})}executeFieldValidations(e,t){let i=this,a=[];return e.forEach(function(e){let r=JSON.parse(JSON.stringify(t));"object"==typeof e.options&&Object.assign(r,e.options),r.value=i.value(),a.push(f.A.calculate(e.calculation,r,"Validation").then(t=>{t?e.alwaysShowValidationInfo&&(i.el.querySelector('*[data-neon-configurator-field-validation-id="'+e.id+'"]').style.display="block"):i.markFieldAndValidationMessageAsErroneous(e)}))}),Promise.all(a)}executeFileValidations(e,t){let i=this;return new Promise(function(a,r){let l=!1,n=[],o=[],s=[];i.fileCards.forEach(i=>{e.forEach(function(e){let a=JSON.parse(JSON.stringify(t));"object"==typeof e.options&&Object.assign(a,e.options),a.file=i.getValueInfo(),a.value=void 0,s.push(f.A.calculate(e.calculation,a,"Validation").then(t=>{t?e.alwaysShowValidationInfo&&(o.push(e),i.addValidationMessage(e.validationInfo,!0)):(n.push(e),l=!0,i.addValidationMessage(e.validationInfo))}))})}),Promise.all(s).then(()=>{e.forEach(function(e){e.alwaysShowValidationInfo&&o.push(e)}),l&&(i.domField().classList.add("neonConfigurator__field--hasError"),i.domField().closest(".neonConfigurator__group").classList.add("neonConfigurator__group--hasError")),a({failedValidations:n,alwaysVisibleValidationMessages:o})})})}loadFileInfo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this,a=new XMLHttpRequest;return a.addEventListener("load",function(e){if(200===a.status){let e=JSON.parse(a.responseText);i.createFilecard(e,t).setUploadSuccessful(e,0)}}),a.timeout=0,a.open("GET",this.urls.fileInfo.replace("FILEID",e),!0),a.send(),a}constructor(...e){super(...e),this.fileCards=[]}}class K extends I{getDefaultValue(){return null}value(){return this.getDefaultValue()}price(){return 0}setValue(e){}needsValueUpdateOnRefresh(){return!1}calculateNewValue(e){}getUrlConfig(){return null}registerEventHandler(){}isAvailableInCart(){return!1}}class X extends I{getDefaultValue(){return null}value(){return this.getDefaultValue()}price(){return 0}setValue(e){}needsValueUpdateOnRefresh(){return!1}calculateNewValue(e){}getUrlConfig(){return null}registerEventHandler(){}isAvailableInCart(){return!1}}class Y extends I{getDefaultValue(){return this.getUncheckedValue()}value(){return this.isDefaultValueNeeded()?this.getDefaultValue():this.getCheckboxElement().checked?this.getCheckedValue():this.getUncheckedValue()}valueLabel(){if(this.isDefaultValueNeeded())return"";let e=this.getCheckboxElement().checked,t=this.getSwitchContainer();return e?t.dataset.neonSwitchCheckedLabel||"Ja":t.dataset.neonSwitchUncheckedLabel||"Nein"}setValue(e){return this.getCheckboxElement().checked=e===this.getCheckedValue(),Promise.resolve()}reset(){this.getCheckboxElement().checked=!1,super.reset()}registerEventHandler(){let e=this;this.getCheckboxElement().addEventListener("change",function(){e.publishDebounceFieldChangeEvent()})}getCheckboxElement(){return this.domField().querySelector('input[type="checkbox"]')}getSwitchContainer(){return this.domField().querySelector(".neonConfigurator__field__switch")}
1getCheckedValue(){return this.getSwitchContainer().dataset.neonSwitchCheckedValue||"checked"}getUncheckedValue(){let e=this.getSwitchContainer().dataset.neonSwitchUncheckedValue;return void 0!==e?e:""}}class Z{static create(e,t,i,a,r){let l=null;if("number"===t.type&&(l=new L(e,t,i,a,r)),"date"===t.type&&(l=new N(e,t,i,a,r)),"text"===t.type&&(l=new T(e,t,i,a,r)),"calculationResult"===t.type&&(l=new R(e,t,i,a,r)),"select"===t.type&&("list"===t.options.selectType&&(l=new $(e,t,i,a,r)),"button"===t.options.selectType&&(l=new U(e,t,i,a,r)),"color"===t.options.selectType&&(l=new U(e,t,i,a,r)),"image"===t.options.selectType&&(l=new j(e,t,i,a,r)),"dropdown"===t.options.selectType&&(l=new B(e,t,i,a,r)),"slider"===t.options.selectType&&(l=new H(e,t,i,a,r))),"multiUpload"===t.type&&(l=new W(e,t,i,a)),"repeat"===t.type&&(l=new G(e,t,i,a,r)),"spacer"===t.type&&(l=new Q(e,t,i,a,r)),"empty"===t.type&&(l=new NeonConfiguratorFieldEmpty(e,t,i,a,r)),"adobeStock"===t.type&&(l=new J(e,t,i,a,r)),"headline"===t.type&&(l=new X(e,t,i,a,r)),"description"===t.type&&(l=new K(e,t,i,a,r)),"switch"===t.type&&(l=new Y(e,t,i,a,r)),null==l)throw"No JS storefront module found for field type "+t.type+" "+t.options.selectType;return l}}var ee=i(11);class et{constructor(e){this.configurator=e,this.debugElement=null,this.jsonViewLibIsLoaded=!1,this.debugMessages=[],this.expandedPaths=new Set,this.pendingErrorRuleData=null}init(){let e=this;if(window.neonlinesConfigurator=window.neonlinesConfigurator||{},window.neonlinesConfigurator.startDebug=function(){window.localStorage.setItem("neonlinesConfiguratorIsDebugActive",!0),e.configurator.options.configuration.isDebugActive=!0,e.init()},window.neonlinesConfigurator.stopDebug=function(){e.configurator.options.configuration.isDebugActive=!1,document.querySelectorAll(".neonConfigurator__debug").forEach(function(e){e.remove()}),window.localStorage.removeItem("neonlinesConfiguratorIsDebugActive")},e.configurator.options.configuration.isDebugActive){e.debugElement=document.createElement("div"),e.debugElement.className="neonConfigurator__debug",e.debugElement.innerHTML='<div class="neonConfigurator__debug__headline" onclick="document.querySelector(\'.neonConfigurator__debug\').classList.toggle(\'neonConfigurator__debug__closed\')">neonlines Konfigurator - Debug Modus <div class="neonConfigurator__debug__headline__close">></div></div><div class="neonConfigurator__debug__content"><small>Konfigurator-ID: '+e.configurator.options.configuration.id+'</small><ul class="neonConfigurator__debug__log"></ul><div class="neonConfigurator__debug__messageContainer"></div></div>',document.body.appendChild(e.debugElement);let t=document.createElement("script");t.setAttribute("src",e.configurator.options.libUrls.jsonView),document.body.appendChild(t),t.onload=function(){e.jsonViewLibIsLoaded=!0,e.pendingErrorRuleData&&(e.renderErrorRuleData(e.pendingErrorRuleData),e.pendingErrorRuleData=null),e.update({})}}}saveExpansionState(){this.expandedPaths.clear(),(this.debugElement?.querySelectorAll(".json-container")||[]).forEach((e,t)=>{e.querySelectorAll(".json-toggle.collapsed").forEach(e=>{let i=this.getElementPath(e,t);this.expandedPaths.add(i)})})}restoreExpansionState(){(this.debugElement?.querySelectorAll(".json-container")||[]).forEach((e,t)=>{e.querySelectorAll(".json-toggle").forEach(e=>{let i=this.getElementPath(e,t);this.expandedPaths.has(i)&&e.click()})})}getElementPath(e,t){let i=[],a=e;for(;a&&!a.classList.contains("json-container");){let e=a.querySelector(".json-key")?.textContent;e&&i.unshift(e),a=a.parentElement?.closest(".json-item")}return`${t}:${i.join(".")}`}renderJSON(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=document.createElement("div");jsonview.renderJSON(e,a),i&&(a.querySelector(".json-key").innerHTML=i),t.appendChild(a.firstChild)}update(e){let t=this;t.configurator.options.configuration.isDebugActive&&t.jsonViewLibIsLoaded&&(t.saveExpansionState(),t.configurator.createCurrentState().then(function(i){i.subcalculations.calculations=e;let a=t.debugElement.querySelector(".neonConfigurator__debug__messageContainer");a.innerHTML="",a.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Feldwerte</div>'),t.renderJSON(i.ruleData.fields,a,"fields"),a.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Alle verfügbare Variablen</div>'),t.renderJSON(i.ruleData,a,"{}"),a.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Globale Berechnungen</div>'),t.renderJSON(i.ruleData.global.calculations,a),a.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Zwischenberechnungen</div>'),t.renderJSON(i.subcalculations.calculations,a),a.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Sonstiges</div>');let r=document.createElement("div");for(let e of(r.className="json-container",r.innerHTML="<ul></ul>",Object.values(t.debugMessages)))r.querySelector("ul").insertAdjacentHTML("beforeend","<li>"+e+"</li>");a.appendChild(r),requestAnimationFrame(()=>{t.restoreExpansionState()})}))}addMessage(e){this.debugMessages.push(e)}cleanMessages(){this.debugMessages=[],this.configurator.options.configuration.isDebugActive&&this.debugElement&&(this.debugElement.querySelector(".neonConfigurator__debug__log").innerHTML="")}logError(e){let t={message:`${e.message}. Stack: ${e.stack}`,level:"error",configurationId:this.configurator.options.configuration.id,exceptionType:e.constructor?.name||"UnknownError",innerException:{message:e.innerException?.message||"",exceptionType:e.innerException?.constructor?.name||""}};if(e instanceof P.A&&(Object.assign(t,{formula:e.formula,calculationType:e.calculationType,calculation:e.calculation}
1),(e.fieldLabel||e.fieldKey)&&(t.fieldLabel=e.fieldLabel,t.fieldKey=e.fieldKey)),fetch(this.configurator.options.loggerUrl,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(t)}).catch(e=>{console.error("Error logging failed:",e,t)}),this.configurator.options.configuration.isDebugActive){let i=document.querySelector(".neonConfigurator__debug__log");if(i){let a=`Error: ${t.message.replace(/</g,"<").replace(/>/g,">").replace("Check if all subcalculations return valid numbers.","<strong>Check if all subcalculations return valid numbers.</strong>").replace(" Stack:","<br><br>Stack:")}`;e instanceof P.A&&(e.fieldLabel||e.fieldKey)&&(a+=`<br><strong>Field:</strong> ${e.fieldLabel||""} (${e.fieldKey||""})`),i.innerHTML+=` 2 <li class="neonConfigurator__debug__log__entry neonConfigurator__debug__log__entry--error"> 3 ${a} 4 </li> 5 `}if(e instanceof P.A&&e.ruleData){let t={formula:e.formula,calculationType:e.calculationType,calculation:e.calculation,ruleData:e.ruleData};this.jsonViewLibIsLoaded?this.renderErrorRuleData(t):this.pendingErrorRuleData=t}}}renderErrorRuleData(e){let t=this.debugElement?.querySelector(".neonConfigurator__debug__messageContainer");t&&(t.innerHTML="",t.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline" style="color: #dc3545;">Fehlerkontext</div>'),this.renderJSON({formula:e.formula,calculationType:e.calculationType},t,"errorContext"),e.ruleData.fields&&(t.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Feldwerte</div>'),this.renderJSON(e.ruleData.fields,t,"fields")),t.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Alle verfügbare Variablen</div>'),this.renderJSON(e.ruleData,t,"{}"),e.ruleData.global?.calculations&&(t.insertAdjacentHTML("beforeend",'<div class="neonConfigurator__debug__subheadline">Globale Berechnungen</div>'),this.renderJSON(e.ruleData.global.calculations,t)))}}class ei{static #e=this._currentAbortController=null;static isExpression(e){return"string"==typeof e&&/^(fields\.|calculations\.|product\.|global\.)/.test(e)}static getReferencedFieldKeys(e){if("string"!=typeof e)return null;let t=e.match(/^fields\.([^.]+)\./);return t?[t[1]]:/^(calculations\.|product\.|global\.)/.test(e)?null:[]}static isFieldAffectedByChange(e,t){if(!t)return!0;for(let i of e.config.valueGroups)if("productStream"===i.selectValueMode)for(let e of i.options&&i.options.propertyFilters||[]){if(!ei.isExpression(e.matchExpression))continue;let i=ei.getReferencedFieldKeys(e.matchExpression);if(null===i||i.includes(t))return!0}return!1}static async reloadFields(e,t){let i=e.options.product.id,a=t?t.key:null,r=[];if(e.fields.forEach(function(e){(!t||e.id!==t.id)&&"select"===e.config.type&&e.config.valueGroups&&e.config.valueGroups.some(function(e){return"productStream"===e.selectValueMode&&(e.options&&e.options.propertyFilters||[]).some(function(e){return ei.isExpression(e.matchExpression)})})&&(0===e.visibleValueCount()||ei.isFieldAffectedByChange(e,a))&&r.push(e)}),0===r.length)return;ei._currentAbortController&&ei._currentAbortController.abort();let l=new AbortController;ei._currentAbortController=l;let n=JSON.stringify({fields:e.currentFieldData});for(let e of r){if(l.signal.aborted)return;let t="/widgets/configurator/ajax/reloadFieldValues/"+e.id+"/product/"+i;try{let i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},body:n,signal:l.signal}),a=await i.text();ei._applyResponse(e,a)}catch(t){if("AbortError"===t.name)return;console.error("Failed to reload field values for field "+e.id,t)}}l.signal.aborted||(ei._currentAbortController===l&&(ei._currentAbortController=null),e.currentFieldData=e.convertFieldDataForRule(),await e.setVisibilities(),e.currentFieldData=e.convertFieldDataForRule())}static _applyResponse(e,t){let i=new DOMParser().parseFromString(t,"text/html"),a=i.querySelector("[data-neon-configurator-field-config]");if(a){let t=JSON.parse(a.dataset.neonConfiguratorFieldConfig),i=e._fieldConfiguration.isModalSelection,r=e._fieldConfiguration.isModalUseAjax;e._fieldConfiguration=t,e._fieldConfiguration.isModalSelection=i,e._fieldConfiguration.isModalUseAjax=r,e.config=e._fieldConfiguration}let r=i.querySelectorAll(".neonConfigurator__field__values");e.domField().querySelectorAll(".neonConfigurator__field__values").forEach(function(e,t){r[t]&&(e.innerHTML=r[t].innerHTML)}),e.domField().querySelectorAll("img").forEach(function(e){e.dataset.srcset&&!e.srcset?e.srcset=e.dataset.srcset:e.dataset.src&&!e.src&&(e.src=e.dataset.src)}),e.setFieldNameAttribute(),e._fieldConfiguration.options&&e._fieldConfiguration.options.isQuantitySelectionActive&&e.syncCheckedStateWithQuantities&&e.syncCheckedStateWithQuantities()}}class ea extends window.PluginBaseClass{static #e=this.options={decimalSignPrice:"",configuration:null,productPriceFormatted:null,params:null,product:null,loggerUrl:null,productNumberCalculationUrl:null,customerGroup:null,imageUpdateTimeout:100};static #t=this.EVENTS=["beforeInit","afterInit","beforeRefresh","afterRefresh","afterGlobalCalculationCalculated","afterGlobalCalculationsCalculated","afterSubcalculationCalculated","beforeSubcalculationsCalculated","beforeSubcalculationCalculated","afterSubcalculationCalculated","afterSubcalculationsCalculated","fieldChange","configurationChange","afterFieldChange","beforeValidated","afterFieldValidated","afterValidated","beforeVisibilityUpdated","beforeInfoVisibilityUpdated","afterInfoVisibilityUpdated","afterGroupVisibilityUpdated","afterFieldVisibilityUpdated","afterFieldValueVisibilityUpdated","afterVisibilityUpdated","listItemIdUpdated","afterPriceUpdated","afterPriceCalculated","afterBasePriceUpdated","beforeBlockPricesUpdated","afterBlockPriceUpdated","afterBlockPricesUpdated","afterDeliveryTimeUpdated","afterImageUpdated","afterProductNumberUpdated","beforeDynamicTextUpdated","afterDynamicTextUpdated"];
5static #i=this.$input=null;init(){let e=this;this.detectAllDynamicTexts(),d.clearConfig(),e.options.configuration=JSON.parse(e.options.configuration),e.options.configuration.isDebugActive||"true"!==window.localStorage.getItem("neonlinesConfiguratorIsDebugActive")||window.localStorage.removeItem("neonlinesConfiguratorIsDebugActive"),e.debugModule=new et(e),e.debugModule.init(),e.options.configuration.isDebugActive&&ea.EVENTS.forEach(function(t){e.$emitter.subscribe(t,function(e){console.debug("Event "+e.type+" fired. "+(void 0!==e.detail.message?e.detail.message:""),e.detail)})}),e.$emitter.publish("beforeInit"),e.commoncalculationCache={},e.commoncalculationFormulaCache={},e.decimalSign=e.options.decimalSignPrice.replace(/.*1[\s.,â]000([,.])[0-9]{2}.*/g,"$1"),e.thousandSeparator=e.options.decimalSignPrice.replace(/.*1(['\s.,â])000[,.][0-9]{2}.*/g,"$1"),e.decimalDigitCount=e.options.decimalSignPrice.replace(/.*[0-9.,]*[,.]([0-9]{2}).*/g,"$1").length,e.decimalSign===e.options.decimalSignPrice&&(e.decimalSign="",e.decimalDigitCount=0,e.thousandSeparator=e.options.decimalSignPrice.replace(/.*1(['\s.,â])000.*/g,"$1")),e.previousImageSet={additionalMediaIds:[],hiddenMediaStructure:{groups:{}}};let t=document.querySelector('[itemprop="offers"] [itemprop="price"]'),a=document.querySelector('meta[property="product:price:amount"]');e.originalMetaPrice=t?t.getAttribute("content"):null,e.originalOgPrice=a?a.getAttribute("content"):null;let r=e.el.closest(".product-detail-buy, .cms-element-buy-box");e.price=r?.querySelector(".product-detail-price-container .product-detail-price")??null,e.blockPrices=r?.querySelectorAll(".product-block-prices .product-detail-block-price")??[],e.basePrice=r?.querySelector(".product-detail-price-unit .price-unit-content")??null,e.listPrice=r?.querySelector(".list-price-price")??null,e.listPricePercentage=r?.querySelector(".list-price-percentage")??null,e.deliveryTime=r?.querySelector(".delivery-information.delivery-available, .delivery-information.delivery-restock, .twt-product-detail-deliveryTime")??null,e.productNumber=r?.querySelector(".product-detail-ordernumber")??null,e.form=e.el.closest("form"),null!==e.form&&(e.quantitySelection=e.form.querySelector('.product-detail-quantity-select, .product-detail-quantity-input, .product-detail-quantity-group .quantity-selector-group-input, input[name*="[quantity]"]:not([data-neon-configurator-field-value])'),e.form.setAttribute("novalidate","novalidate"),e.form.setAttribute("enctype","multipart/form-data")),e.productImageGalleryContainer=document.querySelector("[data-neonconfigurator-imagegallerygetter] + div"),e.quantitySelection&&e.options.configuration.isStockCalculationActive&&e.quantitySelection.setAttribute("max",0x7fffffff),e.applyEditQuantity(),e.setCheapestPriceIfAvailable(),e.listPrice&&e.options.product.hasGlobalPriceDiscount&&(e.options.product.price=e.options.product.price/(1-e.options.product.listPrice.percentage/100)),e.taxFactor=1,"manual"===e.options.configuration.priceEnterMode?(e.taxFactor="net"===e.options.context.taxState?e.options.product.taxRate/100+1:1,e.options.product.price*=e.taxFactor,e.options.product.calculatedPrices.forEach(function(t){t.unitPrice*=e.taxFactor,void 0!==t.listPrice&&null!=t.listPrice&&(t.listPrice.price*=e.taxFactor)})):(e.taxFactor=1+e.options.product.taxRate/100,"net"===e.options.configuration.priceEnterMode&&"gross"===e.options.context.taxState?(e.options.product.price=e.options.product.price/e.taxFactor,e.options.product.calculatedPrices.forEach(function(t){t.unitPrice=t.unitPrice/e.taxFactor,void 0!==t.listPrice&&null!=t.listPrice&&(t.listPrice.price=t.listPrice.price/e.taxFactor)})):"gross"===e.options.configuration.priceEnterMode&&("net"===e.options.context.taxState||"tax-free"===e.options.context.taxState)?(e.options.product.price=e.options.product.price*e.taxFactor,e.options.product.calculatedPrices.forEach(function(t){t.unitPrice=t.unitPrice*e.taxFactor,void 0!==t.listPrice&&null!=t.listPrice&&(t.listPrice.price=t.listPrice.price*e.taxFactor)})):e.taxFactor=1),e.hasValidPrice=!1,e.fields=[],e.groups=[],e.addFromPriceLabelIfNecessary(),e.options.configuration.fieldgroups.forEach(function(t,i){let a=new M(e.el.querySelector('*[data-neon-configurator-fieldgroup-id="'+t.id+'"]'),t,e.options.configuration,e.$emitter,e.options.stickyHeaderSelectors);e.groups.push(a),t.fields.forEach(function(t){let i=e.el.querySelector('*[data-neon-configurator-field-id="'+t.id+'"]'),r=Z.create(i,t,a,e.$emitter,e);e.fields.push(r)}),"fields-only"===a.groupConfiguration.displayMode?a.open():null!==e.options.configuration.fieldgroupSettings&&"accordion"===e.options.configuration.fieldgroupSettings.openCloseBehavior&&(0===i?a.open():a.close())});let l=[],n=[],o=[];e.isOnlyOneConfiguratorInstanceOnPage()&&((l=d.readConfig()).length,l.forEach(function(t){if(void 0!==t.value){let i;let a=t.key.match(/^([^\[]+)\[([^\[]+)\[(\d+)\]\]$/);if(a){let t=a[1],r=a[2],l=a[3],n=e.fields.filter(e=>e.key===t)[0],o=void 0!==n?n.repetitions[l]:void 0;i=void 0!==o?o.filter(e=>e.key===r)[0]:void 0}else i=e.fields.filter(e=>e.key===t.key)[0];void 0!==i&&""!==t.value&&(o.push(i),n.push(i.setValue(t.value)))}}));let s=l.length>0;Promise.all(n).then(function(){e.expandValueGroupsWithRestoredValues(o),e.refresh(s).then(async function(){let t=JSON.stringify(e.currentFieldData);await ei.reloadFields(e,null),JSON.stringify(e.currentFieldData)!==t&&await e.refresh(s),e.removeLoader(),e._registerEventHandlers(),e.createCurrentState().then(t=>{e.$emitter.publish("afterInit",{currentState:t})}),void 0===PluginManager.getPluginList().NeonConfiguratorInfolink&&PluginManager.register("NeonConfiguratorInfolink",()=>i.e(44014).then(i.bind(i,14)),"[data-neon-configurator-infolink]"),PluginManager.initializePlugins()})})}detectAllDynamicTexts(){let e=this;e.dynamicTextElements=[];let t=/%[^%]+%/g,i=new Map,a=[...e.el.querySelectorAll("[data-neon-configurator-dynamic-text], [data-neon-configurator-dynamic-text] *, [data-bs-original-title]")];null!==e.getCartButton()&&a.push(e.getCartButton());for(let e=0;e<a.length;e++){let r=a[e],l=i.get(r)||{textNodes:[],attributes:{}},n=!1;
5Array.from(r.childNodes).forEach(e=>{if(e.nodeType===Node.TEXT_NODE){let i=e.nodeValue,a=i.match(t);a&&(l.textNodes.push({node:e,originalText:i,templates:a}),n=!0)}if("OPTION"===e.nodeName){let i=e.textContent.trim(),a=e.innerHTML,r=i.match(t);r&&i.length>0&&(l.textContent={element:e,originalText:i,originalHTML:a,templates:r},n=!0)}}),["style","title","placeholder","data-content","data-bs-original-title","data-label"].forEach(e=>{if(r.hasAttribute(e)){let i=r.getAttribute(e),a=i.match(t);a&&(l.attributes[e]={originalValue:i,templates:a},n=!0)}}),n&&i.set(r,l)}e.dynamicTextElementDetails=i}async updateDynamicTexts(){let e=this,t={};t.fields=e.currentFieldData,await e.buildCalculationContext(t),e.$emitter.publish("beforeDynamicTextUpdated",{ruleData:t,dynamicTexts:e.dynamicTextElementDetails}),e.dynamicTextElementDetails.forEach((e,i)=>{e.textNodes.forEach(e=>{let i=e.node,a=e.originalText;e.templates.forEach(e=>{let i=ee.A.getValueFromPath(e,t);a=a.replace(e,null!=i?i:e)}),i.nodeValue=a}),Object.keys(e.attributes).forEach(a=>{let r=e.attributes[a],l=r.originalValue;
5if(r.templates.forEach(e=>{let i=ee.A.getValueFromPath(e,t);l=l.replace(e,null!=i?i:e)}),i.setAttribute(a,l),a.startsWith("data-")){let e=a.slice(5).replace(/-([a-z])/g,(e,t)=>t.toUpperCase());i.dataset[e]=l}})}),e.$emitter.publish("afterDynamicTextUpdated",{ruleData:t})}setCheapestPriceIfAvailable(){let e=this;null!==e.options.configuration.cheapestPrice&&e.price&&s.update(e.options.configuration.cheapestPrice,[e.price],e.decimalSign,e.thousandSeparator,e.decimalDigitCount,"")}async createCurrentState(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this,i=t.currentFieldData;e&&(i=t.convertFieldDataForRule(e));let a={fields:i};return void 0!==t.options.parent&&void 0!==t.options.parent.configurationState&&(a.parent=t.options.parent.configurationState),await t.buildCalculationContext(a),{price:t.lastCalculatedPrice,configuration:i,ruleData:a,subcalculations:{}}}isOnlyOneConfiguratorInstanceOnPage(){return 1===document.querySelectorAll("div[data-neon-configurator]").length}_registerEventHandlers(){let e=this,t=window.PluginManager.getPluginInstances("AddToCart");l.A.iterate(t,e=>{e.$emitter.subscribe("beforeFormSubmit",this.beforeFormSubmit.bind(this))}),e.quantitySelection&&e.options.configuration.isConfigurationRefreshedAfterProductQuantityChange&&e.quantitySelection.addEventListener("change",function(){e.refresh(!0)}),e.$emitter.subscribe("fieldChange",this.onFieldChanged.bind(this)),e.$emitter.subscribe("fieldStructureChange",this.onFieldStructureChanged.bind(this))}beforeFormSubmit(){let e=this;e.updateLineItemId()}onFieldStructureChanged(e){let t=this;window.PluginManager.initializePlugins(),t.onFieldChanged(e)}onFieldChanged(e){let t=this,i=0;t.options.configuration.refreshDelay&&(i=t.options.configuration.refreshDelay)<0&&(i=0),clearTimeout(t.refreshTimeout),t.refreshTimeout=setTimeout(function(){t.refresh(!0).then(async function(){let i={fields:t.currentFieldData,quantity:t.getQuantity()};await t.buildCalculationContext(i);let a=JSON.stringify(t.currentFieldData);await ei.reloadFields(t,e.detail.field),JSON.stringify(t.currentFieldData)!==a&&await t.refresh(!0),t.createCurrentState().then(i=>{i.changedField=e.detail.field,t.$emitter.publish("afterFieldChange",{field:e.detail.field}),i.isValid=!t.isInvalid(),t.$emitter.publish("configurationChange",i)})})},i)}async calculateGlobalCalculations(){let e=this,t=await e.createCurrentState();return new Promise(function(i,a){Promise.all(e.options.configuration.globalCalculations.map(function(i){return f.A.calculate(i.calculation,t.ruleData,"Global calculations").then(function(a){return i.fallbackType&&"null"!==i.fallbackType&&typeof a!==i.fallbackType&&(a=f.A.castToFallbackType(a,i.fallbackType)),e.$emitter.publish("afterGlobalCalculationCalculated",{calculation:i,calculationType:i.calculation.type,calculationResult:a,ruleData:t.ruleData}),{key:i.key,result:a}}).catch(function(e){let t=f.A.getFallbackValue(i);return{key:i.key,result:t}})})).then(function(t){let a={};t.forEach(function(e){a[e.key]=e.result}),e.$emitter.publish("afterGlobalCalculationsCalculated",{results:a}),i(a)}).catch(function(t){e.logError(t),a(t)})})}async calculateSubcalculations(){let e=this;e.globalCalculations=await this.calculateGlobalCalculations();let t=await e.createCurrentState();return e.$emitter.publish("beforeSubcalculationsCalculated"),new Promise(async function(i,a){let r=t.ruleData;e.commoncalculationCache=e.commoncalculationCache||{},e.commoncalculationFormulaCache=e.commoncalculationFormulaCache||{};let l=e.options.configuration.isDebugActive?function(e){return JSON.parse(JSON.stringify(e))}:function(e){return e};for(let t of e.options.configuration.commoncalculations)try{let i=!0;if(t.preconditionCalculation?.type)try{i=!!await f.A.calculate(t.preconditionCalculation,r,"Precondition")}catch(e){i=!1}if(i){e.$emitter.publish("beforeSubcalculationCalculated",{key:t.key,subcalculation:t,ruleData:l(r)});let i=await f.A.calculate(t.calculation,r,"Subcalculations");if(t.fallbackType&&"null"!==t.fallbackType&&typeof i!==t.fallbackType&&(i=f.A.castToFallbackType(i,t.fallbackType)),e.$emitter.publish("afterSubcalculationCalculated",{key:t.key,result:i,subcalculation:t,ruleData:l(r)}),r.calculations=r.calculations||{},r.calculations[t.key]=i,r.calculationFormulas=r.calculationFormulas||{},t.calculation?.jsonFormula){let e=t.calculation.jsonFormula.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");r.calculationFormulas[t.key]=e}if(e.commoncalculationCache[t.key]=i,t.calculation?.jsonFormula){let i=t.calculation.jsonFormula.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");e.commoncalculationFormulaCache[t.key]=i}}else{let i=f.A.getFallbackValue(t);r.calculations=r.calculations||{},r.calculations[t.key]=i,e.commoncalculationCache[t.key]=i,e.$emitter.publish("afterSubcalculationCalculated",{key:t.key,result:i,subcalculation:t,ruleData:l(r),skippedByPrecondition:!0})}}catch(a){let i=f.A.getFallbackValue(t);if(r.calculations=r.calculations||{},r.calculations[t.key]=i,e.commoncalculationCache[t.key]=i,r.calculationFormulas=r.calculationFormulas||{},t.calculation?.jsonFormula){let i=t.calculation.jsonFormula.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");r.calculationFormulas[t.key]=i,e.commoncalculationFormulaCache[t.key]=i}}e.$emitter.publish("afterSubcalculationsCalculated",{result:e.commoncalculationCache}),i(e.commoncalculationCache)})}addRefreshingLoader(){let e=this;e.el.classList.contains("neonConfigurator--isLoading")||e.el.classList.add("neonConfigurator--isRefreshing"),e.options.configuration.areCartButtonsDisabledDuringRefresh&&e.disableCartButton()}removeRefreshingLoader(){let e=this;e.el.classList.remove("neonConfigurator--isRefreshing")}refresh(e){let t=this;return t.$emitter.publish("beforeRefresh",{isDirty:e}),t.debugModule.cleanMessages(),t.debugModule.addMessage("Context tax state: "+t.options.context.taxState),t.debugModule.addMessage("Price enter mode: "+t.options.configuration.priceEnterMode),t.addRefreshingLoader(),t.currentFieldData=t.convertFieldDataForRule(),new Promise(function(i,a){(async function(){let e={};e.fields=t.currentFieldData,await t.buildCalculationContext(e),await Promise.all(t.fields.map(function(i){return t.executeFieldCallbackBeforeUpdate(i,e)}))})().then(()=>{t.calculateSubcalculations().then(function(){t.setVisibilities().then(function(){t.calculateSubcalculations().then(function(){e&&t.el.classList.remove("neonConfigurator--isUntouched"),async function(){let e={};e.fields=t.currentFieldData,await t.buildCalculationContext(e),t.fields.forEach(function(i){t.executeFieldcallbackBeforeUpdateSubcalculationAware(i,e)})}(),t.$fields=t.el.querySelectorAll("*[data-neon-configurator-field]"),t.$validationMessages=t.el.querySelectorAll("*[data-neon-configurator-field-validation]"),t.updateCalculationFields().then(function(){t.currentFieldData=t.convertFieldDataForRule(),t.setVisibilities().then(function(r){(r?t.setVisibilities():Promise.resolve(!1)).then(function(){t.currentFieldData=t.convertFieldDataForRule(),t.calculateSubcalculations().then(function(r){t.currentFieldData=t.convertFieldDataForRule(),t.updateCalculationFields().then(function(){t.currentFieldData=t.convertFieldDataForRule(),t.validate().then(function(){let l=[];l.push(new Promise(function(i,a){t.isInvalid()&&"always"!==t.options.configuration.priceUpdateMode?i():(e&&t.updateUrlParams(),t.updatePrices(e).then(function(){i()}).catch(function(e){a(e)}))})),Promise.all(l).then(function(){t.currentFieldData=t.convertFieldDataForRule(),t.updateDeliveryTime().then(function(){t.updateLineItemId(),t.updateProductImage().catch(function(e){t.logError(e)}).then(function(){t.updateCartButton(),t.updateFormUserData()}),t.updateProductNumber(),t.updateDynamicTexts(),t.debugModule.update(r),t.removeRefreshingLoader(),t.createCurrentState().then(i=>{t.$emitter.publish("afterRefresh",{isDirty:e,isValid:!t.isInvalid(),commonCalculationResults:r,currentState:i})}),i()})}).catch(function(e){a(e)})})})})})})})}).catch(function(e){a(e)})})})})}).catch(function(e){void 0!==e&&t.logError(e)})}updateFormUserData(){let e=this;e.createCurrentState().then(t=>{t=JSON.parse(JSON.stringify(t.configuration)),e.removeUnnecessaryKeys(t),e.options.configuration.isDynamicImageSavingActive&&(t.images={galleryState:{hiddenMediaStructure:e.previousImageSet.hiddenMediaStructure,additionalMediaIds:e.previousImageSet.additionalMediaIds}}),e.el.querySelector("[data-neon-configurator-user-data]").value=JSON.stringify(t)})}removeUnnecessaryKeys(e){let t=this;for(let i in e)e.hasOwnProperty(i)&&("label"===i||"valueLabel"===i?delete e[i]:"object"==typeof e[i]&&null!==e[i]&&t.removeUnnecessaryKeys(e[i]))}collectUrlConfig(){let e=[];
5return this.getVisibleFields().forEach(function(t){let i=t.getUrlConfig();null!==i&&e.push(i)}),e}buildShareConfigString(){return d.extractKeyValuePair(this.collectUrlConfig())}updateUrlParams(){let e=this;if(!e.options.configuration.isUrlUpdateDisabled&&e.isOnlyOneConfiguratorInstanceOnPage()){var t=e.collectUrlConfig();t.length>0?d.writeConfig(e.options.configuration.id,t):d.clearConfig()}else d.clearConfig()}updateCartButton(){let e=this;!e.hasValidPrice||e.isInvalid()?e.disableCartButton():e.enableCartButton()}async validate(){let e=this;e.$emitter.publish("beforeValidated"),e.$validationMessages.forEach(function(e){e.classList.remove("neonConfigurator__field__validations__validation--hasError"),e.style.display="none"}),e.$fields.forEach(function(e){e.classList.remove("neonConfigurator__field--hasError")}),e.el.querySelectorAll(".neonConfigurator__group").forEach(function(e){e.classList.remove("neonConfigurator__group--hasError");let t=e.querySelector(".neonConfigurator__group__buttonContinue");null!=t&&(t.disabled=!1)}),e.el.classList.remove("neonConfigurator--hasError");let t={};t.fields=e.currentFieldData,await e.buildCalculationContext(t);let i=[];return e.fields.forEach(function(a){i.push(e.validateField(a,t).then(function(){void 0!==a.repetitions&&a.isVisible()&&a.repetitions.forEach(function(a){a.forEach(function(a){a.isVisible()&&i.push(e.validateField(a,t))})})}))}),Promise.all(i).then(function(){e.isInvalid()&&e.el.classList.add("neonConfigurator--hasError"),e.$emitter.publish("afterValidated",{isValid:!e.isInvalid()})})}async validateField(e,t){let i=this,a=e.validate(t);return i.$emitter.publish("afterFieldValidated",{isValid:a,field:e,ruleData:t}),a}async setVisibilities(){let e=this;e.$emitter.publish("beforeVisibilityUpdated"),e.currentFieldData=e.convertFieldDataForRule();let t=JSON.stringify(e.currentFieldData),i={};for(let t of(i.fields=e.currentFieldData,await e.buildCalculationContext(i),e.groups)){let a=!0;if(t.hasVisibilityCalculation())try{a=await f.A.calculate(t.visibilityCalculation(),i,"Group visibility")}catch(t){throw e.logError(t),t}a?t.show():t.hide(),e.$emitter.publish("afterGroupVisibilityUpdated",{isVisible:a,group:t,ruleData:i,message:'Group "'+t.groupConfiguration.label+'" is '+(a?"visible":"not visible")})}let a=e.groups.filter(e=>e.isVisible());for(let t of e.groups){let e=t.el.querySelector(".neonConfigurator__group__buttonContinue");if(e){let i=0===a.length||a[a.length-1]===t;e.style.display=i?"none":""}}for(let t of e.fields){i.value=t.value();try{await t.updateVisibility(i)}catch(t){throw e.logError(t),t}}e.$emitter.publish("afterVisibilityUpdated");let r=e.convertFieldDataForRule(),l=JSON.stringify(r)!==t;return e.currentFieldData=r,l}updatePrices(e){let t=this;return new Promise(function(i,a){"cartOnly"===t.options.configuration.priceUpdateMode?(t.hasValidPrice=!0,i()):t.hasBlockPrices()?(t.$emitter.publish("beforeBlockPricesUpdated"),"quantity"===t.options.configuration.blockpriceSelectionMode?0===t.blockPrices.length?(t.hasValidPrice=!0,t.$emitter.publish("afterBlockPricesUpdated"),i()):t.updateBlockPrices().then(function(){t.$emitter.publish("afterBlockPricesUpdated"),i()}).catch(function(){a()}):(t.hasValidPrice=!0,i())):t.updateBasePrice().then(function(r){t.$emitter.publish("afterBasePriceUpdated",{calculatedBasePrice:r}),t.updateMainPrice(e).then(function(e){t.$emitter.publish("afterPriceUpdated",{calculatedPrice:e,hasValidPrice:t.hasValidPrice}),t.updatePriceMetaTags(e),i()}).catch(function(e){t.options.configuration.isDebugActive&&console.error(e),a(e)})}).catch(function(e){t.options.configuration.isDebugActive&&console.error(e),a(e)})})}async getQuantityForBlockprices(e){let t=this;if("calculation"===t.options.configuration.blockpriceSelectionMode)try{return await f.A.calculate(t.options.configuration.blockpriceQuantityCalculation,e,"Blockprice quantity calculation")}catch(e){throw t.logError(e),e}else if("field"!==t.options.configuration.blockpriceSelectionMode||null===t.options.configuration.blockpriceQuantityField)return await t.getQuantity();else for(let e of t.fields)if(e.config.id===t.options.configuration.blockpriceQuantityField.id)return e.value()}applyEditQuantity(){let e=this;if(!e.quantitySelection)return;let t=new URLSearchParams(window.location.search),i=t.get("neonQuantity");if(!t.get("uniqueConfigurationId")||!/^[1-9][0-9]*$/.test(i??""))return;let a=e.quantitySelection.value;e.quantitySelection.value=i,e.quantitySelection.value!==i&&(e.quantitySelection.value=a)}expandValueGroupsWithRestoredValues(e){let t=this;e.forEach(function(e){let i="function"==typeof e?.domField?e.domField():null;i&&i.querySelectorAll(".neonConfigurator__field__valueGroup--closable").forEach(function(e){t.hasSelectedValue(e)&&e.classList.remove("neonConfigurator__field__valueGroup--closed")})})}hasSelectedValue(e){return Array.from(e.querySelectorAll("[data-neon-configurator-field-value]:checked")).some(function(e){let t=e.closest(".
5neonConfigurator__field__value")?.querySelector(".js-quantity-selector");return!t||parseInt(t.value)>0})}async getQuantity(){let e=this,t=1;if("calculation"===e.options.configuration.quantityMode&&e.options.configuration.quantityCalculationId)try{let i={};i.fields=e.currentFieldData,await e.buildCalculationContext(i,!1,!1),t=await f.A.calculate(e.options.configuration.quantityCalculation,i,"Quantity")}catch(t){throw e.logError(t),t}else"field"===e.options.configuration.quantityMode&&e.options.configuration.quantityFieldId?e.getVisibleFields().forEach(function(i){i.config.id===e.options.configuration.quantityFieldId&&(t=i.value())}):t=e.quantitySelection?e.quantitySelection.value:1;return parseInt(t)}async getCurrentBlockPrice(e){let t;let i=this,a=i.options.product.calculatedPrices,r=await i.getQuantityForBlockprices(e);if(0!==a.length){for(let e of a.map((e,t)=>{let i;return i=0===t?1:a[t-1].quantity+1,{...e,fromQuantity:i}}))r>=e.fromQuantity&&(t=void 0!==e.calculatedUnitPrice?e.calculatedUnitPrice:e.unitPrice);void 0!==t?e.product.price=t:e.product.price=void 0!==a[0].calculatedUnitPrice?a[0].calculatedUnitPrice:a[0].unitPrice}}updateBlockPrices(){let e=this;e.calculatedBlockPrices=[];let t=0,i=[];for(;t<e.blockPrices.length;)i.push(e.updateBlockPrice(t)),t++;return Promise.all(i)}updateBlockPrice(e){let t=this;return t.calculatePrice(t.options.product.calculatedPrices[e].unitPrice,t.options.configuration.priceCalculation,"Graduate prices").then(function(i){t.$emitter.publish("afterBlockPriceUpdated",{calculatedPrice:i,priceIndex:e,originalUnitPrice:t.options.product.calculatedPrices[e].unitPrice});let a=t.blockPrices[e];if(!a)return;let r=a.closest(".product-block-prices-cell")?.querySelector(".list-price-price");return s.update(i,[a],t.decimalSign,t.thousandSeparator,t.decimalDigitCount),t.options.product.calculatedPrices[e].calculatedUnitPrice=i,r&&null!==t.options.product.calculatedPrices[e].listPrice&&t.calculatePrice(t.options.product.calculatedPrices[e].listPrice.price,t.options.configuration.priceCalculation,"Graduate prices list price").then(function(e){s.update(e,[r],t.decimalSign,t.thousandSeparator,t.decimalDigitCount)}).catch(function(e){t.logError(e)}),i})}async updateMainPrice(e){let t;let i=this;if(!e&&i.options.configuration.cheapestPrice?(i.hasValidPrice=!0,t=i.options.configuration.cheapestPrice):t=await i.calculatePrice(i.options.product.price,i.options.configuration.priceCalculation,"Main price"),null!=i.listPrice&&i.listPrice&&i.options.product.hasGlobalPriceDiscount&&(t*=1-i.options.product.listPrice.percentage/100),i.lastCalculatedPrice=t,i.price){if(s.update(t,[i.price],i.decimalSign,i.thousandSeparator,i.decimalDigitCount,!e&&i.options.configuration.showFromPriceprefixForUntouchedConfiguration?i.options.translations.fromLabel:""),i.options.product.listPrice&&i.options.product.listPrice.percentage>0){if(i.listPrice){let e;let a=Math.abs(i.options.product.listPrice.discount)/i.options.product.listPrice.price*100;e=i.options.product.hasGlobalPriceDiscount?t/(1-a/100):i.options.product.price/(1-a/100)+(t-i.options.product.price),s.update(e,[i.listPrice],i.decimalSign,i.thousandSeparator,i.decimalDigitCount),i.updateListPricePercentage(t,e)}else throw"List price is available but list price element was not found."}}else i.hasValidPrice=!0;return t}updateListPricePercentage(e,t){let i=this;if(!i.listPricePercentage||null==e||isNaN(e)||!t||isNaN(t)||t<=0)return;let a=String(Math.round((t-e)/t*1e4)/100).replace(".",i.decimalSign);i.listPricePercentage.textContent=i.listPricePercentage.textContent.replace(/\d+(?:[.,]\d+)?/,a)}updatePriceMetaTags(e){let t=null!=e&&!isNaN(e),i=document.querySelector('[itemprop="offers"] [itemprop="price"]');i&&i.setAttribute("content",t?parseFloat(e).toFixed(2):this.originalMetaPrice||"");let a=document.querySelector('meta[property="product:price:amount"]');a&&a.setAttribute("content",t?parseFloat(e).toFixed(2):this.originalOgPrice||"")}updateBasePrice(){let e=this;return new Promise(function(t){e.options.configuration.isBasePriceCalculationActive&&null!==e.options.configuration.basePriceCalculation&&(null!==e.options.configuration.basePriceCalculation.jsonFormula||null!==e.options.configuration.basePriceCalculation.stringFormula)?e.calculatePrice(e.options.product.price,e.options.configuration.basePriceCalculation,"Base price").then(function(i){e.basePrice&&s.update(i,[e.basePrice],e.decimalSign,e.thous
5andSeparator,e.decimalDigitCount),t(i)}).catch(function(i){e.logError(i),t(null)}):t(null)})}async calculatePrice(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Main price",a=this,r={};r.fields=a.currentFieldData,await a.buildCalculationContext(r),r.product=JSON.parse(JSON.stringify(a.options.product)),r.product.price=e;let l=await f.A.calculateWithoutCommoncalculationCache(t,r,i);return null!==l&&isNaN(l)&&""!==l?(a.hasValidPrice=!1,a.logError(new P.A(i+" calculation returned NaN or empty string. Check if all subcalculations return valid numbers","price",t,"pro"===t.type?t.jsonFormula:t.stringFormula,r,null)),a.$emitter.publish("afterPriceCalculated",{calculatedPrice:NaN,hasValidPrice:a.hasValidPrice,priceType:i,calculation:t,ruleData:r}),NaN):(a.hasValidPrice=!0,a.$emitter.publish("afterPriceCalculated",{calculatedPrice:l,hasValidPrice:a.hasValidPrice,priceType:i,calculation:t,ruleData:r}),l)}convertFieldDataForRule(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this,i={};return t.fields.forEach(function(t){if(t.isAvailableInCart()&&(t.isVisible()||!e)&&void 0!==t.key){i[t.key]={value:t.value(),valueLabel:t.valueLabel(),label:t.config.label,key:t.key,price:t.isVisible()?t.price():0};let e=t.getAllSubconfigurations();null!==e?i[t.key].configuration=e:"select"===t.config.type&&(i[t.key].configuration={price:0,fields:[],calculations:[]}),i[t.key]=Object.assign(i[t.key],t.attributes());let a=t.quantity();if(t.isVisible()?a||0===a?i[t.key].quantity=a:i[t.key].quantity=1:i[t.key].quantity=0,"select"===t.config.type&&t.config.valueGroups&&t.config.valueGroups.length>0){let e=t.value();if(t.config.options.isMultiselect&&Array.isArray(e))i[t.key].value=e.map(function(e){let i=null;for(let a of t.config.valueGroups)if(i=a.values.find(t=>t.value===e.value))break;return i&&i.options&&i.options.productData?{...e,product:i.options.productData}:e});else if(e){let a=null;for(let i of t.config.valueGroups)if(a=i.values.find(t=>t.value===e))break;a&&a.options&&a.options.productData&&(i[t.key].product=a.options.productData)}}}}),i}isInvalid(){let e=this;return e.getInvalidFields().length>0}getVisibleFields(){let e=this;return e.fields.filter(function(e){return e.isVisible()})}getInvalidFields(){let e=this;return e.getVisibleFields().filter(function(e){return!e.isValid()})}updateLineItemId(){let e=this;if(null!==e.form){let t=e.form.querySelectorAll("[name^=lineItems\\[]"),i=e.options.product.productNumber;e.fields.forEach(function(e){i+=e.getValueForUniqueIdHash()});let a=r().hash(e.options.configuration.splitLineItemsWithSameConfiguration?i+new Date().getTime():i);t.forEach(function(e){let t=e.getAttribute("name");e.setAttribute("name",t.replace(/lineItems\[[a-zA-Z0-9]*](.*)/,"lineItems["+a+"]$1")),e.getAttribute("name").indexOf("[id]")>0&&(e.value=a)}),e.$emitter.publish("listItemIdUpdated")}}async updateCalculationFields(){let e=this;for(let t of(e.currentFieldData=e.convertFieldDataForRule(),e.fields)){let i=e.currentFieldData;if(t.needsValueUpdateOnRefresh()){let a={};a.value=t.value(),a.fields=i,await e.buildCalculationContext(a),await t.calculateNewValue(a,e.options.configuration.commoncalculations,e.commoncalculationCache),a.value=t.value()}if(void 0!==t.repetitions){for(let a of t.repetitions)for(let t of a)if(t.needsValueUpdateOnRefresh()){let a={};a.value=t.value(),a.fields=i,await e.buildCalculationContext(a),await t.calculateNewValue(a,e.options.configuration.commoncalculations,e.commoncalculationCache),a.value=t.value()}}}}hasBlockPrices(){let e=this;return null!==e.options.product.calculatedPrices&&e.options.product.calculatedPrices.length>1}async buildCalculationContext(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];e.params=this.options.params,e.context=this.options.context,e.salesChannel=this.options.salesChannel,e.product=this.options.product,e.calculations=this.commoncalculationCache,e.calculationFormulas=this.commoncalculationFormulaCache,e.global={calculations:this.globalCalculations},t&&(e.selectedQuantity=await this.getQuantity()),e.customerGroup=this.options.customerGroup,i&&this.hasBlockPrices()&&await this.getCurrentBlockPrice(e),void 0!==this.options.parent&&void 0!==this.options.parent.configurationState&&(e.parent=this.options.parent.configurationState)}async updateDeliveryTime(){let e=this,t={};if(t.fields=e.currentFieldData,await e.buildCalculationContext(t),null!==e.options.configuration.deliverytimeCalculation&&(null!==e.options.configuration.deliverytimeCalculation.stringFormula||null!==e.options.configuration.deliverytimeCalculation.jsonFormula))try{let i;let a=await f.A.calculate(e.options.configuration.deliverytimeCalculation,t,"Delivery time"),r=e.options.configuration.deliverytimeName;if("1"===e.options.configuration.deliverytimeMaxUseCalculation&&(null!==e.options.configuration.deliverytimeMaxCalculation.stringFormula||null!==e.options.configuration.deliverytimeMaxCalculation.jsonFormula))try{i=await f.A.calculate(e.options.configuration.deliverytimeMaxCalculation,t,"Max delivery time"),r=e.options.configuration.deliverytimeMaxUseAdding?r.replace("{min}",a).replace("{max}",a+parseInt(i)):r.replace("{min}",a).replace("{max}",i)}catch(t){throw e.logError(t),t}else i=parseInt(e.options.configuration.deliverytimeMax),r=r.replace("{min}",a).replace("{max}",a+i);
5e.deliveryTime&&e.deliveryTime.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&""!==e.nodeValue.trim()&&(e.textContent=r)}),e.$emitter.publish("afterDeliveryTimeUpdated",{name:r,minTime:a,maxTime:i})}catch(t){throw e.logError(t),t}}async updateProductNumber(){let e=this;if(!e.options.configuration.isProductNumberConfiguratorActive)return Promise.resolve();{let t={fields:e.currentFieldData,calculations:e.commoncalculationCache},i={configurationId:e.options.configuration.id,productId:e.options.product.id,userData:JSON.stringify(t)};return new Promise(function(t){let a=()=>{let i=e.options.product.productNumber;e.productNumber.textContent=i,e.$emitter.publish("afterProductNumberUpdated",{productNumber:i}),t()},r=new XMLHttpRequest;r.open("POST",e.options.productNumberCalculationUrl,!0),r.send(JSON.stringify(i)),r.onload=()=>{try{let i=JSON.parse(r.responseText).productNumber;e.productNumber.textContent=i,e.$emitter.publish("afterProductNumberUpdated",{productNumber:i}),t()}catch(e){a()}},r.onerror=()=>{a()}})}}async updateProductImage(){let e=this;return new Promise(function(t){if(!e.productImageGalleryContainer)return t(!1);clearTimeout(e.imageUpdateTimer),e.imageUpdateTimer=setTimeout(async function(){let i={};i.fields=e.currentFieldData,await e.buildCalculationContext(i),e.options.configuration.isDebugActive&&e.debugModule.addMessage("Additional media count: "+h.getAdditionalMediaIds(e.fields).length);let a=await A.update({galleryContainer:e.productImageGalleryContainer,configuration:e.options.configuration,ruleData:i,fields:e.fields,previousImageSet:e.previousImageSet,logError:t=>e.logError(t)});a.updated?(e.debugModule.addMessage("Image update necessary"),e.$emitter.publish("afterImageUpdated",{additionalMediaIds:a.additionalMediaIds,hiddenMediaStructure:a.hiddenMediaStructure}),t(!0)):(e.debugModule.addMessage("No image update necessary"),t(!1))},e.options.imageUpdateTimeout)})}removeLoader(){let e=this;e.el.classList.remove("neonConfigurator--isLoading")}async executeFieldCallbackBeforeUpdate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this;if(void 0!==e.callbackBeforeUpdate){let a=t;null===a&&((a={}).fields=i.currentFieldData,await i.buildCalculationContext(a)),await e.callbackBeforeUpdate(a)}}async executeFieldcallbackBeforeUpdateSubcalculationAware(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this;if(void 0!==e.callbackBeforeUpdateSubcalculationAware){let a=t;null===a&&((a={}).fields=i.currentFieldData,await i.buildCalculationContext(a)),await e.callbackBeforeUpdateSubcalculationAware(a)}}getFieldById(e){return this.fields.find(t=>t.config.id===e)}logError(e){this.debugModule.logError(e),this.removeRefreshingLoader()}addFromPriceLabelIfNecessary(){let e=this;e.options.configuration.showFromPriceprefixForUntouchedConfiguration&&null!=e.price&&e.price.insertAdjacentHTML("afterbegin",'<span class="product-detail-price-prefix">'+e.options.translations.fromLabel+"</span>")}setParent(e){let t=this;t.parentConfiguratorPlugin=e}disableCartButton(){let e=this,t=e.el.closest(".product-detail-buy, .cms-element-buy-box").querySelector(".btn-buy"),i=e.el.closest(".product-detail-buy, .cms-element-buy-box").querySelector("#swag-amazon-pay-product-detail-wrapper");null!=t&&(t.disabled=!0,t.classList.add("is--disabled")),null!==i&&i.classList.add("is--disabled")}getCartButton(){let e=this;return e.el.closest(".product-detail-buy, .cms-element-buy-box").querySelector(".btn-buy")}enableCartButton(){let e=this,t=e.el.closest(".product-detail-buy, .cms-element-buy-box").querySelector(".btn-buy, .btn-save-subconfiguration"),i=e.el.closest(".product-detail-buy, .cms-element-buy-box").querySelector("#swag-amazon-pay-product-detail-wrapper");null!==t&&(t.disabled=!1,t.classList.remove("is--disabled")),null!==i&&i.classList.remove("is--disabled")}constructor(...e){super(...e),this.CalculatorServiceUtil=f.A,this.dynamicTextElements=[]}}},860(e,t,i){"use strict";i.d(t,{A:()=>u});var a=i(592);let r="js-pseudo-modal",l="js-pseudo-modal-template",n="js-pseudo-modal-template-content-element",o="js-pseudo-modal-template-title-element",s="js-pseudo-modal-template-root-element";class u{constructor(e,t=!0,i=`.${l}`,a=`.${n}`,r=`.${o}`){this._content=e,this._useBackdrop=t,this._templateSelector=i,this._templateContentSelector=a,this._templateTitleSelector=r}open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Kq;this._hideExistingModal(),this._create(),setTimeout(this._open.bind(this,e),t)}close(){let e=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(e),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(e,t){this._content=e,this._setModalContent(e),this.updatePosition(),"function"==typeof t&&t.bind(this)()}_hideExistingModal(){try{let e=document.querySelector(`.${r} .modal`);if(!e)return;let t=bootstrap.Modal.getInstance(e);if(!t)return;t.hide()}catch(e){console.warn(`[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ${e.message}`)}}_open(e){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",e),this._modal.addEventListener("hide.bs.modal",()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}),this._modalInstance.show()}_create(){this._modalMarkupEl=document.querySelector(this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMar
5kup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=document.querySelector(`.${r}`),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(r))}_createModalMarkup(){let e=this._modalWrapper.querySelector(".modal");if(e)return e;let t=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(t),this._modalWrapper.querySelector(".modal")}_setModalTitle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{this._modalWrapper.querySelector(this._templateTitleSelector).innerHTML=e}catch(e){}}_setModalContent(e){let t=this._modalWrapper.querySelector(this._templateContentSelector);t.innerHTML=e;let i=t.querySelector(`.${s}`);if(i){this._modalWrapper.querySelector(`.${s}`).replaceChildren(i);return}try{let e=t.querySelector(this._templateTitleSelector);e&&(this._setModalTitle(e.innerHTML),e.parentNode.removeChild(e))}catch(e){}}}},891(e,t,i){"use strict";i.d(t,{A:()=>a});class a extends Error{constructor(e,t,i,a,r,l,n=null){super(e),this.calculationDebugContext=null,this.fieldLabel=null,this.fieldKey=null,this.message=e,this.calculationType=t,this.calculation=i,this.formula=a,this.ruleData=r,this.innerException=l,n&&(this.fieldLabel=n.label,this.fieldKey=n.key)}}}}]);
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.