import { useUiTranslation as e } from "../../../../i18n/useUiTranslation.js";
import { MarkdownHtmlFallback as t } from "./MarkdownHtmlFallback.js";
import { isRelativeUrl as n, isSafeHttpUrl as r } from "../helpers/isExternalLink.js";
import { caption as i, figure as a, image as o } from "./MarkdownImage.css.js";
import { jsx as s, jsxs as c } from "react/jsx-runtime";
//#region src/atomic/molecules/markdown/components/MarkdownImage.tsx
var l = ({ alt: l, src: u, title: d }) => {
	let { t: f } = e(), p = u.trim();
	if (!r(p) || n(p)) return /* @__PURE__ */ s(t, {
		content: f("markdown.image.unavailable", { src: p }),
		title: f("markdown.image.invalid")
	});
	let m = l ?? "", h = null;
	if (d != null) {
		let e = d.trim();
		e !== "" && (h = /* @__PURE__ */ s("figcaption", {
			className: i,
			children: e
		}));
	}
	return /* @__PURE__ */ c("figure", {
		className: a,
		children: [/* @__PURE__ */ s("img", {
			alt: m,
			className: o,
			src: p,
			title: d
		}), h]
	});
};
//#endregion
export { l as MarkdownImage };

//# sourceMappingURL=MarkdownImage.js.map