window.WBUtils = (() => {
    function renderTemplate(template, data = {}) {
        return window.WarpBoxUI?.renderTemplate
            ? window.WarpBoxUI.renderTemplate(template, data)
            : String(template).replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g, (_, key) => {
                return Object.prototype.hasOwnProperty.call(data, key) ? String(data[key]) : "";
            });
    }

    return { renderTemplate };
})();
