{"remainingRequest":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js??ruleSet[1].rules[0].use[1]!C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\FAQ.js","dependencies":[{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\resources\\assets\\scripts\\blocks\\FAQ.js","mtime":1726847112112},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1726651497274},{"path":"C:\\wamp64\\www\\free-energie\\wp-content\\themes\\digitalcover\\node_modules\\babel-loader\\lib\\index.js","mtime":1726651482652}],"contextDependencies":[],"result":["import Block from './Block';\nexport default class FAQ extends Block {\n  getElems() {\n    this.faqItems = Array.from(this.el.querySelectorAll('.b-faq__item'));\n  }\n  events() {\n    if (this.faqItems) {\n      this.faqItems.forEach((item, index) => {\n        const question = item.querySelector('.b-faq__question');\n        const answer = item.querySelector('.b-faq__answer');\n        if (index === 0) {\n          answer.style.maxHeight = answer.scrollHeight + 'px';\n        }\n        question.addEventListener('click', () => {\n          const currentlyOpen = this.el.querySelector('.b-faq__item.open');\n          if (currentlyOpen && currentlyOpen !== item) {\n            currentlyOpen.querySelector('.b-faq__answer').style.maxHeight = null;\n            currentlyOpen.classList.remove('open');\n          }\n          item.classList.toggle('open');\n          if (item.classList.contains('open')) {\n            answer.style.maxHeight = answer.scrollHeight + 'px';\n          } else {\n            answer.style.maxHeight = null;\n          }\n        });\n      });\n    }\n  }\n}",{"version":3,"names":["Block","FAQ","getElems","faqItems","Array","from","el","querySelectorAll","events","forEach","item","index","question","querySelector","answer","style","maxHeight","scrollHeight","addEventListener","currentlyOpen","classList","remove","toggle","contains"],"sources":["C:/wamp64/www/free-energie/wp-content/themes/digitalcover/resources/assets/scripts/blocks/FAQ.js"],"sourcesContent":["import Block from './Block'\n\nexport default class FAQ extends Block {\n  \n  getElems() {\n    this.faqItems = Array.from(this.el.querySelectorAll('.b-faq__item'))\n  }\n\n  events() {\n    if (this.faqItems) {\n      this.faqItems.forEach((item, index) => {\n        const question = item.querySelector('.b-faq__question')\n        const answer = item.querySelector('.b-faq__answer')\n\n        if (index === 0) {\n          answer.style.maxHeight = answer.scrollHeight + 'px'\n        }\n\n        question.addEventListener('click', () => {\n          const currentlyOpen = this.el.querySelector('.b-faq__item.open')\n\n\n          if (currentlyOpen && currentlyOpen !== item) {\n            currentlyOpen.querySelector('.b-faq__answer').style.maxHeight = null\n            currentlyOpen.classList.remove('open')\n          }\n\n          item.classList.toggle('open')\n\n          if (item.classList.contains('open')) {\n            answer.style.maxHeight = answer.scrollHeight + 'px'\n          } else {\n            answer.style.maxHeight = null\n          }\n        })\n      })\n    }\n  }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,SAAS;AAE3B,eAAe,MAAMC,GAAG,SAASD,KAAK,CAAC;EAErCE,QAAQ,GAAG;IACT,IAAI,CAACC,QAAQ,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACC,EAAE,CAACC,gBAAgB,CAAC,cAAc,CAAC,CAAC;EACtE;EAEAC,MAAM,GAAG;IACP,IAAI,IAAI,CAACL,QAAQ,EAAE;MACjB,IAAI,CAACA,QAAQ,CAACM,OAAO,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;QACrC,MAAMC,QAAQ,GAAGF,IAAI,CAACG,aAAa,CAAC,kBAAkB,CAAC;QACvD,MAAMC,MAAM,GAAGJ,IAAI,CAACG,aAAa,CAAC,gBAAgB,CAAC;QAEnD,IAAIF,KAAK,KAAK,CAAC,EAAE;UACfG,MAAM,CAACC,KAAK,CAACC,SAAS,GAAGF,MAAM,CAACG,YAAY,GAAG,IAAI;QACrD;QAEAL,QAAQ,CAACM,gBAAgB,CAAC,OAAO,EAAE,MAAM;UACvC,MAAMC,aAAa,GAAG,IAAI,CAACb,EAAE,CAACO,aAAa,CAAC,mBAAmB,CAA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