import { iconNigelChatTag } from '../../../../icons/nigel-chat';
/**
 * Page object for the `spright-chat-message-welcome` component to provide consistent ways
 * of querying and interacting with the component during tests.
 */
export class ChatMessageWelcomePageObject {
    constructor(element) {
        this.element = element;
    }
    getTitleText() {
        const titleDiv = this.element.shadowRoot?.querySelector('.title');
        if (titleDiv === null || titleDiv === undefined) {
            return null;
        }
        return titleDiv.textContent?.trim() ?? '';
    }
    getSubtitleText() {
        const subtitleDiv = this.element.shadowRoot?.querySelector('.subtitle');
        if (subtitleDiv === null || subtitleDiv === undefined) {
            return null;
        }
        return subtitleDiv.textContent?.trim() ?? '';
    }
    isTitleRendered() {
        return this.element.shadowRoot?.querySelector('.title') !== null;
    }
    isSubtitleRendered() {
        return this.element.shadowRoot?.querySelector('.subtitle') !== null;
    }
    getSlottedBrandIconNodes() {
        const slot = this.getBrandIconSlot();
        return slot?.assignedElements() ?? [];
    }
    hasBrandIconDefaultContent() {
        const slot = this.getBrandIconSlot();
        const defaultContent = slot?.children[0];
        return defaultContent?.tagName.toLowerCase() === iconNigelChatTag;
    }
    getMessageContentSlottedText() {
        const slot = this.getDefaultSlot();
        const assigned = slot?.assignedNodes({ flatten: true }) ?? [];
        return assigned.map(n => n.textContent ?? '').join('');
    }
    getDefaultSlot() {
        return this.element.shadowRoot?.querySelector('slot:not([name])');
    }
    getBrandIconSlot() {
        return this.element.shadowRoot?.querySelector('slot[name="brand-icon"]');
    }
}
//# sourceMappingURL=chat-message-welcome.pageobject.js.map