"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextConsumer = exports.ContextProvider = void 0;
var React = __importStar(require("react"));
var constants_1 = require("./constants");
var get_framepay_api_1 = __importDefault(require("./get-framepay-api"));
var defaultContextValue = {
    api: (0, get_framepay_api_1.default)(),
    error: null,
    ready: false,
};
var ProvidedContext;
if (/^15.*/.test(constants_1.REACT_VERSION) || /^0.14.*/.test(constants_1.REACT_VERSION)) {
    var createReactContext = require('create-react-context');
    ProvidedContext = createReactContext(defaultContextValue);
}
else {
    ProvidedContext = React.createContext(defaultContextValue);
}
var ContextProvider = ProvidedContext.Provider;
exports.ContextProvider = ContextProvider;
var ContextConsumer = ProvidedContext.Consumer;
exports.ContextConsumer = ContextConsumer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY29udGV4dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSwyQ0FBK0I7QUFDL0IseUNBQTRDO0FBQzVDLHdFQUFnRDtBQUdoRCxJQUFNLG1CQUFtQixHQUFHO0lBQ3hCLEdBQUcsRUFBRSxJQUFBLDBCQUFjLEdBQUU7SUFDckIsS0FBSyxFQUFFLElBQUk7SUFDWCxLQUFLLEVBQUUsS0FBSztDQUNmLENBQUM7QUFFRixJQUFJLGVBQWUsQ0FBQztBQUNwQixJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMseUJBQWEsQ0FBQyxJQUFJLFNBQVMsQ0FBQyxJQUFJLENBQUMseUJBQWEsQ0FBQyxFQUFFLENBQUM7SUFDL0QsSUFBTSxrQkFBa0IsR0FBRyxPQUFPLENBQUMsc0JBQXNCLENBQUMsQ0FBQztJQUMzRCxlQUFlLEdBQUcsa0JBQWtCLENBQUMsbUJBQW1CLENBQUMsQ0FBQztBQUM5RCxDQUFDO0tBQU0sQ0FBQztJQUNKLGVBQWUsR0FBRyxLQUFLLENBQUMsYUFBYSxDQUFrQixtQkFBbUIsQ0FBQyxDQUFDO0FBQ2hGLENBQUM7QUFFRCxJQUFNLGVBQWUsR0FBRyxlQUFlLENBQUMsUUFBUSxDQUFDO0FBR3hDLDBDQUFlO0FBRnhCLElBQU0sZUFBZSxHQUFHLGVBQWUsQ0FBQyxRQUFRLENBQUM7QUFFdkIsMENBQWUifQ==