- /**
- * Custom error thrown after attach/detach if one or more behaviors failed.
- * Initializes the JavaScript behaviors for page loads and Ajax requests.
- *
- * @callback Drupal~behaviorAttach
- *
- * @param {HTMLDocument|HTMLElement} context
- * An element to detach behaviors from.
- * @param {?object} settings
- * An object containing settings for the current context. It is rarely used.
- *
- * @see Drupal.attachBehaviors
- */
-
- /**
- * Reverts and cleans up JavaScript behavior initialization.
- *
- * @callback Drupal~behaviorDetach
- *
- * @param {HTMLDocument|HTMLElement} context
- * An element to attach behaviors to.
- * @param {object} settings
- * An object containing settings for the current context.
- * @param {string} trigger
- * One of `'unload'`, `'move'`, or `'serialize'`.
- *
- * @see Drupal.detachBehaviors
- */
-
- /**
- * @typedef {object} Drupal~behavior
- *
- * @prop {Drupal~behaviorAttach} attach
- * Function run on page load and after an Ajax call.
- * @prop {Drupal~behaviorDetach} detach
- * Function run when content is serialized or removed from the page.
- */
-
- /**
- * Holds all initialization methods.
- *
- * @namespace Drupal.behaviors
- *
- * @type {Object.<string, Drupal~behavior>}
- */
-
- /**
- * Defines a behavior to be run during attach and detach phases.
- *
- * Attaches all registered behaviors to a page element.
- *
- * Behaviors are event-triggered actions that attach to page elements,
- * enhancing default non-JavaScript UIs. Behaviors are registered in the
- * {@link Drupal.behaviors} object using the method 'attach' and optionally
- * also 'detach'.
- *
- * {@link Drupal.attachBehaviors} is added below to the `jQuery.ready` event
- * and therefore runs on initial page load. Developers implementing Ajax in
- * their solutions should also call this function after new page content has
- * been loaded, feeding in an element to be processed, in order to attach all
- * behaviors to the new content.
- *
- * Behaviors should use `var elements =
- * $(context).find(selector).once('behavior-name');` to ensure the behavior is
- * attached only once to a given element. (Doing so enables the reprocessing
- * of given elements, which may be needed on occasion despite the ability to
- * limit behavior attachment to a particular element.)
- *
- * @example
- * Drupal.behaviors.behaviorName = {
- * attach: function (context, settings) {
- * // ...
- * },
- * detach: function (context, settings, trigger) {
- * // ...
- * }
- * };
- *
- * @param {HTMLDocument|HTMLElement} [context=document]
- * An element to attach behaviors to.
- * @param {object} [settings=drupalSettings]
- * An object containing settings for the current context. If none is given,
- * the global {@link drupalSettings} object is used.
- *
- * @see Drupal~behaviorAttach
- * @see Drupal.detachBehaviors
- *
- * @throws {Drupal~DrupalBehaviorError}
- */