"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// packages/block-editor/src/hooks/use-border-props.js
var use_border_props_exports = {};
__export(use_border_props_exports, {
  getBorderClassesAndStyles: () => getBorderClassesAndStyles,
  useBorderProps: () => useBorderProps
});
module.exports = __toCommonJS(use_border_props_exports);
var import_style = require("./style");
var import_border = require("./border");
var import_use_multiple_origin_colors_and_gradients = __toESM(require("../components/colors-gradients/use-multiple-origin-colors-and-gradients"));
function getBorderClassesAndStyles(attributes) {
  const border = attributes.style?.border || {};
  const className = (0, import_border.getBorderClasses)(attributes);
  return {
    className: className || void 0,
    style: (0, import_style.getInlineStyles)({ border })
  };
}
function useBorderProps(attributes) {
  const { colors } = (0, import_use_multiple_origin_colors_and_gradients.default)();
  const borderProps = getBorderClassesAndStyles(attributes);
  const { borderColor } = attributes;
  if (borderColor) {
    const borderColorObject = (0, import_border.getMultiOriginColor)({
      colors,
      namedColor: borderColor
    });
    borderProps.style.borderColor = borderColorObject.color;
  }
  return borderProps;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getBorderClassesAndStyles,
  useBorderProps
});
//# sourceMappingURL=use-border-props.js.map
