<commit_before>import { h } from 'snabbdom'
import sanWriter from './sanWriter';
import RoundController from '../ctrl';
import { renderClock } from '../clock/clockView';
import { renderInner as tableInner } from '../view/table';
import renderCorresClock from '../corresClock/corresClockView';
import { userHtml } from '../view/user';
import { plyStep } from '../round';
import { DecodedDests, Position } from '../interfaces';
import { files } from 'chessground/types';
import { invRanks } from 'chessground/util';
import { view as gameView } from 'game';

type Sans = {
  [key: string]: Uci;
}

window.lichess.RoundNVUI = function() {

  return {
    render(ctrl: RoundController) {
      const d = ctrl.data,
        step = plyStep(d, ctrl.ply);
      return h('div.nvui', [
        h('h1', 'Textual representation'),
        h('dl', [
          ...(ctrl.isPlaying() ? [
            h('dt', 'Your color'),
            h('dd', d.player.color),
            h('dt', 'Opponent'),
            h('dd', userHtml(ctrl, d.player))
          ] : [
            h('dt', 'White player'),
            h('dd', userHtml(ctrl, ctrl.playerByColor('white'))),
            h('dt', 'Black player'),
            h('dd', userHtml(ctrl, ctrl.playerByColor('black')))
          ]),
          h('dt', 'PGN'),
          h('dd.pgn', {
            attrs: {
              role : 'log',
              'aria-live': 'off'
            }
          }, d.steps.slice(1).map(s => h('span', s.san))),
          h('dt', 'FEN'),
          // h('dd.fen')(step.fen),
          h('dt', 'Game status'),
          h('dd.status', {
            attrs: {
              role : 'status',
              'aria-live' : 'assertive',
              'aria-atomic' : true
            }
          }, ctrl.data.game.status.name === 'started' ? 'Playing' : gameView.status(ctrl)),
          h('dt', 'Last move'),
          h('dd.lastMove', {
            attrs: {
              'aria-live' : 'assertive',
              'aria-atomic' : true
            }
          }, step.san),
          ctrl.isPlaying() ? h('form', {
            hook: {
              insert(vnode) {
                const el = vnode.elm as HTMLFormElement;
                const d = ctrl.data;
                const $form = $(el).submit(function() {<commit_msg>fix nvui fen<commit_after>import { h } from 'snabbdom'
import sanWriter from './sanWriter';
import RoundController from '../ctrl';
import { renderClock } from '../clock/clockView';
import { renderInner as tableInner } from '../view/table';
import renderCorresClock from '../corresClock/corresClockView';
import { userHtml } from '../view/user';
import { plyStep } from '../round';
import { DecodedDests, Position } from '../interfaces';
import { files } from 'chessground/types';
import { invRanks } from 'chessground/util';
import { view as gameView } from 'game';

type Sans = {
  [key: string]: Uci;
}

window.lichess.RoundNVUI = function() {

  return {
    render(ctrl: RoundController) {
      const d = ctrl.data,
        step = plyStep(d, ctrl.ply);
      return h('div.nvui', [
        h('h1', 'Textual representation'),
        h('dl', [
          ...(ctrl.isPlaying() ? [
            h('dt', 'Your color'),
            h('dd', d.player.color),
            h('dt', 'Opponent'),
            h('dd', userHtml(ctrl, d.player))
          ] : [
            h('dt', 'White player'),
            h('dd', userHtml(ctrl, ctrl.playerByColor('white'))),
            h('dt', 'Black player'),
            h('dd', userHtml(ctrl, ctrl.playerByColor('black')))
          ]),
          h('dt', 'PGN'),
          h('dd.pgn', {
            attrs: {
              role : 'log',
              'aria-live': 'off'
            }
          }, d.steps.slice(1).map(s => h('span', s.san))),
          h('dt', 'FEN'),
          h('dd.fen', step.fen),
          h('dt', 'Game status'),
          h('dd.status', {
            attrs: {
              role : 'status',
              'aria-live' : 'assertive',
              'aria-atomic' : true
            }
          }, ctrl.data.game.status.name === 'started' ? 'Playing' : gameView.status(ctrl)),
          h('dt', 'Last move'),
          h('dd.lastMove', {
            attrs: {
              'aria-live' : 'assertive',
              'aria-atomic' : true
            }
          }, step.san),
          ctrl.isPlaying() ? h('form', {
            hook: {
              insert(vnode) {
                const el = vnode.elm as HTMLFormElement;
                const d = ctrl.data;
                const $form = $(el).submit(function() {
{'fraction_non_alphanumeric': 0.17762577228596646, 'fraction_numerical': 0.00088261253309797, 'mean_word_length': 1.7522768670309654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '492469', 'n_tokens_mistral': 1382, 'n_tokens_neox': 1353, 'n_words': 307}