"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 content_app_observer_exports = {};
__export(content_app_observer_exports, {
  ContentAppObserver: () => ContentAppObserver,
  ContentAppObserverCluster: () => ContentAppObserverCluster
});
module.exports = __toCommonJS(content_app_observer_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_StatusResponseError = require("../common/StatusResponseError.js");
var import_Status = require("../globals/Status.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var ContentAppObserver;
((ContentAppObserver2) => {
  ContentAppObserver2.TlvContentAppMessageRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate content app-specific data.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.1.1
     */
    data: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 500 })),
    /**
     * This optional field shall indicate a content app-specific hint to the encoding of the data.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.1.2
     */
    encodingHint: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString.bound({ maxLength: 100 }))
  });
  let Status;
  ((Status2) => {
    Status2[Status2["Success"] = 0] = "Success";
    Status2[Status2["UnexpectedData"] = 1] = "UnexpectedData";
  })(Status = ContentAppObserver2.Status || (ContentAppObserver2.Status = {}));
  class UnexpectedDataError extends import_StatusResponseError.StatusResponseError {
    constructor(message = "Data field in command was not understood by the Observer", code = import_Status.Status.Failure, clusterCode = 1 /* UnexpectedData */) {
      super(message, code, clusterCode);
    }
  }
  ContentAppObserver2.UnexpectedDataError = UnexpectedDataError;
  ContentAppObserver2.TlvContentAppMessageResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the status of the command which resulted in this response.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.2.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * This optional field shall indicate content app-specific data.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.2.2
     */
    data: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString.bound({ maxLength: 500 })),
    /**
     * This optional field shall indicate a content app-specific hint to the encoding of the data.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.2.3
     */
    encodingHint: (0, import_TlvObject.TlvOptionalField)(2, import_TlvString.TlvString.bound({ maxLength: 100 }))
  });
  ContentAppObserver2.ClusterInstance = (0, import_MutableCluster.MutableCluster)({
    id: 1296,
    name: "ContentAppObserver",
    revision: 1,
    commands: {
      /**
       * Upon receipt, the data field may be parsed and interpreted. Message encoding is specific to the Content
       * App. A Content App may when possible read attributes from the Basic Information Cluster on the Observer
       * and use this to determine the Message encoding.
       *
       * This command returns a ContentAppMessage Response.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.12.5.1
       */
      contentAppMessage: (0, import_Cluster.Command)(0, ContentAppObserver2.TlvContentAppMessageRequest, 1, ContentAppObserver2.TlvContentAppMessageResponse)
    }
  });
  ContentAppObserver2.Cluster = ContentAppObserver2.ClusterInstance;
  ContentAppObserver2.Complete = ContentAppObserver2.Cluster;
})(ContentAppObserver || (ContentAppObserver = {}));
const ContentAppObserverCluster = ContentAppObserver.Cluster;
import_ClusterRegistry.ClusterRegistry.register(ContentAppObserver.Complete);
//# sourceMappingURL=content-app-observer.js.map
