/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
export function stampTemplate(template) {
    const fragment = template.content.cloneNode(true);
    const element = fragment.firstElementChild;
    return element;
}
export function stampTemplateWithValidation(template, validation, errorMsg) {
    const element = stampTemplate(template);
    if (validation(element)) {
        return element;
    }
    else {
        errorMsg === null || errorMsg === void 0 ? void 0 : errorMsg();
    }
}
export function stampTemplateWithId(parent, id, validation, templateNotFoundErrorMsg, validationErrorMsg) {
    const template = getTemplateWithId(parent, id, templateNotFoundErrorMsg);
    if (template != null) {
        return stampTemplateWithValidation(template, validation, validationErrorMsg);
    }
}
export function getTemplateWithId(parent, id, errorMsg) {
    const element = parent.querySelector(`#${id}`);
    if (element instanceof HTMLTemplateElement) {
        return element;
    }
    else {
        errorMsg === null || errorMsg === void 0 ? void 0 : errorMsg();
    }
}
//# sourceMappingURL=templates.js.map
