"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    SymbolContext: function() {
        return SymbolContext;
    },
    SymbolProvider: function() {
        return SymbolProvider;
    },
    useSymbolContext: function() {
        return useSymbolContext;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
const _hooks = require("@orderly.network/hooks");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
const SymbolContext = /*#__PURE__*/ (0, _react.createContext)({});
const useSymbolContext = ()=>{
    return (0, _react.useContext)(SymbolContext);
};
const SymbolProvider = (props)=>{
    const symbolInfo = (0, _hooks.useSymbolsInfo)()[props.symbol];
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(SymbolContext.Provider, {
        value: {
            base_dp: symbolInfo("base_dp"),
            quote_dp: symbolInfo("quote_dp"),
            base_tick: symbolInfo("base_tick"),
            base: symbolInfo("base"),
            quote: symbolInfo("quote"),
            symbol: props.symbol
        },
        children: props.children
    });
};

//# sourceMappingURL=symbolProvider.js.map