"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _compose = require("@wordpress/compose");
var _useSettings = require("../use-settings");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */
/**
 * Internal dependencies
 */
var _default = exports.default = (0, _compose.createHigherOrderComponent)(WrappedComponent => {
  return props => {
    const [colorsFeature, enableCustomColors] = (0, _useSettings.useSettings)('color.palette', 'color.custom');
    const {
      colors = colorsFeature,
      disableCustomColors = !enableCustomColors
    } = props;
    const hasColorsToChoose = colors && colors.length > 0 || !disableCustomColors;
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedComponent, {
      ...props,
      colors,
      disableCustomColors,
      hasColorsToChoose
    });
  };
}, 'withColorContext');
//# sourceMappingURL=with-color-context.js.map