"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useAmityPage = exports.useAmityElement = exports.useAmityComponent = void 0;
var _enums = require("../enums");
var _useConfig = _interopRequireDefault(require("./useConfig"));
var _useGenerateThemeStyles = require("./useGenerateThemeStyles");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const useAmityElement = ({
  pageId,
  componentId,
  elementId
}) => {
  const uiReference = `${pageId}/${componentId}/${elementId}`;
  const {
    excludes,
    getDefaultConfig,
    getUiKitConfig
  } = (0, _useConfig.default)();
  const config = getUiKitConfig({
    page: pageId,
    component: componentId,
    element: elementId
  });
  const defaultConfig = getDefaultConfig(uiReference);
  //@ts-ignore
  const themeStyles = (0, _useGenerateThemeStyles.useGenerateThemeStyles)(config);
  const isExcluded = excludes.includes(uiReference);
  const accessibilityId = uiReference;
  return {
    config,
    defaultConfig,
    uiReference,
    accessibilityId,
    themeStyles,
    isExcluded
  };
};
exports.useAmityElement = useAmityElement;
const useAmityComponent = ({
  pageId,
  componentId
}) => {
  const elementId = _enums.ElementID.WildCardElement;
  return useAmityElement({
    pageId,
    componentId,
    elementId
  });
};
exports.useAmityComponent = useAmityComponent;
const useAmityPage = ({
  pageId
}) => {
  const componentId = _enums.ComponentID.WildCardComponent;
  const elementId = _enums.ElementID.WildCardElement;
  return useAmityElement({
    pageId,
    componentId,
    elementId
  });
};
exports.useAmityPage = useAmityPage;
//# sourceMappingURL=useUiKitReference.js.map