/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ImplementationError } from "@matter/general";
const CHIP_DUMMY_MANUFACTURE_DATE = "20200101";
function validateBasicInfoAttributes(state, log) {
  const { uniqueId, serialNumber, vendorName, productLabel, manufacturingDate, vendorId, productId } = state;
  if (vendorId !== void 0 && (vendorId === 0 || vendorId > 65524)) {
    throw new ImplementationError(
      `VendorID 0x${vendorId.toString(16).padStart(4, "0")} is not a valid device identity; it must be in 0x0001-0xFFF4`
    );
  }
  if (productId === 0) {
    throw new ImplementationError("ProductID 0x0000 is reserved and may not be assigned to a product");
  }
  if (uniqueId !== void 0 && serialNumber !== void 0 && uniqueId === serialNumber) {
    log.warn("uniqueId and serialNumber shall not be the same");
  }
  if (vendorName !== void 0) {
    if (vendorName.trim().length === 0) {
      log.warn("vendorName shall not be empty");
    } else if (productLabel !== void 0 && productLabel.includes(vendorName)) {
      log.warn("productLabel should not include vendorName");
    }
  }
  if (manufacturingDate === CHIP_DUMMY_MANUFACTURE_DATE) {
    log.warn(`manufacturingDate "${CHIP_DUMMY_MANUFACTURE_DATE}" looks like a placeholder/example value`);
  }
}
export {
  CHIP_DUMMY_MANUFACTURE_DATE,
  validateBasicInfoAttributes
};
//# sourceMappingURL=basic-information-validators.js.map
