/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
//#region ../tailwind-internal/dist/packages/automated-config/dist/types/StateAxis.js
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
/**
* Atomic-state taxonomy.
*
* Every interactive component reacts to a fixed set of "atomic" states, each
* belonging to one axis:
*
* - `interactive` — pointer/keyboard focus signals. At runtime at most one of
*   these is meaningfully "active" at a time on a given element (you can't
*   simultaneously hover and press distinctly enough to style separately, etc.).
*
* - `modifier` — semantic flags that can stack independently of each other and
*   of the interactive state. An input can be `invalid` AND `readonly` at the
*   same time, optionally also `hover`ed.
*
* Compound states (`'invalid&hover'`, `'invalid&readonly&hover'`, etc.) are
* built by listing 0..N modifiers followed by 0..1 interactive. The
* `canonicalizeStateKey` helper enforces this ordering so that, e.g.,
* `['hover', 'invalid']` and `['invalid', 'hover']` resolve to the same key.
*/
/**
* Interactive atomics:
*
* - `hover`/`pressed` for pointer interaction.
* - `focus-within` for containers that wrap a focusable child (e.g. an input
*   wrapper).
* - `focus-visible` for keyboard-only focus rings on focusable elements.
*/
const INTERACTIVE_ATOMICS = [
	"hover",
	"pressed",
	"focus-within",
	"focus-visible"
];
const MODIFIER_ATOMICS = [
	"invalid",
	"readonly",
	"placeholder-shown",
	"autofill",
	"visited"
];
const INTERACTIVE_ATOMIC_SET = new Set(INTERACTIVE_ATOMICS);
const MODIFIER_ATOMIC_SET = new Set(MODIFIER_ATOMICS);
function isInteractiveAtomic(state) {
	return INTERACTIVE_ATOMIC_SET.has(state);
}
function isModifierAtomic(state) {
	return MODIFIER_ATOMIC_SET.has(state);
}
function isAtomicState(state) {
	return isInteractiveAtomic(state) || isModifierAtomic(state);
}
const STATE_PRIORITY_INDEX = new Map([
	"visited",
	"placeholder-shown",
	"autofill",
	"focus-within",
	"focus-visible",
	"hover",
	"pressed",
	"invalid",
	"readonly"
].map((atom, i) => [atom, i]));
/**
* Comparator usable with `Array.prototype.sort`. Atoms not in `STATE_PRIORITY`
* sort to the front (weakest) — this only triggers for unknown strings; every
* known `AtomicState` is in the priority array.
*/
function comparePriority(a, b) {
	return (STATE_PRIORITY_INDEX.get(a) ?? -1) - (STATE_PRIORITY_INDEX.get(b) ?? -1);
}
//#endregion
exports.INTERACTIVE_ATOMICS = INTERACTIVE_ATOMICS;
exports.MODIFIER_ATOMICS = MODIFIER_ATOMICS;
exports.comparePriority = comparePriority;
exports.isAtomicState = isAtomicState;
exports.isInteractiveAtomic = isInteractiveAtomic;
exports.isModifierAtomic = isModifierAtomic;
