"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
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 VersionFiles_exports = {};
__export(VersionFiles_exports, {
  ApplicationVersionFile: () => ApplicationVersionFile,
  ApplicationVersionFile800: () => ApplicationVersionFile800,
  ApplicationVersionFile800ID: () => ApplicationVersionFile800ID,
  ApplicationVersionFileID: () => ApplicationVersionFileID,
  ProtocolVersionFile: () => ProtocolVersionFile,
  ProtocolVersionFileID: () => ProtocolVersionFileID,
  VersionFile: () => VersionFile
});
module.exports = __toCommonJS(VersionFiles_exports);
var import_tslib = require("tslib");
var import_shared = require("@zwave-js/shared");
var import_NVMFile = require("./NVMFile.js");
class VersionFile extends import_NVMFile.NVMFile {
  static {
    __name(this, "VersionFile");
  }
  constructor(options) {
    super(options);
    if ((0, import_NVMFile.gotDeserializationOptions)(options)) {
      this.format = this.payload[3];
      this.major = this.payload[2];
      this.minor = this.payload[1];
      this.patch = this.payload[0];
    } else {
      this.format = options.format;
      this.major = options.major;
      this.minor = options.minor;
      this.patch = options.patch;
    }
  }
  format;
  major;
  minor;
  patch;
  serialize() {
    this.payload = import_shared.Bytes.from([
      this.patch,
      this.minor,
      this.major,
      this.format
    ]);
    return super.serialize();
  }
  // oxlint-disable-next-line typescript/explicit-module-boundary-types
  toJSON() {
    return {
      ...super.toJSON(),
      format: this.format,
      version: `${this.major}.${this.minor}.${this.patch}`
    };
  }
}
const ApplicationVersionFileID = 331776;
let ApplicationVersionFile = (() => {
  let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationVersionFileID), (0, import_NVMFile.nvmSection)("application")];
  let _classDescriptor;
  let _classExtraInitializers = [];
  let _classThis;
  let _classSuper = VersionFile;
  var ApplicationVersionFile2 = class extends _classSuper {
    static {
      __name(this, "ApplicationVersionFile");
    }
    static {
      _classThis = this;
    }
    static {
      const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
      (0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
      ApplicationVersionFile2 = _classThis = _classDescriptor.value;
      if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
      (0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
    }
  };
  return ApplicationVersionFile2 = _classThis;
})();
const ApplicationVersionFile800ID = 266240;
let ApplicationVersionFile800 = (() => {
  let _classDecorators = [(0, import_NVMFile.nvmFileID)(ApplicationVersionFile800ID), (0, import_NVMFile.nvmSection)("application")];
  let _classDescriptor;
  let _classExtraInitializers = [];
  let _classThis;
  let _classSuper = VersionFile;
  var ApplicationVersionFile8002 = class extends _classSuper {
    static {
      __name(this, "ApplicationVersionFile800");
    }
    static {
      _classThis = this;
    }
    static {
      const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
      (0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
      ApplicationVersionFile8002 = _classThis = _classDescriptor.value;
      if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
      (0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
    }
  };
  return ApplicationVersionFile8002 = _classThis;
})();
const ProtocolVersionFileID = 327680;
let ProtocolVersionFile = (() => {
  let _classDecorators = [(0, import_NVMFile.nvmFileID)(ProtocolVersionFileID), (0, import_NVMFile.nvmSection)("protocol")];
  let _classDescriptor;
  let _classExtraInitializers = [];
  let _classThis;
  let _classSuper = VersionFile;
  var ProtocolVersionFile2 = class extends _classSuper {
    static {
      __name(this, "ProtocolVersionFile");
    }
    static {
      _classThis = this;
    }
    static {
      const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
      (0, import_tslib.__esDecorate)(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
      ProtocolVersionFile2 = _classThis = _classDescriptor.value;
      if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
      (0, import_tslib.__runInitializers)(_classThis, _classExtraInitializers);
    }
  };
  return ProtocolVersionFile2 = _classThis;
})();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ApplicationVersionFile,
  ApplicationVersionFile800,
  ApplicationVersionFile800ID,
  ApplicationVersionFileID,
  ProtocolVersionFile,
  ProtocolVersionFileID,
  VersionFile
});
//# sourceMappingURL=VersionFiles.js.map
