"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cnPopupFloatingLayerOverlayProps = exports.FLOATING_LAYER_Z_INDEX = void 0;
exports.getPopupContainer = getPopupContainer;
const cn_domain_popup_1 = require("@cainiaofe/cn-domain-popup");
const env_1 = require("./env/index.js");
/**
 * Unified z-index for page-level floating layers (CnPopup, CnTooltip, etc.).
 *
 * Sourced from `@cainiaofe/cn-domain-popup` LAYER tokens so the value stays in
 * sync with the Popup library.  The number must be:
 *   - above Grid header sticky (~10) and Sender schema dropdowns (~1050)
 *   - below LAYER.modal (legacy cn-ui Dialog/Modal range)
 *
 * SCSS files that hardcode `z-index` should reference the same numeric value.
 */
exports.FLOATING_LAYER_Z_INDEX = cn_domain_popup_1.LAYER.popup;
/** Popup / CnPopup container – Birda mounts to scroll wrapper, others to body */
function getPopupContainer() {
    return (0, env_1.isBirda)()
        ? document.querySelector('#cn-ui-page-scroll-container') || document.body
        : document.body;
}
/**
 * Legacy helper for CnPopup (cn-ui overlay system).
 * Kept for backward compatibility with ConditionPanel / CnAiFilter.
 */
exports.cnPopupFloatingLayerOverlayProps = {
    overlayProps: { style: { zIndex: exports.FLOATING_LAYER_Z_INDEX } },
};
