import Component  from '../component.js';
import CoUxLanguageSelectorItem from './ux-language-selector-item.js';


export default class CoUxLanguageSelector extends Component {
  constructor(parent) {
    let selector = 'ux-language-selector';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/core/src/lib/commons/ux-components/ux-language-selector/ux-language-selector.component.html?at=support/7.x
  }

  get dataE2E() {
    let path = '//div[@data-e2e = "ux-language-selector"]';
    return this.currentPath + path;
  }
  get buttonGroup() {
    let path = '//div[contains(@class, "btn-group")]';
    return this.dataE2E + path; 
  }
  get headerSelector() {
    let path = '//div[contains(@class, "ecl-site-header__selector")]';
    return this.buttonGroup + path; 
  }
  get headerSelectorLink() {
    let path = '//a[contains(@class, "ecl-link") and contains(@class, "ecl-link--standalone")]';
    return this.headerSelector + path; 
  }
  get headerSelectorLinkLabel() {
    return this.headerSelectorLink + '//span'
  }
  get languageIcon() {
    let path = '//span[contains(@class, "ecl-site-header__language-icon") and contains(@class, "ux-language-selector__icon")]';
    return this.headerSelectorLink + path; 
  }
  get languageSelector() {
    let path = '//span[contains(@class, "ux-icon-language-selector") and contains(@class, "ux-u-color-primary")]';
    return this.languageIcon + path; 
  }
  get languageCode() {
    let path = '//span[contains(@class, "ecl-site-header__language-code")]';
    return this.languageIcon + path;
  }

  get dropdownMenu() {
    let path = '//div[contains(@class, "dropdown-menu")]';
    return this.buttonGroup + path;
  }
  get languageDropdownItemCo() {
    return new CoUxLanguageSelectorItem(this.dropdownMenu);
  }
}

  