export function getComponentKey(component, nameAttribute) {
    const edit = component.closest('.ContentEdit') || component.closest('btu-widget');
    if (!edit)
        return null;
    let typeId;
    let componentName;
    if (edit.classList.contains('ContentEdit')) {
        typeId = edit.getAttribute('data-type-id');
        componentName = component.getAttribute(nameAttribute);
        if (!typeId || !componentName)
            return null;
    }
    else if (edit instanceof HTMLElement) {
        typeId = edit.getAttribute('widgetid');
        componentName = edit.getAttribute('internalname');
        if (!typeId || !componentName)
            return null;
    }
    return typeId && componentName ? `BSP.ContentEdit.widgetCollapsed.${typeId}.${componentName}` : null;
}
//# sourceMappingURL=getComponentKey.js.map