/*! * Bootstrap Native Toast v5.1.10 (https://thednp.github.io/bootstrap.native/) * Copyright 2026 © thednp * Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE) */ "use strict"; import { Data, ObjectKeys, Timer, addClass, closest, createCustomEvent, dispatchEvent, emulateTransitionEnd, focusinEvent, focusoutEvent, getAttribute, getDocument, getInstance, hasClass, isElement, isString, mouseclickEvent, mouseenterEvent, mouseleaveEvent, normalizeOptions, querySelector, querySelectorAll, reflow, removeClass } from "@thednp/shorty"; import { addListener, removeListener } from "@thednp/event-listener"; //#region src/strings/fadeClass.ts /** * Global namespace for most components `fade` class. */ const fadeClass = "fade"; //#endregion //#region src/strings/showClass.ts /** * Global namespace for most components `show` class. */ const showClass = "show"; //#endregion //#region src/strings/dataBsDismiss.ts /** * Global namespace for most components `dismiss` option. */ const dataBsDismiss = "data-bs-dismiss"; //#endregion //#region src/strings/dataBsToggle.ts /** * Global namespace for most components `toggle` option. */ const dataBsToggle = "data-bs-toggle"; //#endregion //#region src/strings/toastString.ts /** @type {string} */ const toastString = "toast"; //#endregion //#region src/strings/toastComponent.ts /** @type {string} */ const toastComponent = "Toast"; //#endregion //#region src/strings/dataBsTarget.ts /** * Global namespace for most components `target` option. */ const dataBsTarget = "data-bs-target"; //#endregion //#region src/strings/dataBsParent.ts /** * Global namespace for most components `parent` option. */ const dataBsParent = "data-bs-parent"; //#endregion //#region src/strings/dataBsContainer.ts /** * Global namespace for most components `container` option. */ const dataBsContainer = "data-bs-container"; //#endregion //#region src/util/getTargetElement.ts /** * Returns the `Element` that THIS one targets * via `data-bs-target`, `href`, `data-bs-parent` or `data-bs-container`. * * @param element the target element * @returns the query result */ const getTargetElement = (element) => { const targetAttr = [ dataBsTarget, dataBsParent, dataBsContainer, "href" ]; const doc = getDocument(element); return targetAttr.map((att) => { const attValue = getAttribute(element, att); if (attValue) return att === "data-bs-parent" ? closest(element, attValue) : querySelector(attValue, doc); return null; }).filter((x) => x)[0]; }; //#endregion //#region src/util/isDisabled.ts /** * Check if interactive element is disabled. * @param target either a `