<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'mobx-react';
import { Router, useRouterHistory } from 'react-router';
import { createHistory } from 'history';
import { syncHistoryWithStore } from 'mobx-react-router';
import ExtendedRoutingStore from './shared/lib/ExtendedRouterStore';
import {
    fetchServerConfig,
    initializeAPIClients,
    initializeAppStore,
    initializeConfiguration,
    setConfigDefaults,
    setServerConfig,
} from './config/config';

import './shared/lib/ajaxQuiet';
import makeRoutes from './routes';
import * as _ from 'lodash';
import $ from 'jquery';
import * as superagent from 'superagent';
import { getHost, buildCBioPortalPageUrl } from './shared/api/urls';
import AppConfig from 'appConfig';
import browser from 'bowser';
import { setNetworkListener } from './shared/lib/ajaxQuiet';
import { initializeTracking } from 'shared/lib/tracking';
import superagentCache from 'superagent-cache';
import { getBrowserWindow } from 'cbioportal-frontend-commons';
import { AppStore } from './AppStore';
import { handleLongUrls } from 'shared/lib/handleLongUrls';
import 'shared/polyfill/canvasToBlob';
import mobx from 'mobx';

superagentCache(superagent);

// this must occur before we initialize tracking
// it fixes the hash portion of url when cohort patient list is too long
handleLongUrls();

// YOU MUST RUN THESE initialize and then set the public path after

initializeConfiguration();
// THIS TELLS WEBPACK BUNDLE LOADER WHERE TO LOAD SPLIT BUNDLES
__webpack_public_path__ = AppConfig.frontendUrl;

if (!window.hasOwnProperty('$')) {
    window.$ = $;
}

if (!window.hasOwnProperty('jQuery')) {
    window.jQuery = $;
}

if (!window.hasOwnProperty('mobx')) {
    window.mobx = mobx;
}

// write browser name, version to brody tag
if (browser) {
    $(document).ready(() => {
        $('body').addClass(browser.name);
    });
}

// e2e test specific stuff
if (getBrowserWindow().navigator.webdriver) {
    $(document).ready(() => {
        $('body').addClass('e2etest');
        window.e2etest = true;
    });

    setNetworkListener();
}

// expose version on window
window.FRONTEND_VERSION = VERSION;
window.FRONTEND_COMMIT = COMMIT;

// this is special function allowing MSKCC CIS to hide login UI in
// portal header
window.postLoadForMskCIS = function() {
    AppConfig.hide_login = true;
};

// make sure lodash doesn't overwrite (or set) global underscore
_.noConflict();

const routingStore = new ExtendedRoutingStore();

const history = useRouterHistory(createHistory)({
    basename: AppConfig.basePath || '',<commit_msg>disable tracking for 3Dmol (fix cBioPortal/cbioportal/issues/3058)<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'mobx-react';
import { Router, useRouterHistory } from 'react-router';
import { createHistory } from 'history';
import { syncHistoryWithStore } from 'mobx-react-router';
import ExtendedRoutingStore from './shared/lib/ExtendedRouterStore';
import {
    fetchServerConfig,
    initializeAPIClients,
    initializeAppStore,
    initializeConfiguration,
    setConfigDefaults,
    setServerConfig,
} from './config/config';

import './shared/lib/ajaxQuiet';
import makeRoutes from './routes';
import * as _ from 'lodash';
import $ from 'jquery';
import * as superagent from 'superagent';
import { getHost, buildCBioPortalPageUrl } from './shared/api/urls';
import AppConfig from 'appConfig';
import browser from 'bowser';
import { setNetworkListener } from './shared/lib/ajaxQuiet';
import { initializeTracking } from 'shared/lib/tracking';
import superagentCache from 'superagent-cache';
import { getBrowserWindow } from 'cbioportal-frontend-commons';
import { AppStore } from './AppStore';
import { handleLongUrls } from 'shared/lib/handleLongUrls';
import 'shared/polyfill/canvasToBlob';
import mobx from 'mobx';

superagentCache(superagent);

// this must occur before we initialize tracking
// it fixes the hash portion of url when cohort patient list is too long
handleLongUrls();

// YOU MUST RUN THESE initialize and then set the public path after

initializeConfiguration();
// THIS TELLS WEBPACK BUNDLE LOADER WHERE TO LOAD SPLIT BUNDLES
__webpack_public_path__ = AppConfig.frontendUrl;

if (!window.hasOwnProperty('$')) {
    window.$ = $;
}

if (!window.hasOwnProperty('jQuery')) {
    window.jQuery = $;
}

if (!window.hasOwnProperty('mobx')) {
    window.mobx = mobx;
}

// write browser name, version to brody tag
if (browser) {
    $(document).ready(() => {
        $('body').addClass(browser.name);
    });
}

// e2e test specific stuff
if (getBrowserWindow().navigator.webdriver) {
    $(document).ready(() => {
        $('body').addClass('e2etest');
        window.e2etest = true;
    });

    setNetworkListener();
}

// expose version on window
window.FRONTEND_VERSION = VERSION;
window.FRONTEND_COMMIT = COMMIT;

// this is special function allowing MSKCC CIS to hide login UI in
// portal header
window.postLoadForMskCIS = function() {
    AppConfig.hide_login = true;
};

// this is the only supported way to disable tracking for the $3Dmol.js
window.$3Dmol = { notrack: true };

// make sure lodash doesn't overwrite (or set) global underscore
_.noConflict();

const routingStore = new ExtendedRoutingStore();

const history = useRouterHistory(createHistory)({
    basename: AppConfig.basePath || '',
{'fraction_non_alphanumeric': 0.12303713282837613, 'fraction_numerical': 0.002401625715869204, 'mean_word_length': 4.518858307849134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1323935', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1604, 'n_words': 468}