"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

//#region src/colors/socket-palette.ts
const HEX_BY_THEME = {
	__proto__: null,
	dark: {
		__proto__: null,
		alert: "#fb923c",
		error: "#f87171",
		info: "#60a5fa",
		socketPink: "#ff00aa",
		socketPurple: "#8c50ff",
		success: "#4ade80",
		warning: "#facc15"
	},
	light: {
		__proto__: null,
		alert: "#9a3412",
		error: "#b91c1c",
		info: "#1d4ed8",
		socketPink: "#ff00aa",
		socketPurple: "#8c50ff",
		success: "#15803d",
		warning: "#a16207"
	},
	synthwave: {
		__proto__: null,
		alert: "#ffb86c",
		error: "#ff6b9d",
		info: "#8be9fd",
		socketPink: "#ff00aa",
		socketPurple: "#8c50ff",
		success: "#50fa7b",
		warning: "#f1fa8c"
	}
};
/**
* Build an ANSI-wrapping function for a single hex color. Emits the 24-bit
* sequence rather than rounding to the legacy 8-color palette so the rendered
* output matches the CSS token byte-for-byte (modulo terminal gamut).
* `\x1b[39m` resets fg to the terminal default — using `[0m` would also clear
* bg / styles, which the caller may have set deliberately.
*/
/*@__NO_SIDE_EFFECTS__*/
function colorizer(hex) {
	const prefix = `\x1b[38;2;${parseInt(hex.slice(1, 3), 16)};${parseInt(hex.slice(3, 5), 16)};${parseInt(hex.slice(5, 7), 16)}m`;
	const suffix = "\x1B[39m";
	return (s) => `${prefix}${s}${suffix}`;
}
/**
* Resolve a Socket palette for the requested theme. Defaults to `'dark'` — the
* common case for terminal output.
*
* @example
*   ;```typescript
*   import { getPalette } from '@socketsecurity/lib/colors/socket-palette'
*
*   const palette = getPalette('dark')
*   process.stdout.write(palette.success('Build complete\n'))
*   ```
*/
/*@__NO_SIDE_EFFECTS__*/
function getPalette(theme = "dark") {
	const hex = HEX_BY_THEME[theme];
	return {
		alert: /* @__PURE__ */ colorizer(hex.alert),
		error: /* @__PURE__ */ colorizer(hex.error),
		hex,
		info: /* @__PURE__ */ colorizer(hex.info),
		socketPink: /* @__PURE__ */ colorizer(hex.socketPink),
		socketPurple: /* @__PURE__ */ colorizer(hex.socketPurple),
		success: /* @__PURE__ */ colorizer(hex.success),
		warning: /* @__PURE__ */ colorizer(hex.warning)
	};
}

//#endregion
exports.colorizer = colorizer;
exports.getPalette = getPalette;