"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 descriptor_exports = {};
__export(descriptor_exports, {
  Descriptor: () => Descriptor,
  DescriptorCluster: () => DescriptorCluster
});
module.exports = __toCommonJS(descriptor_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_Semtag = require("../globals/Semtag.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_DeviceTypeId = require("../datatype/DeviceTypeId.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_ClusterId = require("../datatype/ClusterId.js");
var import_EndpointNumber = require("../datatype/EndpointNumber.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var Descriptor;
((Descriptor2) => {
  let Feature;
  ((Feature2) => {
    Feature2["TagList"] = "TagList";
  })(Feature = Descriptor2.Feature || (Descriptor2.Feature = {}));
  Descriptor2.TlvDeviceType = (0, import_TlvObject.TlvObject)({
    /**
     * This shall indicate the device type definition. The endpoint shall conform to the device type definition and
     * cluster specifications required by the device type.
     *
     * @see {@link MatterSpecification.v142.Core} § 9.5.5.1.1
     */
    deviceType: (0, import_TlvObject.TlvField)(0, import_DeviceTypeId.TlvDeviceTypeId),
    /**
     * This is the implemented revision of the device type definition. The endpoint shall conform to this revision
     * of the device type.
     *
     * @see {@link MatterSpecification.v142.Core} § 9.5.5.1.2
     */
    revision: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt16.bound({ min: 1 }))
  });
  Descriptor2.TagListComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * This attribute shall be used to disambiguate sibling endpoints in certain situations, as defined in the
       * Disambiguation section in the System Model specification. An example of such a situation might be a
       * device with two buttons, with this attribute being used to indicate which of the two endpoints
       * corresponds to the button on the left side.
       *
       * It may also be used to provide information about an endpoint (e.g. the relative location of a Temperature
       * sensor in a Temperature Controlled Cabinet).
       *
       *   • A client SHOULD use these tags to convey disambiguation information and other relevant information to
       *     the user (e.g. showing it in a user interface), as appropriate.
       *
       *   • A client SHOULD use these tags in its logic to make decisions, as appropriate.
       *
       * For example, a client may identify which endpoint maps to a certain function, orientation or labeling.
       *
       * A client may use the Label field of each SemanticTagStruct, if present in each structure, to indicate
       * characteristics of an endpoint, or to augment what is provided in the TagID field of the same structure.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.5
       */
      tagList: (0, import_Cluster.FixedAttribute)(4, (0, import_TlvArray.TlvArray)(import_Semtag.TlvSemtag, { minLength: 1, maxLength: 6 }))
    }
  });
  Descriptor2.Base = import_MutableCluster.MutableCluster.Component({
    id: 29,
    name: "Descriptor",
    revision: 3,
    features: {
      /**
       * See the Disambiguation section in the System Model spec for conformance requirements for this feature and
       * the corresponding attribute.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.4.1
       */
      tagList: (0, import_BitmapSchema.BitFlag)(0)
    },
    attributes: {
      /**
       * This is a list of device types and corresponding revisions declaring endpoint conformance (see Section
       * 9.5.5.1, “DeviceTypeStruct Type”). At least one device type entry shall be present.
       *
       * An endpoint shall conform to all device types listed in the DeviceTypeList. A cluster instance that is in
       * common for more than one device type in the DeviceTypeList shall be supported as a shared cluster
       * instance on the endpoint.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.1
       */
      deviceTypeList: (0, import_Cluster.FixedAttribute)(0, (0, import_TlvArray.TlvArray)(Descriptor2.TlvDeviceType, { minLength: 1 })),
      /**
       * This attribute shall list each cluster ID for the server clusters present on the endpoint instance.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.2
       */
      serverList: (0, import_Cluster.FixedAttribute)(1, (0, import_TlvArray.TlvArray)(import_ClusterId.TlvClusterId), { default: [] }),
      /**
       * This attribute shall list each cluster ID for the client clusters present on the endpoint instance.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.3
       */
      clientList: (0, import_Cluster.FixedAttribute)(2, (0, import_TlvArray.TlvArray)(import_ClusterId.TlvClusterId), { default: [] }),
      /**
       * This attribute indicates composition of the device type instance. Device type instance composition shall
       * include the endpoints in this list.
       *
       * See Endpoint Composition for more information about which endpoints to include in this list.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.4
       */
      partsList: (0, import_Cluster.Attribute)(3, (0, import_TlvArray.TlvArray)(import_EndpointNumber.TlvEndpointNumber), { default: [] }),
      /**
       * Indicates an identifier which allows to uniquely identify the functionality exposed on an endpoint, and
       * therefore shall be unique within the device. It is constructed in a manufacturer specific manner.
       *
       *   • If a globally unique identifier is used, the same rules as defined for the UniqueID attribute in the
       *     Basic Information cluster apply.
       *
       *   • If the identifier is only unique in the scope of the device, and cannot be used to track the device,
       *     then it may remain unchanged at factory reset.
       *
       * The value does not need to be human readable, since it is intended for machine to machine (M2M)
       * communication.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.5.6.6
       */
      endpointUniqueId: (0, import_Cluster.OptionalFixedAttribute)(5, import_TlvString.TlvString.bound({ maxLength: 32 }))
    },
    /**
     * This metadata controls which DescriptorCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions({ flags: { tagList: true }, component: Descriptor2.TagListComponent })
  });
  Descriptor2.ClusterInstance = (0, import_MutableCluster.MutableCluster)(Descriptor2.Base);
  Descriptor2.Cluster = Descriptor2.ClusterInstance;
  const TAGLIST = { tagList: true };
  Descriptor2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: Descriptor2.Cluster.id,
    name: Descriptor2.Cluster.name,
    revision: Descriptor2.Cluster.revision,
    features: Descriptor2.Cluster.features,
    attributes: {
      ...Descriptor2.Cluster.attributes,
      tagList: import_MutableCluster.MutableCluster.AsConditional(Descriptor2.TagListComponent.attributes.tagList, { mandatoryIf: [TAGLIST] })
    }
  });
  Descriptor2.Complete = Descriptor2.CompleteInstance;
})(Descriptor || (Descriptor = {}));
const DescriptorCluster = Descriptor.Cluster;
import_ClusterRegistry.ClusterRegistry.register(Descriptor.Complete);
//# sourceMappingURL=descriptor.js.map
