function splitSVGDefs(e, t = "defs") {
	let n = "", r = e.indexOf("<" + t);
	for (; r >= 0;) {
		let i = e.indexOf(">", r), a = e.indexOf("</" + t);
		if (i === -1 || a === -1) break;
		let o = e.indexOf(">", a);
		if (o === -1) break;
		n += e.slice(i + 1, a).trim(), e = e.slice(0, r).trim() + e.slice(o + 1);
	}
	return {
		defs: n,
		content: e
	};
}
function mergeDefsAndContent(e, t) {
	return e ? "<defs>" + e + "</defs>" + t : t;
}
function wrapSVGContent(n, r, i) {
	let a = splitSVGDefs(n);
	return mergeDefsAndContent(a.defs, r + a.content + i);
}
export { wrapSVGContent };
