import { jsx } from "react/jsx-runtime";
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
import { unlock } from "../../lock-unlock";
const BACKGROUND_DEFAULT_VALUES = {
  backgroundSize: "auto"
};
const {
  useGlobalStyle,
  useGlobalSetting,
  BackgroundPanel: StylesBackgroundPanel
} = unlock(blockEditorPrivateApis);
function hasBackgroundImageValue(style) {
  return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === "string";
}
function BackgroundPanel() {
  const [style] = useGlobalStyle("", void 0, "user", {
    shouldDecodeEncode: false
  });
  const [inheritedStyle, setStyle] = useGlobalStyle("", void 0, "all", {
    shouldDecodeEncode: false
  });
  const [settings] = useGlobalSetting("");
  return /* @__PURE__ */ jsx(
    StylesBackgroundPanel,
    {
      inheritedValue: inheritedStyle,
      value: style,
      onChange: setStyle,
      settings,
      defaultValues: BACKGROUND_DEFAULT_VALUES
    }
  );
}
export {
  BackgroundPanel as default,
  hasBackgroundImageValue
};
//# sourceMappingURL=background-panel.js.map
