"use strict";
const toHaveAccessibleDescription$1 = require("../../../../_virtual/to-have-accessible-description.cjs");
const index = require("../../../../_virtual/index3.cjs");
require("./utils.cjs");
const utils = require("../../../../_virtual/utils.cjs");
Object.defineProperty(toHaveAccessibleDescription$1.__exports, "__esModule", {
  value: true
});
toHaveAccessibleDescription$1.__exports.toHaveAccessibleDescription = toHaveAccessibleDescription;
var _domAccessibilityApi = index;
var _utils = utils.__exports;
function toHaveAccessibleDescription(htmlElement, expectedAccessibleDescription) {
  (0, _utils.checkHtmlElement)(htmlElement, toHaveAccessibleDescription, this);
  const actualAccessibleDescription = (0, _domAccessibilityApi.computeAccessibleDescription)(htmlElement);
  const missingExpectedValue = arguments.length === 1;
  let pass = false;
  if (missingExpectedValue) {
    pass = actualAccessibleDescription !== "";
  } else {
    pass = expectedAccessibleDescription instanceof RegExp ? expectedAccessibleDescription.test(actualAccessibleDescription) : this.equals(actualAccessibleDescription, expectedAccessibleDescription);
  }
  return {
    pass,
    message: () => {
      const to = this.isNot ? "not to" : "to";
      return (0, _utils.getMessage)(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleDescription.name}`, "element", ""), `Expected element ${to} have accessible description`, expectedAccessibleDescription, "Received", actualAccessibleDescription);
    }
  };
}
module.exports = toHaveAccessibleDescription$1.__exports;
//# sourceMappingURL=to-have-accessible-description.cjs.map
