import { ATTRS as e, NS as t, TAG_ID as n, getTagID as r } from "./html.js";
//#region ../../node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.js
var i = {
	TEXT_HTML: "text/html",
	APPLICATION_XML: "application/xhtml+xml"
}, a = "definitionurl", o = "definitionURL", s = new Map((/* @__PURE__ */ "attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan".split(".")).map((e) => [e.toLowerCase(), e])), c = new Map([
	["xlink:actuate", {
		prefix: "xlink",
		name: "actuate",
		namespace: t.XLINK
	}],
	["xlink:arcrole", {
		prefix: "xlink",
		name: "arcrole",
		namespace: t.XLINK
	}],
	["xlink:href", {
		prefix: "xlink",
		name: "href",
		namespace: t.XLINK
	}],
	["xlink:role", {
		prefix: "xlink",
		name: "role",
		namespace: t.XLINK
	}],
	["xlink:show", {
		prefix: "xlink",
		name: "show",
		namespace: t.XLINK
	}],
	["xlink:title", {
		prefix: "xlink",
		name: "title",
		namespace: t.XLINK
	}],
	["xlink:type", {
		prefix: "xlink",
		name: "type",
		namespace: t.XLINK
	}],
	["xml:lang", {
		prefix: "xml",
		name: "lang",
		namespace: t.XML
	}],
	["xml:space", {
		prefix: "xml",
		name: "space",
		namespace: t.XML
	}],
	["xmlns", {
		prefix: "",
		name: "xmlns",
		namespace: t.XMLNS
	}],
	["xmlns:xlink", {
		prefix: "xmlns",
		name: "xlink",
		namespace: t.XMLNS
	}]
]), l = new Map((/* @__PURE__ */ "altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath".split(".")).map((e) => [e.toLowerCase(), e])), u = new Set([
	n.B,
	n.BIG,
	n.BLOCKQUOTE,
	n.BODY,
	n.BR,
	n.CENTER,
	n.CODE,
	n.DD,
	n.DIV,
	n.DL,
	n.DT,
	n.EM,
	n.EMBED,
	n.H1,
	n.H2,
	n.H3,
	n.H4,
	n.H5,
	n.H6,
	n.HEAD,
	n.HR,
	n.I,
	n.IMG,
	n.LI,
	n.LISTING,
	n.MENU,
	n.META,
	n.NOBR,
	n.OL,
	n.P,
	n.PRE,
	n.RUBY,
	n.S,
	n.SMALL,
	n.SPAN,
	n.STRONG,
	n.STRIKE,
	n.SUB,
	n.SUP,
	n.TABLE,
	n.TT,
	n.U,
	n.UL,
	n.VAR
]);
function d(t) {
	let r = t.tagID;
	return r === n.FONT && t.attrs.some(({ name: t }) => t === e.COLOR || t === e.SIZE || t === e.FACE) || u.has(r);
}
function f(e) {
	for (let t = 0; t < e.attrs.length; t++) if (e.attrs[t].name === a) {
		e.attrs[t].name = o;
		break;
	}
}
function p(e) {
	for (let t = 0; t < e.attrs.length; t++) {
		let n = s.get(e.attrs[t].name);
		n != null && (e.attrs[t].name = n);
	}
}
function m(e) {
	for (let t = 0; t < e.attrs.length; t++) {
		let n = c.get(e.attrs[t].name);
		n && (e.attrs[t].prefix = n.prefix, e.attrs[t].name = n.name, e.attrs[t].namespace = n.namespace);
	}
}
function h(e) {
	let t = l.get(e.tagName);
	t != null && (e.tagName = t, e.tagID = r(e.tagName));
}
function g(e, r) {
	return r === t.MATHML && (e === n.MI || e === n.MO || e === n.MN || e === n.MS || e === n.MTEXT);
}
function _(r, a, o) {
	if (a === t.MATHML && r === n.ANNOTATION_XML) {
		for (let t = 0; t < o.length; t++) if (o[t].name === e.ENCODING) {
			let e = o[t].value.toLowerCase();
			return e === i.TEXT_HTML || e === i.APPLICATION_XML;
		}
	}
	return a === t.SVG && (r === n.FOREIGN_OBJECT || r === n.DESC || r === n.TITLE);
}
function v(e, n, r, i) {
	return (!i || i === t.HTML) && _(e, n, r) || (!i || i === t.MATHML) && g(e, n);
}
//#endregion
export { f as adjustTokenMathMLAttrs, p as adjustTokenSVGAttrs, h as adjustTokenSVGTagName, m as adjustTokenXMLAttrs, d as causesExit, v as isIntegrationPoint };
