addState(t, s = Z, n = null, o = null, c = null, r = null, d = null, f = null) {
    const g = t == null ? void 0 : t.trim();
    if (this.currentDocument.states.has(g) ? (this.currentDocument.states.get(g).doc || (this.currentDocument.states.get(g).doc = n), this.currentDocument.states.get(g).type || (this.currentDocument.states.get(g).type = s)) : (v.info("Adding state ", g, o), this.currentDocument.states.set(g, {
      id: g,
      descriptions: [],
      type: s,
      doc: n,
      note: c,
      classes: [],
      styles: [],
      textStyles: []
    })), o && (v.info("Setting state description", g, o), typeof o == "string" && this.addDescription(g, o.trim()), typeof o == "object" && o.forEach((E) => this.addDescription(g, E.trim()))), c) {
      const E = this.currentDocument.states.get(g);
      E.note = c, E.note.text = j.sanitizeText(E.note.text, A());
    }
    r && (v.info("Setting state classes", g, r), (typeof r == "string" ? [r] : r).forEach((m) => this.setCssClass(g, m.trim()))), d && (v.info("Setting state styles", g, d), (typeof d == "string" ? [d] : d).forEach((m) => this.setStyle(g, m.trim()))), f && (v.info("Setting state styles", g, d), (typeof f == "string" ? [f] : f).forEach((m) => this.setTextStyle(g, m.trim())));
  }
Function called by parser when a node definition has been found.

@param {null | string} id
@param {null | string} type
@param {null | string} doc
@param {null | string | string[]} descr - description for the state. Can be a string or a list or strings
@param {null | string} note
@param {null | string | string[]} classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class.
@param {null | string | string[]} styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
@param {null | string | string[]} textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.