/*!
 * Custom elements for Nanopore-Digital Web applications
 */
// import { setPlatformHelpers } from '@stencil/core';
// @ts-expect-error - NAMESPACE isn't officially exported
import { NAMESPACE } from "@stencil/core";
import { setTagPrefix } from "./utils/renderer";
// imperative helpers
export * from './components/alert/alert.helpers';
export * from './components/dialog/dialog.helpers';
export { debounce as nanoDebounce, throttle as nanoThrottle, } from './utils/throttle';
export { getTabbableElements as nanoGetTabElements } from './utils/tabbable';
export function componentPrefix(prefix) {
    if (!window || !document)
        return;
    const tagTransform = setTagPrefix(prefix);
    const autoLoaderScript = document.querySelector(`script[src$="/${NAMESPACE}.esm.js"]`);
    if (autoLoaderScript) {
        autoLoaderScript['data-opts'] = {
            transformTagName: tagTransform,
        };
    }
    return tagTransform;
}
export { getTagPrefix, transformTag } from './utils/renderer';
export const initialize = (helpers = {}) => {
    if (typeof window === 'undefined') {
        return;
    }
    const platformHelpers = {};
    if (helpers._ael) {
        platformHelpers.ael = helpers._ael;
    }
    if (helpers._rel) {
        platformHelpers.rel = helpers._rel;
    }
    if (helpers._ce) {
        platformHelpers.ce = helpers._ce;
    }
    // setPlatformHelpers(platformHelpers);
};
export * from './components';
