export function onFindOnce(selectors, callback) {
    if (Array.isArray(selectors)) {
        selectors = selectors.join(',');
    }
    if (document.querySelector(selectors)) {
        callback();
        return;
    }
    let called = false;
    const observer = new MutationObserver(() => {
        if (document.querySelector(selectors)) {
            observer.disconnect();
            if (!called) {
                called = true;
                callback();
            }
        }
    });
    observer.observe(document, {
        attributes: true,
        childList: true,
        subtree: true,
    });
}
//# sourceMappingURL=onFindOnce.js.map