import 'shared/components/image.js';
import { getURI, isGIFURL, isDomainAllowed } from '@converse/headless/utils/url.js';
import { html } from 'lit';
function isValidURL (url) {
// We don't consider relative URLs as valid
return !!getURI(url).host();
}
function isValidImage (image) {
return image && isDomainAllowed(image, 'allowed_image_domains') && isValidURL(image);
}
const tplUrlWrapper = (o, wrapped_template) =>
o.url && isValidURL(o.url) && !isGIFURL(o.image)
? html`${wrapped_template(o)}`
: wrapped_template(o);
const tplImage = o =>
html`