import Component from '../../component.js';
import CoEuiTimebarStep from './eui-timebar-step.js';
import CoEuiTimebarLegendItem from './eui-timebar-legend-item.js';
import DivComponent from '../div.js';
import SpanComponent from '../span.js';

export default class CoEuiTimebar extends Component {
  constructor(parent) {
    let selector = 'eui-timebar';
    super(parent, selector);
    //https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-timebar/eui-timebar.component.html?at=master
  }
  get timelineContainer() {
    return this.currentPath + '//div[contains(@class,"flex-container")][1]';
  }
  get timelineStartLabelCO() {
    return new DivComponent(this.timelineContainer).addPredicateClassContains('eui-timebar__start-label');
  }
  async hasStartLabel() {
    return await (await $(this.timelineStartLabelCO.currentPath)).isExisting();
  }
  get timebarColumnCO() {
    return new DivComponent(this.timelineContainer).addPredicateClassContains('col');
  }
  get timebarCO() {
    return new DivComponent(this.timebarColumnCO).addPredicateClassContains('eui-timebar');
  }
  get currentProgressCO() {
    return new DivComponent(this.timebarCO).addPredicateClassContains('eui-timebar__current-progress');
  }
  async isShowCurrentDateMarker() {
    return await (await $(this.currentProgressCO.currentPath)).isExisting();
  }
  get currentProgressMarkedDateCO() {
    return new DivComponent(this.timebarCO).addPredicateClassContains('eui-timebar__current-progress');
  }
  async hasMarkedDate() {
    return await (await $(this.currentProgressMarkedDateCO.currentPath)).isExisting();
  }
  get timebarStepCO() {
    return new CoEuiTimebarStep(this.timebarCO);
  }
  get currentDateMarker() {
    return this.timebarCO.currentPath + '//div[contains(@class,"eui-timebar__current-date-marker")][1]';
  }
  get mapMarkerIconCurrentDateCO() {
    return new SpanComponent(this.currentDateMarker).addPredicateClassContains('ux-icon-map-marker');
  }
  get currentDateMarkerStep() {
    return this.timebarCO.currentPath + '//div[contains(@class,"eui-timebar__current-date-marker-step")][1]';
  }
  get circleIconCurrentDateCO() {
    return new SpanComponent(this.currentDateMarkerStep).addPredicateClassContains('ux-icon-circle');
  }
  get markedDateMarker() {
    return this.timebarCO.currentPath + '//div[contains(@class,"eui-timebar__current-date-marker")][2]';
  }
  async hasMarkedDate() {
    return await (await $(this.markedDateMarker)).isExisting();
  }
  get mapMarkerIconMarkedDateCO() {
    return new SpanComponent(this.markedDateMarker).addPredicateClassContains('ux-icon-map-marker');
  }
  get markedDateMarkerStep() {
    return this.timebarCO.currentPath + '//div[contains(@class,"eui-timebar__current-date-marker-step")][2]';
  }
  get circleIconMarkedDateCO() {
    return new SpanComponent(this.markedDateMarkerStep).addPredicateClassContains('ux-icon-circle');
  }
  get timelineEndLabelCO() {
    return new DivComponent(this.timelineContainer).addPredicateClassContains('eui-timebar__end-label');
  }
  async hasTimelineEndLabel() {
    return await (await $(this.timelineEndLabelCO.currentPath)).isExisting();
  }
  get legendContainer() {
    return this.currentPath + '//div[contains(@class,"flex-container")][2]';
  }
  get legendStartLabel() {
    return this.legendContainer + '//div[contains(@class,"col-2")][1]';
  }
  get legendCO() {
    return new DivComponent(this.legendStartLabel).addPredicateClassContains('eui-timebar__legend');
  }
  get timebarLegendItemCO() {
    return new CoEuiTimebarLegendItem(this.legendCO);
  }
  async isShowLegend() {
    return await (await $(this.timebarLegendItemCO.currentPath)).isExisting();
  }
  get legendEndLabel() {
    return this.legendContainer + '//div[contains(@class,"col-2")][2]';
  }
}

