/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./assets/src/blocks/accordion/accordion.js":
/*!**************************************************!*\
  !*** ./assets/src/blocks/accordion/accordion.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ initAccordion)
/* harmony export */ });
function initAccordion(wrapper) {
  const items = wrapper.querySelectorAll('.thim-blocks-accordion-item');
  if (!items.length) return;
  const hasActive = Array.from(items).some(item => item.classList.contains('active'));
  if (!hasActive) {
    items[0].classList.add('active');
  }
  items.forEach(item => {
    const question = item.querySelector('.accordion-question-wrapper');
    const answer = item.querySelector('.accordion-answer-wrapper');
    if (question && answer) {
      answer.style.overflow = 'hidden';
      answer.style.transition = 'max-height 0.3s ease';
      answer.style.maxHeight = item.classList.contains('active') ? `${answer.scrollHeight}px` : '0px';
      if (!question.dataset.listenerAttached) {
        question.addEventListener('click', () => {
          const isActive = item.classList.contains('active');
          items.forEach(i => {
            const a = i.querySelector('.accordion-answer-wrapper');
            i.classList.remove('active');
            if (a) {
              a.style.maxHeight = `${a.scrollHeight}px`;
              a.offsetHeight;
              a.style.maxHeight = '0px';
            }
          });
          if (!isActive) {
            item.classList.add('active');
            answer.style.maxHeight = `${answer.scrollHeight}px`;
          }
        });
        question.dataset.listenerAttached = 'true';
      }
    }
  });
}

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
/*!*********************************************!*\
  !*** ./assets/src/blocks/accordion/view.js ***!
  \*********************************************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _accordion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./accordion */ "./assets/src/blocks/accordion/accordion.js");

document.addEventListener('DOMContentLoaded', () => {
  document.querySelectorAll('.thim-blocks-accordion').forEach(_accordion__WEBPACK_IMPORTED_MODULE_0__["default"]);
});
/******/ })()
;
//# sourceMappingURL=view.js.map