export function escapeHtml(text) {
    return text
        .replace(/&/g, '&amp;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
        .replace(/"/g, '&quot;');
}
export function escapeAttribute(text) {
    return escapeHtml(text).replace(/'/g, '&#39;');
}
export function escapeScript(text) {
    return text.replace(/<\/script/gi, '<\\/script');
}
export function escapeStyle(text) {
    return text.replace(/<\/style/gi, '<\\/style');
}
export function encodeBase64(text) {
    const bytes = new TextEncoder().encode(text);
    let binary = '';
    const chunkSize = 0x8000;
    for (let index = 0; index < bytes.length; index += chunkSize) {
        binary += String.fromCharCode(...bytes.slice(index, index + chunkSize));
    }
    return btoa(binary);
}
//# sourceMappingURL=artifact-escape.js.map