"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get IS_REACT_18 () {
        return IS_REACT_18;
    },
    get safeFlushSync () {
        return safeFlushSync;
    },
    get safeUseId () {
        return safeUseId;
    }
});
var _react = /*#__PURE__*/ _interop_require_default(require("react"));
var _reactdom = /*#__PURE__*/ _interop_require_default(require("react-dom"));
var _useUniqId = require("../hooks/useUniqId");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
// TODO: https://github.com/salute-developers/plasma/issues/233
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var flushSync = _reactdom.default.flushSync;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var useId = _react.default.useId;
var IS_REACT_18 = _reactdom.default.version.split('.')[0] === '18';
function safeFlushSync(fn) {
    if (!IS_REACT_18) {
        return fn();
    }
    return flushSync(fn);
}
var safeUseId = !IS_REACT_18 ? _useUniqId.useUniqId : useId;
