<commit_before>
import Ember from 'ember';

import ParentMixin from 'ember-cli-smart-tv/mixins/frame/parent';
import RemoteKeydownMixin from 'ember-cli-smart-tv/mixins/remote/remote-keydown';
import KeyCodes from 'ember-cli-smart-tv/services/env/keycodes';
import layout from 'ember-cli-smart-tv/templates/components/frame/window-frame';

const {
  computed, on, run,
  inject, A, observer, defineProperty
} = Ember;

export default Ember.Mixin.create(ParentMixin, RemoteKeydownMixin, {

  classNames:['window-frame'],

  concatenatedProperties: ['bindKeys'],

  registerChildWindow: 'registerChildWindow',

  /**
   * Index of hovered row
   *
   * @property
   * @public
   * @type  { Number }
   */
  hoverIndex: 0,

  /**
   * Layout string of component
   * @private
   */
  layout: layout,

  /**
   * Flag of view, for window frame
   *
   * @property
   * @public
   * @type  { Boolean }
   */
  isWindowFrame: true,

  isHover: false,

  autoActivate: false,

  registerParentCell: true,

  frameService: inject.service('frame'),

  bindKeys: [
    {
      code: KeyCodes.KEY_UP,
      predicates: ['isHoverFrame'],
      handlers: ['changeRowUp'],
    },
    {
      code: KeyCodes.KEY_DOWN,
      predicates: ['isHoverFrame'],
      handlers: ['changeRowDown'],
    },
  ],

  actions: {
    registerRow(row) {
      this.registerRow(row);
    },

    destroyRow(row) {
      this.destroyRow(row);
    },
  },

  /**
   * List of child rows
   *
   * @property
   * @public
   * @type  { Array }
   */
  rows: computed(() => A()),

  registerWindow: on('init', function() {
    run.schedule('render', ()=> {
      const service = this.get('frameService');
      const parentCell = this.get('parentCell');
      const registerParentCell = this.get('registerParentCell');

      if (registerParentCell && parentCell) {
        parentCell.registerChildWindow(this);
      }

      this.trigger('didRegisterWindow');
      service.trigger('didRegisterWindow', this);
    });
  }),

  autoActivateTrigger: observer('autoActivate', function() {
    const autoActivate = this.get('autoActivate');

    if (autoActivate) {
      this.get('frameService').activateWindow(this);
    }
  }).on('didInsertElement'),

  /**
   * Reference to hover row
   *
   * @property
   * @public<commit_msg>Remove deprecation [deprecation id: ember-views.dispatching-modify-property] (didInsertElement hook)<commit_after>
import Ember from 'ember';

import ParentMixin from 'ember-cli-smart-tv/mixins/frame/parent';
import RemoteKeydownMixin from 'ember-cli-smart-tv/mixins/remote/remote-keydown';
import KeyCodes from 'ember-cli-smart-tv/services/env/keycodes';
import layout from 'ember-cli-smart-tv/templates/components/frame/window-frame';

const {
  computed, on, run,
  inject, A, observer, defineProperty
} = Ember;

export default Ember.Mixin.create(ParentMixin, RemoteKeydownMixin, {

  classNames:['window-frame'],

  concatenatedProperties: ['bindKeys'],

  registerChildWindow: 'registerChildWindow',

  /**
   * Index of hovered row
   *
   * @property
   * @public
   * @type  { Number }
   */
  hoverIndex: 0,

  /**
   * Layout string of component
   * @private
   */
  layout: layout,

  /**
   * Flag of view, for window frame
   *
   * @property
   * @public
   * @type  { Boolean }
   */
  isWindowFrame: true,

  isHover: false,

  autoActivate: false,

  registerParentCell: true,

  frameService: inject.service('frame'),

  bindKeys: [
    {
      code: KeyCodes.KEY_UP,
      predicates: ['isHoverFrame'],
      handlers: ['changeRowUp'],
    },
    {
      code: KeyCodes.KEY_DOWN,
      predicates: ['isHoverFrame'],
      handlers: ['changeRowDown'],
    },
  ],

  actions: {
    registerRow(row) {
      this.registerRow(row);
    },

    destroyRow(row) {
      this.destroyRow(row);
    },
  },

  /**
   * List of child rows
   *
   * @property
   * @public
   * @type  { Array }
   */
  rows: computed(() => A()),

  registerWindow: on('init', function() {
    run.schedule('render', ()=> {
      const service = this.get('frameService');
      const parentCell = this.get('parentCell');
      const registerParentCell = this.get('registerParentCell');

      if (registerParentCell && parentCell) {
        parentCell.registerChildWindow(this);
      }

      this.trigger('didRegisterWindow');
      service.trigger('didRegisterWindow', this);
    });
  }),

  autoActivateTrigger: observer('autoActivate', function() {
    run.schedule('render', ()=> {
      const autoActivate = this.get('autoActivate');

      if (autoActivate) {
        this.get('frameService').activateWindow(this);
      }
    });
  }).on('init'),

  /**
   * Reference to hover row
   *
   * @property
   * @public
{'fraction_non_alphanumeric': 0.14731479516026322, 'fraction_numerical': 0.0004245383145828911, 'mean_word_length': 3.006802721088435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '503233', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1497, 'n_words': 288}