// #region common Types
export type ListSource = {
  ref_id: number;
  ts_ref: string;
  other_info: OtherInfo;
  topics: [];
  sort_date_timestamp: number;
  main_type: string;
  version_info: VersionInfo;
  content: string;
  expire_date: string;
  sub_type: string;
  parent_id: string;
  qanon_etebar: string;
  ts_date: string;
  qanon_title: string;
  qanon_id: string;
  ref_key: string;
  html: string;
  id: string;
  content_len: number;
  state_etebar: string;
  ts_year: string;
  child_order: number;
  title_type: string;
};
export type OtherInfo = {
  level: number;
  hierarchy: string;
  number_text: string;
  full_path: string;
};
export type VersionInfo = {
  number: number;
  operation: string;
  timestamp: number;
};
// #endregion common Types
// #region ListItem Types
export type ListItem = {
  _index: string;
  _id: string;
  _score: null;
  _source: ListSource;
  sort: number[];
};
export type List = ListItem[];
// #endregion ListItem Types

// #region ActiveEntityViewSchema Types
export type ActiveEntityViewSchema = {
  key: string;
  routeName: string;
  type: string;
  label: string;
  header: {
    componentName: string;
    top_main: HeaderItems[];
    top_jump: [];
    top_mirror: HeaderItems[];
    tools: {
      showCompare: number;
      showSearch: number;
      showHeading: number;
      showSettings: number;
      showHilight: number;
      showChanges: number;
    };
  };
  entityPanel: {
    entityHeading: EntityPanel & {
      type: string;
    };
    navigation: EntityPanel;
  };
  contextMenu: ContextMenu[];
  researchs: Researchs[];
  property: Property[];
  settings: Settings[];
  versionEnable: false;
  field_collapse: string;
  entity_title: string;
  items: ActiveEntityViewSchemaItems[];
  tabs: Tabs[];
};
export type Property = {
  title: string;
  key: string;
  type: string;
  items: PropertyItem[];
};
export type PropertyItem = {
  hideInCreateEntity: number;
  key: string;
  label: string;
  type: string;
  placeholder: string;
  required: string;
  validation_regex: string;
  validation_error: string;
  multi_select: string;
  options: [];
  labelClass: string;
  inputClass: string;
};
export type Panel = {
  header: [{ key: string; label: string; type: string }];
  content: { key: string; label: string; type: string };
};
export type ContextMenu = {
  key: string;
  title: string;
  icon: string;
  panel: Panel[];
  form?: [];
};
export type TstateOptions = {
  value: string;
  title: string;
  type_label: string;
  showInput: number;
};
export type ActiveEntityViewSchemaItems = {
  title: string;
  scrollTitle: string;
  key: string;
  type: string;
  filed_state: string;
  readonly: number;
  modalName: string;
  completion: string;
  tstate_options: TstateOptions[];
  items: ActiveEntityViewSchemaItemschilds[];
};
export type ActiveEntityViewSchemaItemschilds = {
  key: string;
  label: string;
};
export type EntityPanel = {
  title: string;
  key: string;
  routeName: string;
};
export type HeaderItems = {
  title: string;
  key: string;
  type: string;
  col: string;
};
export type Researchs = {
  key: string;
  title: string;
  icon: string;
  form: [];
};
export type Settings = {
  label: string;
  key: string;
  type: string;
  items: [{ value: string; title: string }];
  default: string | boolean;
};
export type Tabs = {
  title: string;
  componentName: string;
  key: string;
};
// #endregion ActiveEntityViewSchema Types
// #region ActiveSystem Types
export type ActiveSystem = {
  id: number;
  created_at: number;
  updated_at: number;
  title: string;
  users: string;
  organ: string;
  owner: number;
  comment: string;
  link: string;
  showInDashboard: number;
  loading: boolean;
};
// #endregion ActiveSystem Types
// #region ActiveTab  Types
export type ActiveTab = {
  title: string;
  componentName: string;
  key: string;
};
// #endregion ActiveTab  Types
export type EntityViewSchema = ActiveEntityViewSchema[];
// #region ListEntity Types
export type ListEntity = [
  ListItem & {
    fields: { qanon_id: string[] };
    inner_hits: InnerHits;
  }
];
export type InnerHits = {
  by_collapse: {
    hits: {
      total: { value: number; relation: string };
      max_score: number;
      hits: ListItem[];
    };
  };
};
// #endregion ListEntity Types
export type SelectedItemEntity = ListItem & ListSource;
// #region SimilarInfo Types

export type SimilarInfo = {
  type: string;
  show: boolean;
  text: string;
  id: string;
  label: string;
};
// #endregion SimilarInfo Types
// #region qruleActiveTabGetter Types
export type qruleActiveTabGetter = {
  key: string;
  routeName: string;
  type: string;
  label: string;
  field_collapse: string;
  filter: qruleActiveTabFilter[];
  tabs: qruleActiveTabGetterTabs[];
};

export type qruleActiveTabFilter = {
  title: string;
  filter_key: string;
  source_key: string;
  by_more: number;
};

export type qruleActiveTabGetterTabsTable_columns = {
  key: string;
  title: string;
  width: string;
  textAlign: string;
  isLink: boolean;
  trancate_word: number;
  process: string;
};
export type qruleActiveTabGetterTabsItems_headers = {
  key: string;
  label: string;
  options: [{ value: string; title: string }];
};
export type qruleActiveTabGetterTabsItems = {
  key: string;
  label: string;
  type: string;
  placeholder: string;
  required: string;
  delimiter: string;
  isarray: 1;
  classes: string;
  url_GET: string;
  rows: string;
  options: [{ value: string; title: string }];
};
export type qruleActiveTabGetterTabs = {
  title: "اجزاء قانون";
  key: "rulesection";
  componentName: "EntityQModelRule";
  key_filter: "";
  items_headers: qruleActiveTabGetterTabsItems_headers[];
  table_columns: qruleActiveTabGetterTabsTable_columns[];
  items: qruleActiveTabGetterTabsItems[];
};
// #endregion qruleActiveTabGetter Types
export type qruleActiveTab = {
  title: string;
  key: string;
  componentName: string;
  key_filter: string;
  items_headers: [];
  table_columns: qruleActiveTabGetterTabsTable_columns[];
};
export type activeResearchType = { key: string; title: string };
