//#region ../../node_modules/@iconify/utils/lib/icon/name.js
var e = (e, n, r, i = "") => {
	let a = e.split(":");
	if (e.slice(0, 1) === "@") {
		if (a.length < 2 || a.length > 3) return null;
		i = a.shift().slice(1);
	}
	if (a.length > 3 || !a.length) return null;
	if (a.length > 1) {
		let e = a.pop(), r = a.pop(), o = {
			provider: a.length > 0 ? a[0] : i,
			prefix: r,
			name: e
		};
		return n && !t(o) ? null : o;
	}
	let o = a[0], s = o.split("-");
	if (s.length > 1) {
		let e = {
			provider: i,
			prefix: s.shift(),
			name: s.join("-")
		};
		return n && !t(e) ? null : e;
	}
	if (r && i === "") {
		let e = {
			provider: i,
			prefix: "",
			name: o
		};
		return n && !t(e, r) ? null : e;
	}
	return null;
}, t = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
//#endregion
export { e as stringToIcon };
