"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var RequirementModel_exports = {};
__export(RequirementModel_exports, {
  RequirementModel: () => RequirementModel
});
module.exports = __toCommonJS(RequirementModel_exports);
var import_aspects = require("../aspects/index.js");
var import_elements = require("../elements/index.js");
var import_Aspects = require("./Aspects.js");
var import_Model = require("./Model.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const CONSTRAINT = Symbol("constraint");
const CONFORMANCE = Symbol("conformance");
const ACCESS = Symbol("access");
const QUALITY = Symbol("quality");
class RequirementModel extends import_Model.Model {
  tag = import_elements.RequirementElement.Tag;
  get children() {
    return super.children;
  }
  set children(children) {
    super.children = children;
  }
  get discriminator() {
    return this.element;
  }
  get access() {
    return import_Aspects.Aspects.getAspect(this, ACCESS, import_aspects.Access);
  }
  set access(definition) {
    import_Aspects.Aspects.setAspect(this, ACCESS, import_aspects.Access, definition);
  }
  get constraint() {
    return import_Aspects.Aspects.getAspect(this, CONSTRAINT, import_aspects.Constraint);
  }
  set constraint(definition) {
    import_Aspects.Aspects.setAspect(this, CONSTRAINT, import_aspects.Constraint, definition);
  }
  get conformance() {
    return import_Aspects.Aspects.getAspect(this, CONFORMANCE, import_aspects.Conformance);
  }
  set conformance(definition) {
    import_Aspects.Aspects.setAspect(this, CONFORMANCE, import_aspects.Conformance, definition);
  }
  get quality() {
    return import_Aspects.Aspects.getAspect(this, QUALITY, import_aspects.Quality);
  }
  set quality(definition) {
    import_Aspects.Aspects.setAspect(this, QUALITY, import_aspects.Quality, definition);
  }
  static {
    import_Model.Model.types[import_elements.RequirementElement.Tag] = this;
  }
  get requirements() {
    return this.all(RequirementModel);
  }
  valueOf() {
    const result = super.valueOf();
    for (const k of ["conformance", "access", "quality", "constraint"]) {
      const v = this[k];
      if (v && !v.empty) {
        result[k] = v.valueOf();
      }
    }
    return result;
  }
  /**
   * Is the element mandatory?
   */
  get isMandatory() {
    return this.conformance.isMandatory;
  }
}
//# sourceMappingURL=RequirementModel.js.map
