import Component from '../component.js';
import DivComponent from '../div.js';
import CoEuiHeaderAppNameLogo from './eui-header-app-logo.js';
import CoEuiHeaderAppName from './eui-header-app-name.js';
import CoEuiHeaderAppSubtitle from './eui-header-app-subtitle.js';

export default class CoEuiHeaderApp extends Component {
  constructor(parent) {
    let selector = 'eui-header-app';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/layout/eui-header/header-app/header-app.component.html?at=refs%2Fheads%2Fmaster
  }
  get titleFullCO() {
    return new DivComponent(this.currentPath).addSelectorPredicate('[contains(@class,"eui-header-app__title") and contains(@class,"full")]');
  }
  get euiHeaderAppNameCO() {
    return new CoEuiHeaderAppName(this.titleFullCO);
  }
  async hasCustomAppName() {
    return await (await this.euiHeaderAppNameCO.element()).isExisting();
  }
  get subtitleCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-header-app__sub-title');
  }
  async hasCustomAppSubtitle() {
    return await (await this.euiHeaderAppSubtitleCO.element()).isExisting();
  }
  get euiHeaderAppSubtitleCO() {
    return new CoEuiHeaderAppSubtitle(this.subtitleCO);
  }
  get titleShortCO() {
    return new DivComponent(this.currentPath).addSelectorPredicate('[contains(@class,"eui-header-app__title") and contains(@class,"short")]');
  }
  get logoCO() {
    return new DivComponent(this.currentPath).addPredicateClassContains('eui-header-app-__title-logo');
  }
  get euiHeaderAppTitleLogoCO() {
    return new CoEuiHeaderAppNameLogo(this.logoCO);
  }
  async hasCustomAppNameLogo() {
    return await (await this.logoCO.element()).isExisting();
  }
}

