{"version":3,"file":"product-inner.js","sources":["../../src/js/templates/product-inner.js"],"sourcesContent":["(function () {\r\n const productOptions = document.querySelectorAll(\".js-productSelectOption\");\r\n const productSelectors = document.querySelectorAll(\".js-productSelector\");\r\n const productColour = document.querySelectorAll(\".js-productColour\");\r\n let i = 0;\r\n productSelectors.forEach(function (selector, idx) {\r\n selector.addEventListener(\"click\", function () {\r\n productSelectors.forEach(function (s) {\r\n if (s === selector) {\r\n s.classList.add(\"active\");\r\n } else {\r\n s.classList.remove(\"active\");\r\n }\r\n });\r\n productOptions.forEach(function (option, j) {\r\n if (j === idx) {\r\n option.classList.add(\"active\");\r\n } else {\r\n option.classList.remove(\"active\");\r\n }\r\n });\r\n\r\n setProductColourName(this);\r\n });\r\n\r\n if (i === 0) {\r\n setProductColourName(selector);\r\n }\r\n\r\n i++;\r\n });\r\n\r\n function setProductColourName(el) {\r\n const name = el.dataset.name;\r\n\r\n if (name !== '' && productColour) {\r\n productColour.forEach(function (s) {\r\n s.innerHTML = name;\r\n });\r\n }\r\n }\r\n})();\r\n"],"names":["productOptions","document","querySelectorAll","productSelectors","productColour","i","forEach","selector","idx","addEventListener","s","classList","add","remove","option","j","setProductColourName","el","name","dataset","innerHTML"],"mappings":"AAAA,CAAC,YAAY;AACT,EAAA,IAAMA,cAAc,GAAGC,QAAQ,CAACC,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;AAC3E,EAAA,IAAMC,gBAAgB,GAAGF,QAAQ,CAACC,gBAAgB,CAAC,qBAAqB,CAAC,CAAA;AACzE,EAAA,IAAME,aAAa,GAAGH,QAAQ,CAACC,gBAAgB,CAAC,mBAAmB,CAAC,CAAA;EACpE,IAAIG,CAAC,GAAG,CAAC,CAAA;AACTF,EAAAA,gBAAgB,CAACG,OAAO,CAAC,UAAUC,QAAQ,EAAEC,GAAG,EAAE;AAC9CD,IAAAA,QAAQ,CAACE,gBAAgB,CAAC,OAAO,EAAE,YAAY;AAC3CN,MAAAA,gBAAgB,CAACG,OAAO,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