"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.WixPatternsBaseProvider = WixPatternsBaseProvider;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireWildcard(require("react"));
var _CairoProvider = require("./CairoProvider");
var _bexCore = require("@wix/bex-core");
var _wixI18nConfig = require("@wix/bex-utils/@wix/wix-i18n-config");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/providers/WixPatternsBaseProvider.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function WixPatternsBaseProvider({
  value: valueProp,
  children,
  ...rest
}) {
  const [value] = (0, _react.useState)(() => {
    const experiments = (0, _bexCore.experimentsFallbackApi)();
    return {
      useExperiments: () => ({
        ready: true,
        experiments
      }),
      experiments,
      Trans: _wixI18nConfig.Trans,
      ...valueProp,
      user: {
        permissions: [],
        ...valueProp.user
      }
    };
  });
  return /*#__PURE__*/_react.default.createElement(_CairoProvider.CairoProvider, (0, _extends2.default)({}, rest, {
    value: value,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 41,
      columnNumber: 5
    }
  }), children);
}
//# sourceMappingURL=WixPatternsBaseProvider.js.map