var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var stdin_exports = {};
__export(stdin_exports, {
  default: () => useStyle
});
module.exports = __toCommonJS(stdin_exports);
var import_pro_provider = require("@antdv/pro-provider");
function textOverflowEllipsis() {
  return {
    overflow: "hidden",
    whiteSpace: "nowrap",
    textOverflow: "ellipsis"
  };
}
const genPageHeaderStyle = (token) => {
  var _a, _b, _c, _d;
  return {
    [token.componentCls]: __spreadProps(__spreadValues({}, (_a = import_pro_provider.resetComponent) == null ? void 0 : _a(token)), {
      "position": "relative",
      "backgroundColor": token.colorWhite,
      "paddingBlock": token.pageHeaderPaddingVertical + 2,
      "paddingInline": token.pageHeaderPadding,
      "&&-ghost": {
        backgroundColor: token.pageHeaderBgGhost
      },
      "&-no-children": {
        height: (_c = (_b = token.layout) == null ? void 0 : _b.pageContainer) == null ? void 0 : _c.paddingBlockPageContainerContent
      },
      "&&-has-breadcrumb": {
        paddingBlockStart: token.pageHeaderPaddingBreadCrumb
      },
      "&&-has-footer": {
        paddingBlockEnd: 0
      },
      "& &-back": {
        "marginInlineEnd": token.margin,
        "fontSize": 16,
        "lineHeight": 1,
        "&-button": __spreadProps(__spreadValues({
          fontSize: 16
        }, (_d = import_pro_provider.operationUnit) == null ? void 0 : _d(token)), {
          color: token.pageHeaderColorBack,
          cursor: "pointer"
        }),
        [`${token.componentCls}-rlt &`]: {
          float: "right",
          marginInlineEnd: 0,
          marginInlineStart: 0
        }
      },
      [`& ${"ant"}-divider-vertical`]: {
        height: 14,
        marginBlock: 0,
        marginInline: token.marginSM,
        verticalAlign: "middle"
      },
      [`& &-breadcrumb + &-heading`]: {
        marginBlockStart: token.marginXS
      },
      "& &-heading": {
        "display": "flex",
        "justifyContent": "space-between",
        "&-left": {
          display: "flex",
          alignItems: "center",
          marginBlock: token.marginXS / 2,
          marginInlineEnd: 0,
          marginInlineStart: 0,
          overflow: "hidden"
        },
        "&-title": __spreadProps(__spreadValues({
          marginInlineEnd: token.marginSM,
          marginBlockEnd: 0,
          color: token.colorTextHeading,
          fontWeight: 600,
          fontSize: token.pageHeaderFontSizeHeaderTitle,
          lineHeight: `${token.controlHeight}px`
        }, textOverflowEllipsis()), {
          [`${token.componentCls}-rlt &`]: {
            marginInlineEnd: 0,
            marginInlineStart: token.marginSM
          }
        }),
        "&-avatar": {
          marginInlineEnd: token.marginSM,
          [`${token.componentCls}-rlt &`]: {
            float: "right",
            marginInlineEnd: 0,
            marginInlineStart: token.marginSM
          }
        },
        "&-tags": {
          [`${token.componentCls}-rlt &`]: {
            float: "right"
          }
        },
        "&-sub-title": __spreadProps(__spreadValues({
          marginInlineEnd: token.marginSM,
          color: token.colorTextSecondary,
          fontSize: token.pageHeaderFontSizeHeaderSubTitle,
          lineHeight: token.lineHeight
        }, textOverflowEllipsis()), {
          [`${token.componentCls}-rlt &`]: {
            float: "right",
            marginInlineEnd: 0,
            marginInlineStart: 12
          }
        }),
        "&-extra": {
          "marginBlock": token.marginXS / 2,
          "marginInlineEnd": 0,
          "marginInlineStart": 0,
          "whiteSpace": "nowrap",
          "> *": {
            "white-space": "unset",
            [`${token.componentCls}-rlt &`]: {
              marginInlineEnd: token.marginSM,
              marginInlineStart: 0
            }
          },
          [`${token.componentCls}-rlt &`]: {
            float: "left"
          },
          "*:first-child": {
            [`${token.componentCls}-rlt &`]: {
              marginInlineEnd: 0
            }
          }
        }
      },
      "&-content": {
        paddingBlockStart: token.pageHeaderPaddingContentPadding
      },
      "&-footer": {
        marginBlockStart: token.margin
      },
      "&-compact &-heading": {
        flexWrap: "wrap"
      },
      "&-wide": {
        maxWidth: 1152,
        margin: "0 auto"
      },
      "&-rtl": {
        direction: "rtl"
      }
    })
  };
};
function useStyle(prefixCls) {
  return (0, import_pro_provider.useStyle)("ProLayoutPageHeader", (token) => {
    const proCardToken = __spreadProps(__spreadValues({}, token), {
      componentCls: `.${prefixCls.value}`,
      pageHeaderBgGhost: "transparent",
      pageHeaderPadding: 16,
      pageHeaderPaddingVertical: 4,
      pageHeaderPaddingBreadCrumb: token.paddingSM,
      pageHeaderColorBack: token.colorTextHeading,
      pageHeaderFontSizeHeaderTitle: token.fontSizeHeading4,
      pageHeaderFontSizeHeaderSubTitle: 14,
      pageHeaderPaddingContentPadding: token.paddingSM
    });
    return [genPageHeaderStyle(proCardToken)];
  });
}
