//#region src/tunnel/frp-subdomain-host.ts
/** Broker subdomain host derived from broker URL. */
function resolveFrpSubdomainHost(brokerUrl, override) {
	if (override?.trim()) return override.trim();
	try {
		const host = new URL(brokerUrl.replace(/\/api\/?$/, "")).hostname;
		if (host === "frp.xopc.ai" || host.endsWith(".frp.xopc.ai")) return "frp.xopc.ai";
		if (host.includes(".")) return host;
	} catch {}
	return "frp.xopc.ai";
}
//#endregion
export { resolveFrpSubdomainHost };

//# sourceMappingURL=frp-subdomain-host.js.map