"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 electrical_energy_measurement_element_exports = {};
__export(electrical_energy_measurement_element_exports, {
  ElectricalEnergyMeasurement: () => ElectricalEnergyMeasurement
});
module.exports = __toCommonJS(electrical_energy_measurement_element_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const ElectricalEnergyMeasurement = (0, import_elements.ClusterElement)(
  { name: "ElectricalEnergyMeasurement", id: 145, classification: "application" },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
  (0, import_elements.AttributeElement)(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    (0, import_elements.FieldElement)({ name: "IMPE", conformance: "O.a+", constraint: "0", title: "ImportedEnergy" }),
    (0, import_elements.FieldElement)({ name: "EXPE", conformance: "O.a+", constraint: "1", title: "ExportedEnergy" }),
    (0, import_elements.FieldElement)({ name: "CUME", conformance: "O.b+", constraint: "2", title: "CumulativeEnergy" }),
    (0, import_elements.FieldElement)({ name: "PERE", conformance: "O.b+", constraint: "3", title: "PeriodicEnergy" })
  ),
  (0, import_elements.AttributeElement)(
    { name: "Accuracy", id: 0, type: "MeasurementAccuracyStruct", access: "R V", conformance: "M", quality: "F" }
  ),
  (0, import_elements.AttributeElement)({
    name: "CumulativeEnergyImported",
    id: 1,
    type: "EnergyMeasurementStruct",
    access: "R V",
    conformance: "IMPE & CUME",
    quality: "X Q"
  }),
  (0, import_elements.AttributeElement)({
    name: "CumulativeEnergyExported",
    id: 2,
    type: "EnergyMeasurementStruct",
    access: "R V",
    conformance: "EXPE & CUME",
    quality: "X Q"
  }),
  (0, import_elements.AttributeElement)({
    name: "PeriodicEnergyImported",
    id: 3,
    type: "EnergyMeasurementStruct",
    access: "R V",
    conformance: "IMPE & PERE",
    quality: "X Q"
  }),
  (0, import_elements.AttributeElement)({
    name: "PeriodicEnergyExported",
    id: 4,
    type: "EnergyMeasurementStruct",
    access: "R V",
    conformance: "EXPE & PERE",
    quality: "X Q"
  }),
  (0, import_elements.AttributeElement)({
    name: "CumulativeEnergyReset",
    id: 5,
    type: "CumulativeEnergyResetStruct",
    access: "R V",
    conformance: "[CUME]",
    default: null,
    quality: "X"
  }),
  (0, import_elements.EventElement)(
    { name: "CumulativeEnergyMeasured", id: 0, access: "V", conformance: "CUME", priority: "info" },
    (0, import_elements.FieldElement)({ name: "EnergyImported", id: 0, type: "EnergyMeasurementStruct", conformance: "CUME & IMPE" }),
    (0, import_elements.FieldElement)({ name: "EnergyExported", id: 1, type: "EnergyMeasurementStruct", conformance: "CUME & EXPE" })
  ),
  (0, import_elements.EventElement)(
    { name: "PeriodicEnergyMeasured", id: 1, access: "V", conformance: "PERE", priority: "info" },
    (0, import_elements.FieldElement)({ name: "EnergyImported", id: 0, type: "EnergyMeasurementStruct", conformance: "PERE & IMPE" }),
    (0, import_elements.FieldElement)({ name: "EnergyExported", id: 1, type: "EnergyMeasurementStruct", conformance: "PERE & EXPE" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "MeasurementTypeEnum", type: "enum16" },
    (0, import_elements.FieldElement)({ name: "Unspecified", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Voltage", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ActiveCurrent", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ReactiveCurrent", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ApparentCurrent", id: 4, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ActivePower", id: 5, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ReactivePower", id: 6, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ApparentPower", id: 7, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RmsVoltage", id: 8, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RmsCurrent", id: 9, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RmsPower", id: 10, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Frequency", id: 11, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PowerFactor", id: 12, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NeutralCurrent", id: 13, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ElectricalEnergy", id: 14, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ReactiveEnergy", id: 15, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ApparentEnergy", id: 16, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "EnergyMeasurementStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "Energy", id: 0, type: "energy-mWh", conformance: "M", constraint: "min 0" }),
    (0, import_elements.FieldElement)({ name: "StartTimestamp", id: 1, type: "epoch-s", conformance: "desc" }),
    (0, import_elements.FieldElement)({ name: "EndTimestamp", id: 2, type: "epoch-s", conformance: "desc", constraint: "min startTimestamp + 1" }),
    (0, import_elements.FieldElement)({ name: "StartSystime", id: 3, type: "systime-ms", conformance: "desc" }),
    (0, import_elements.FieldElement)({ name: "EndSystime", id: 4, type: "systime-ms", conformance: "desc", constraint: "min startSystime + 1" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "CumulativeEnergyResetStruct", type: "struct" },
    (0, import_elements.FieldElement)({
      name: "ImportedResetTimestamp",
      id: 0,
      type: "epoch-s",
      conformance: "[IMPE]",
      default: null,
      quality: "X"
    }),
    (0, import_elements.FieldElement)({
      name: "ExportedResetTimestamp",
      id: 1,
      type: "epoch-s",
      conformance: "[EXPE]",
      default: null,
      quality: "X"
    }),
    (0, import_elements.FieldElement)({
      name: "ImportedResetSystime",
      id: 2,
      type: "systime-ms",
      conformance: "[IMPE]",
      default: null,
      quality: "X"
    }),
    (0, import_elements.FieldElement)({
      name: "ExportedResetSystime",
      id: 3,
      type: "systime-ms",
      conformance: "[EXPE]",
      default: null,
      quality: "X"
    })
  )
);
import_MatterDefinition.MatterDefinition.children.push(ElectricalEnergyMeasurement);
//# sourceMappingURL=electrical-energy-measurement.element.js.map
