'use strict';

var _tslib = require('./bundle-CxoFSSXv.js');
var React = require('react');
var stringSet = require('./bundle-EhtiN7UV.js');
var index = require('./bundle-BV7y6VDn.js');

function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefaultCompat(React);

var LocalizationContextDefault = {
    stringSet: stringSet.getStringSet('en'),
    dateLocale: index.locale,
};
var LocalizationContext = React__default.default.createContext(LocalizationContextDefault);
var LocalizationProvider = function (props) {
    var children = props.children;
    return React__default.default.createElement(LocalizationContext.Provider, { value: _tslib.__assign(_tslib.__assign({}, LocalizationContextDefault), props) }, children);
};
var useLocalization = function () {
    var context = React__default.default.useContext(LocalizationContext);
    if (!context) {
        throw new Error('`useLocalization` hook must be used within `SendbirdProvider` that includes `LocalizationProvider`.');
    }
    return context;
};

exports.LocalizationContext = LocalizationContext;
exports.LocalizationProvider = LocalizationProvider;
exports.useLocalization = useLocalization;
//# sourceMappingURL=bundle-DDNdw3A9.js.map
