const TRUE_VALUES = /* @__PURE__ */ new Set(["1", "true", "yes", "y", "on", "enable", "enabled"]);
const FALSE_VALUES = /* @__PURE__ */ new Set(["0", "false", "no", "n", "off", "disable", "disabled"]);
function parseBooleanToken(raw) {
  if (typeof raw !== "string") return null;
  const trimmed = raw.trim();
  if (!trimmed) return null;
  const normalized = trimmed.toLowerCase();
  if (TRUE_VALUES.has(normalized)) return true;
  if (FALSE_VALUES.has(normalized)) return false;
  return null;
}
function parseBooleanWithDefault(raw, fallback) {
  const parsed = parseBooleanToken(raw);
  return parsed === null ? fallback : parsed;
}
function parseBooleanFlag(raw) {
  const parsed = parseBooleanToken(raw);
  return parsed === null ? void 0 : parsed;
}
function parseBooleanFromUnknown(value) {
  if (typeof value === "boolean") return value;
  if (typeof value === "string") return parseBooleanToken(value);
  return null;
}
export {
  FALSE_VALUES,
  TRUE_VALUES,
  parseBooleanFlag,
  parseBooleanFromUnknown,
  parseBooleanToken,
  parseBooleanWithDefault
};
//# sourceMappingURL=boolean.js.map
