"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 SessionIntervals_exports = {};
__export(SessionIntervals_exports, {
  SessionIntervals: () => SessionIntervals
});
module.exports = __toCommonJS(SessionIntervals_exports);
var import_general = require("#general");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
function SessionIntervals(intervals) {
  const {
    idleInterval = SessionIntervals.defaults.idleInterval,
    activeInterval = SessionIntervals.defaults.activeInterval,
    activeThreshold = SessionIntervals.defaults.activeThreshold
  } = intervals ?? {};
  if (idleInterval > import_general.Hours.one) {
    throw new import_general.ImplementationError("Session Idle Interval must be less than 1 hour");
  }
  if (activeInterval > import_general.Hours.one) {
    throw new import_general.ImplementationError("Session Active Interval must be less than 1 hour");
  }
  if (activeThreshold > (0, import_general.Seconds)(65535)) {
    throw new import_general.ImplementationError("Session Active Threshold must be less than 65535 seconds");
  }
  return { idleInterval, activeInterval, activeThreshold };
}
((SessionIntervals2) => {
  SessionIntervals2.defaults = {
    idleInterval: (0, import_general.Millis)(500),
    activeInterval: (0, import_general.Millis)(300),
    activeThreshold: (0, import_general.Seconds)(4)
  };
})(SessionIntervals || (SessionIntervals = {}));
//# sourceMappingURL=SessionIntervals.js.map
