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

//#region src/sorts/semver.ts
/**
* @file Semver-aware string comparison. Wraps the vendored `external/semver`
*   accessor so callers don't have to thread the lazy-load themselves.
*/
/**
* Compare semantic versions.
*
* @example
*   ;```typescript
*   compareSemver('1.0.0', '2.0.0') // -1
*   compareSemver('2.0.0', '1.0.0') // 1
*   compareSemver('1.0.0', '1.0.0') // 0
*   ```
*/
/*@__NO_SIDE_EFFECTS__*/
function compareSemver(a, b) {
	/* c8 ignore start */
	const semver = /* @__PURE__ */ require_sorts__internal.getSemver();
	const validA = semver.valid(a);
	/* c8 ignore stop */
	const validB = semver.valid(b);
	if (!validA && !validB) return 0;
	if (!validA) return -1;
	if (!validB) return 1;
	/* c8 ignore next - External semver call */
	return semver.compare(a, b);
}

//#endregion
exports.compareSemver = compareSemver;