(function (Drupal) {
  'use strict';

  /**
   * Override for provusAccordionCanvas behavior.
   *
   * The original behavior from provus_base_theme dynamically sets
   * `data-bs-parent` on accordion items after initial render.
   *
   * This causes issues with Bootstrap collapse (e.g. content opening
   * only on the second click), because Bootstrap expects this attribute
   * to be present before initialization.
   *
   * In our implementation, `data-bs-parent` is already correctly defined
   * in Twig markup, so this behavior is not needed.
   *
   * Therefore we override it with a no-op to prevent conflicts.
   */
  if (Drupal.behaviors.provusAccordionCanvas) {
    /**
     * Disable problematic attach logic from provusAccordionCanvas.
     * See explanation above.
     */
    Drupal.behaviors.provusAccordionCanvas.attach = function () {
      // no-op
    };
  }
})(Drupal);
