<commit_before>/*
 * Copyright (C) 2015-2016 Actor LLC. <https://actor.im>
 */

import 'babel-polyfill';
import 'setimmediate';
import 'intl';

import Actor from 'actor-js';
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, IndexRedirect } from 'react-router';
import Modal from 'react-modal';
import Pace from 'pace';
import crosstab from 'crosstab';
import { defaultsDeep } from 'lodash';

import DelegateContainer from '../utils/DelegateContainer';
import SharedContainer from '../utils/SharedContainer';
import SDKDelegate from './actor-sdk-delegate';
import { endpoints, rootElement, helpPhone, appName } from '../constants/ActorAppConstants'

import history from '../utils/history';
import RouterHooks from '../utils/RouterHooks';
import { IntlProvider } from 'react-intl';
import { lightbox } from '../utils/ImageUtils'

import LoginActionCreators from '../actions/LoginActionCreators';
import defaultLogHandler from '../utils/defaultLogHandler';

import LoginStore from '../stores/LoginStore';

import App from '../components/App.react';
import Main from '../components/Main.react';
import DefaultLogin from '../components/Login.react';
import DefaultDeactivated from '../components/Deactivated.react';
import DefaultJoin from '../components/Join.react';
import DefaultInstall from '../components/Install.react';
import DefaultArchive from '../components/Archive.react';
import DefaultDialog from '../components/Dialog.react';
import DefaultEmpty from '../components/Empty.react';

import { extendL18n, getIntlData } from '../l18n';

const ACTOR_INIT_EVENT = 'INIT';

// Init app loading progressbar
Pace.start({
  ajax: false,
  restartOnRequestAfter: false,
  restartOnPushState: false
});

// Init lightbox
lightbox.load({
  animation: false,
  controlClose: '<i class="material-icons">close</i>'
});

window.isJsAppLoaded = false;
window.jsAppLoaded = () => window.isJsAppLoaded = true;

/**
 * Class represents ActorSKD itself
 *
 * @param {object} options - Object contains custom components, actions and localisation strings.
 */
class ActorSDK {
  static defaultOptions = {
    endpoints,
    rootElement,
    appName,
    helpPhone,
    homePage: null,
    twitter: null,
    facebook: null,
    delegate: null,
    forceLocale: null,
    features: {
      calls: true,
      search: false
    },
    isExperimental: false,
    logHandler: defaultLogHandler
  };

  constructor(options = {}) {
    defaultsDeep(this, options, ActorSDK.defaultOptions);

    if (!this.delegate) {
      this.delegate = new SDKDelegate();
    }

    DelegateContainer.set(this.delegate);

    if (this.delegate.l18n) extendL18n();

    SharedContainer.set(this);
  }

  _starter = () => {
    if (crosstab.supported) {
      crosstab.on(ACTOR_INIT_EVENT, (msg) => {
        if (msg.origin !== crosstab.id && window.location.hash !== '#/deactivated') {
          history.push('deactivated');
        }
      });
    }

    const appRootElemet = document.getElementById(this.rootElement);<commit_msg>fix(web): do not override enpoints<commit_after>/*
 * Copyright (C) 2015-2016 Actor LLC. <https://actor.im>
 */

import 'babel-polyfill';
import 'setimmediate';
import 'intl';

import Actor from 'actor-js';
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, IndexRedirect } from 'react-router';
import Modal from 'react-modal';
import Pace from 'pace';
import crosstab from 'crosstab';
import assignDeep from 'assign-deep';

import DelegateContainer from '../utils/DelegateContainer';
import SharedContainer from '../utils/SharedContainer';
import SDKDelegate from './actor-sdk-delegate';
import { endpoints, rootElement, helpPhone, appName } from '../constants/ActorAppConstants'

import history from '../utils/history';
import RouterHooks from '../utils/RouterHooks';
import { IntlProvider } from 'react-intl';
import { lightbox } from '../utils/ImageUtils'

import LoginActionCreators from '../actions/LoginActionCreators';
import defaultLogHandler from '../utils/defaultLogHandler';

import LoginStore from '../stores/LoginStore';

import App from '../components/App.react';
import Main from '../components/Main.react';
import DefaultLogin from '../components/Login.react';
import DefaultDeactivated from '../components/Deactivated.react';
import DefaultJoin from '../components/Join.react';
import DefaultInstall from '../components/Install.react';
import DefaultArchive from '../components/Archive.react';
import DefaultDialog from '../components/Dialog.react';
import DefaultEmpty from '../components/Empty.react';

import { extendL18n, getIntlData } from '../l18n';

const ACTOR_INIT_EVENT = 'INIT';

// Init app loading progressbar
Pace.start({
  ajax: false,
  restartOnRequestAfter: false,
  restartOnPushState: false
});

// Init lightbox
lightbox.load({
  animation: false,
  controlClose: '<i class="material-icons">close</i>'
});

window.isJsAppLoaded = false;
window.jsAppLoaded = () => window.isJsAppLoaded = true;

/**
 * Class represents ActorSKD itself
 *
 * @param {object} options - Object contains custom components, actions and localisation strings.
 */
class ActorSDK {
  static defaultOptions = {
    endpoints,
    rootElement,
    appName,
    helpPhone,
    homePage: null,
    twitter: null,
    facebook: null,
    delegate: null,
    forceLocale: null,
    features: {
      calls: true,
      search: false
    },
    isExperimental: false,
    logHandler: defaultLogHandler
  };

  constructor(options = {}) {
    assignDeep(this, ActorSDK.defaultOptions, options);

    if (!this.delegate) {
      this.delegate = new SDKDelegate();
    }

    DelegateContainer.set(this.delegate);

    if (this.delegate.l18n) extendL18n();

    SharedContainer.set(this);
  }

  _starter = () => {
    if (crosstab.supported) {
      crosstab.on(ACTOR_INIT_EVENT, (msg) => {
        if (msg.origin !== crosstab.id && window.location.hash !== '#/deactivated') {
          history.push('deactivated');
        }
      });
    }

    const appRootElemet = document.getElementById(this.rootElement);
{'fraction_non_alphanumeric': 0.13621480026195154, 'fraction_numerical': 0.005239030779305829, 'mean_word_length': 3.942556634304207, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '4213319', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1731, 'n_words': 469}