"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 time_synchronization_element_exports = {};
__export(time_synchronization_element_exports, {
  TimeSynchronization: () => TimeSynchronization
});
module.exports = __toCommonJS(time_synchronization_element_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const TimeSynchronization = (0, import_elements.ClusterElement)(
  { name: "TimeSynchronization", id: 56, classification: "node" },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  (0, import_elements.AttributeElement)(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    (0, import_elements.FieldElement)({ name: "TZ", constraint: "0", title: "TimeZone" }),
    (0, import_elements.FieldElement)({ name: "NTPC", constraint: "1", title: "NtpClient" }),
    (0, import_elements.FieldElement)({ name: "NTPS", constraint: "2", title: "NtpServer" }),
    (0, import_elements.FieldElement)({ name: "TSC", constraint: "3", title: "TimeSyncClient" })
  ),
  (0, import_elements.AttributeElement)(
    { name: "UtcTime", id: 0, type: "epoch-us", access: "R V", conformance: "M", default: null, quality: "X C" }
  ),
  (0, import_elements.AttributeElement)({
    name: "Granularity",
    id: 1,
    type: "GranularityEnum",
    access: "R V",
    conformance: "M",
    constraint: "desc",
    default: 0
  }),
  (0, import_elements.AttributeElement)({
    name: "TimeSource",
    id: 2,
    type: "TimeSourceEnum",
    access: "R V",
    conformance: "O",
    constraint: "desc",
    default: 0
  }),
  (0, import_elements.AttributeElement)({
    name: "TrustedTimeSource",
    id: 3,
    type: "TrustedTimeSourceStruct",
    access: "R V",
    conformance: "TSC",
    default: null,
    quality: "X N"
  }),
  (0, import_elements.AttributeElement)({
    name: "DefaultNtp",
    id: 4,
    type: "string",
    access: "R V",
    conformance: "NTPC",
    constraint: "max 128",
    default: null,
    quality: "X N"
  }),
  (0, import_elements.AttributeElement)(
    {
      name: "TimeZone",
      id: 5,
      type: "list",
      access: "R V",
      conformance: "TZ",
      constraint: "1 to 2",
      default: [{ type: "properties", properties: { offset: 0, validAt: 0 } }],
      quality: "N"
    },
    (0, import_elements.FieldElement)({ name: "entry", type: "TimeZoneStruct" })
  ),
  (0, import_elements.AttributeElement)(
    { name: "DstOffset", id: 6, type: "list", access: "R V", conformance: "TZ", default: [], quality: "N" },
    (0, import_elements.FieldElement)({ name: "entry", type: "DSTOffsetStruct" })
  ),
  (0, import_elements.AttributeElement)({ name: "LocalTime", id: 7, type: "epoch-us", access: "R V", conformance: "TZ", default: null, quality: "X C" }),
  (0, import_elements.AttributeElement)({
    name: "TimeZoneDatabase",
    id: 8,
    type: "TimeZoneDatabaseEnum",
    access: "R V",
    conformance: "TZ",
    default: 2,
    quality: "F"
  }),
  (0, import_elements.AttributeElement)({ name: "NtpServerAvailable", id: 9, type: "bool", access: "R V", conformance: "NTPS", default: false }),
  (0, import_elements.AttributeElement)({
    name: "TimeZoneListMaxSize",
    id: 10,
    type: "uint8",
    access: "R V",
    conformance: "TZ",
    constraint: "1 to 2",
    quality: "F"
  }),
  (0, import_elements.AttributeElement)({
    name: "DstOffsetListMaxSize",
    id: 11,
    type: "uint8",
    access: "R V",
    conformance: "TZ",
    constraint: "min 1",
    quality: "F"
  }),
  (0, import_elements.AttributeElement)({
    name: "SupportsDnsResolve",
    id: 12,
    type: "bool",
    access: "R V",
    conformance: "NTPC",
    default: false,
    quality: "F"
  }),
  (0, import_elements.EventElement)({ name: "DstTableEmpty", id: 0, access: "V", conformance: "TZ", priority: "info" }),
  (0, import_elements.EventElement)(
    { name: "DstStatus", id: 1, access: "V", conformance: "TZ", priority: "info" },
    (0, import_elements.FieldElement)({ name: "DstOffsetActive", id: 0, type: "bool", conformance: "M" })
  ),
  (0, import_elements.EventElement)(
    { name: "TimeZoneStatus", id: 2, access: "V", conformance: "TZ", priority: "info" },
    (0, import_elements.FieldElement)({ name: "Offset", id: 0, type: "int32", conformance: "M", constraint: "-43200 to 50400" }),
    (0, import_elements.FieldElement)({ name: "Name", id: 1, type: "string", conformance: "O", constraint: "0 to 64" })
  ),
  (0, import_elements.EventElement)({ name: "TimeFailure", id: 3, access: "V", conformance: "M", priority: "info" }),
  (0, import_elements.EventElement)({ name: "MissingTrustedTimeSource", id: 4, access: "V", conformance: "TSC", priority: "info" }),
  (0, import_elements.CommandElement)(
    { name: "SetUtcTime", id: 0, access: "A", conformance: "M", direction: "request", response: "status" },
    (0, import_elements.FieldElement)({ name: "UtcTime", id: 0, type: "epoch-us", conformance: "M", default: 0 }),
    (0, import_elements.FieldElement)({ name: "Granularity", id: 1, type: "GranularityEnum", conformance: "M", default: 0 }),
    (0, import_elements.FieldElement)({ name: "TimeSource", id: 2, type: "TimeSourceEnum", conformance: "O", default: 0 })
  ),
  (0, import_elements.CommandElement)(
    {
      name: "SetTrustedTimeSource",
      id: 1,
      access: "F A",
      conformance: "TSC",
      direction: "request",
      response: "status"
    },
    (0, import_elements.FieldElement)({
      name: "TrustedTimeSource",
      id: 0,
      type: "FabricScopedTrustedTimeSourceStruct",
      access: "F",
      conformance: "M",
      quality: "X"
    }),
    (0, import_elements.FieldElement)({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  (0, import_elements.CommandElement)(
    {
      name: "SetTimeZone",
      id: 2,
      access: "M",
      conformance: "TZ",
      direction: "request",
      response: "SetTimeZoneResponse"
    },
    (0, import_elements.FieldElement)(
      { name: "TimeZone", id: 0, type: "list", conformance: "M", constraint: "1 to 2" },
      (0, import_elements.FieldElement)({ name: "entry", type: "TimeZoneStruct" })
    )
  ),
  (0, import_elements.CommandElement)(
    { name: "SetTimeZoneResponse", id: 3, conformance: "TZ", direction: "response" },
    (0, import_elements.FieldElement)({ name: "DstOffsetRequired", id: 0, type: "bool", conformance: "M", default: true })
  ),
  (0, import_elements.CommandElement)(
    { name: "SetDstOffset", id: 4, access: "M", conformance: "TZ", direction: "request", response: "status" },
    (0, import_elements.FieldElement)(
      { name: "DstOffset", id: 0, type: "list", conformance: "M" },
      (0, import_elements.FieldElement)({ name: "entry", type: "DSTOffsetStruct" })
    )
  ),
  (0, import_elements.CommandElement)(
    { name: "SetDefaultNtp", id: 5, access: "A", conformance: "NTPC", direction: "request", response: "status" },
    (0, import_elements.FieldElement)({ name: "DefaultNtp", id: 0, type: "string", conformance: "M", constraint: "max 128", quality: "X" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "GranularityEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "NoTimeGranularity", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MinutesGranularity", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SecondsGranularity", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MillisecondsGranularity", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MicrosecondsGranularity", id: 4, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "TimeSourceEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "None", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Unknown", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Admin", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NodeTimeCluster", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NonMatterSntp", id: 4, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NonMatterNtp", id: 5, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MatterSntp", id: 6, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MatterNtp", id: 7, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MixedNtp", id: 8, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NonMatterSntpnts", id: 9, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NonMatterNtpnts", id: 10, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MatterSntpnts", id: 11, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MatterNtpnts", id: 12, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MixedNtpnts", id: 13, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "CloudSource", id: 14, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Ptp", id: 15, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Gnss", id: 16, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "TimeZoneDatabaseEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "Full", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Partial", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "None", id: 2, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "TrustedTimeSourceStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "FabricIndex", id: 0, type: "fabric-idx", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NodeId", id: 1, type: "node-id", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Endpoint", id: 2, type: "endpoint-no", conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "FabricScopedTrustedTimeSourceStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "NodeId", id: 0, type: "node-id", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Endpoint", id: 1, type: "endpoint-no", conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "TimeZoneStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "Offset", id: 0, type: "int32", conformance: "M", constraint: "-43200 to 50400" }),
    (0, import_elements.FieldElement)({ name: "ValidAt", id: 1, type: "epoch-us", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Name", id: 2, type: "string", conformance: "O", constraint: "0 to 64" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "DSTOffsetStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "Offset", id: 0, type: "int32", conformance: "M", constraint: "desc" }),
    (0, import_elements.FieldElement)({ name: "ValidStarting", id: 1, type: "epoch-us", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ValidUntil", id: 2, type: "epoch-us", conformance: "M", quality: "X" })
  ),
  (0, import_elements.DatatypeElement)({ name: "StatusCodeEnum", type: "enum8" }, (0, import_elements.FieldElement)({ name: "TimeNotAccepted", id: 2, conformance: "M" }))
);
import_MatterDefinition.MatterDefinition.children.push(TimeSynchronization);
//# sourceMappingURL=time-synchronization.element.js.map
