<commit_before>import Ember from 'ember';
import canUseDOM from 'ember-in-viewport/utils/can-use-dom';
import canUseRAF from 'ember-in-viewport/utils/can-use-raf';
import isInViewport from 'ember-in-viewport/utils/is-in-viewport';
import checkScrollDirection from 'ember-in-viewport/utils/check-scroll-direction';

const {
  get: get,
  set: set,
  setProperties,
  computed,
  merge,
  typeOf,
  run,
  on,
  $
} = Ember;

const {
  scheduleOnce,
  debounce,
  bind,
  next
} = run;

const { not }      = computed;
const { forEach }  = Ember.EnumerableUtils;
const { classify } = Ember.String;

const defaultListeners = [
  { context: window,   event: 'scroll.scrollable' },
  { context: window,   event: 'resize.resizable' },
  { context: document, event: 'touchmove.scrollable' }
];

const rAFIDS        = {};
const lastDirection = {};
const lastPosition  = {};

export default Ember.Mixin.create({
  viewportExited: not('viewportEntered').readOnly(),

  _setInitialState: on('init', function() {
    const options = merge({
      viewportUseRAF    : canUseRAF(),
      viewportEntered   : false,
      viewportListeners : defaultListeners
    }, this._buildOptions());

    setProperties(this, options);
  }),

  _buildOptions(defaultOptions = []) {
    if (this.container) {
      return merge(defaultOptions, this.container.lookup('config:in-viewport'));
    }
  },

  _setupElement: on('didInsertElement', function() {
    if (!canUseDOM) { return; }

    this._setInitialViewport(window);
    this._addObserverIfNotSpying();
    this._bindScrollDirectionListener(window, get(this, 'viewportScrollSensitivity'));

    const listeners = get(this, 'viewportListeners');

    if (!get(this, 'viewportUseRAF')) {<commit_msg>Fixed incorrect default value for buildOptions<commit_after>import Ember from 'ember';
import canUseDOM from 'ember-in-viewport/utils/can-use-dom';
import canUseRAF from 'ember-in-viewport/utils/can-use-raf';
import isInViewport from 'ember-in-viewport/utils/is-in-viewport';
import checkScrollDirection from 'ember-in-viewport/utils/check-scroll-direction';

const {
  get: get,
  set: set,
  setProperties,
  computed,
  merge,
  typeOf,
  run,
  on,
  $
} = Ember;

const {
  scheduleOnce,
  debounce,
  bind,
  next
} = run;

const { not }      = computed;
const { forEach }  = Ember.EnumerableUtils;
const { classify } = Ember.String;

const defaultListeners = [
  { context: window,   event: 'scroll.scrollable' },
  { context: window,   event: 'resize.resizable' },
  { context: document, event: 'touchmove.scrollable' }
];

const rAFIDS        = {};
const lastDirection = {};
const lastPosition  = {};

export default Ember.Mixin.create({
  viewportExited: not('viewportEntered').readOnly(),

  _setInitialState: on('init', function() {
    const options = merge({
      viewportUseRAF    : canUseRAF(),
      viewportEntered   : false,
      viewportListeners : defaultListeners
    }, this._buildOptions());

    setProperties(this, options);
  }),

  _buildOptions(defaultOptions = {}) {
    if (this.container) {
      return merge(defaultOptions, this.container.lookup('config:in-viewport'));
    }
  },

  _setupElement: on('didInsertElement', function() {
    if (!canUseDOM) { return; }

    this._setInitialViewport(window);
    this._addObserverIfNotSpying();
    this._bindScrollDirectionListener(window, get(this, 'viewportScrollSensitivity'));

    const listeners = get(this, 'viewportListeners');

    if (!get(this, 'viewportUseRAF')) {
{'fraction_non_alphanumeric': 0.13650702609693147, 'fraction_numerical': 0.0, 'mean_word_length': 3.9828571428571427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7361559', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1110, 'n_words': 227}