"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 Status_exports = {};
__export(Status_exports, {
  Status: () => Status
});
module.exports = __toCommonJS(Status_exports);
var import_LogLevel = require("#log/LogLevel.js");
var import_TimeUnit = require("#time/TimeUnit.js");
var import_errors = require("./errors.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var Status = /* @__PURE__ */ ((Status2) => {
  Status2["ReadOnly"] = "read only";
  Status2["Shared"] = "shared";
  Status2["Waiting"] = "waiting";
  Status2["Exclusive"] = "exclusive";
  Status2["CommittingPhaseOne"] = "committing phase one";
  Status2["CommittingPhaseTwo"] = "committing phase two";
  Status2["RollingBack"] = "rolling back";
  Status2["Destroyed"] = "destroyed";
  return Status2;
})(Status || {});
((Status2) => {
  function assert(transaction, acceptable, target) {
    if (!acceptable.includes(transaction.status)) {
      throw new import_errors.TransactionFlowError(
        `Cannot transition transaction from ${formatStatus(transaction.status)} to ${formatStatus(target)}`
      );
    }
  }
  Status2.assert = assert;
  function formatStatus(status) {
    return `<${status}>`;
  }
  Status2.formatStatus = formatStatus;
  Status2.slowTransactionTime = (0, import_TimeUnit.Millis)(200);
  Status2.slowLogLevel = import_LogLevel.LogLevel.INFO;
})(Status || (Status = {}));
//# sourceMappingURL=Status.js.map
