import { __spreadArray } from "tslib";
var __DEV__ = process.env.NODE_ENV !== 'production';
var warningOnce = function (_shouldBeTrue, _id, _format) {
    var _args = [];
    for (var _i = 3; _i < arguments.length; _i++) {
        _args[_i - 3] = arguments[_i];
    }
};
if (__DEV__) {
    var warningCache_1 = {};
    var printWarning_1 = function (format) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var argIndex = 0;
        var message = 'Warning: ' + format.replace(/%s/g, function () { return args[argIndex++]; });
        if (typeof console !== 'undefined') {
            console.error(message);
        }
        try {
            throw new Error(message);
        }
        catch (x) {
        }
    };
    warningOnce = function (shouldBeTrue, id, format) {
        var args = [];
        for (var _i = 3; _i < arguments.length; _i++) {
            args[_i - 3] = arguments[_i];
        }
        if (id === undefined) {
            throw new Error('`warningOnce(shouldBeTrue, id, format, ...args)` requires a warning ' +
                'id argument');
        }
        if (format === undefined) {
            throw new Error('`warningOnce(shouldBeTrue, id, format, ...args)` requires a warning ' +
                'message argument');
        }
        if (!warningCache_1[id] && !shouldBeTrue) {
            warningCache_1[id] = true;
            printWarning_1.apply(void 0, __spreadArray([format], args));
        }
    };
}
export { warningOnce };
