<commit_before>import React from 'react';
import Helmet from 'react-helmet';
import PropTypes from 'prop-types';

/**
 * This component wraps all pages on the website, and through [Helmet](https://github.com/nfl/react-helmet/)
 * sets up base CSS, favicons, & javascript
 *
 * @module PageWrap
 */
class PageWrap extends React.Component {
	/**
	 * This method ensures important app state props passed
	 * from `AppContainer` are passed to children (feature containers)
	 *
	 * @method renderChildren
	 * @returns {Array} Children with mapped props
	 */
	renderChildren() {
		const { self, localeCode, location } = this.props;

		return React.Children.map(this.props.children, (child, key) =>
			React.cloneElement(child, { self, localeCode, location, key })
		);
	}

	componentDidMount() {
		// Browser has now rendered client-side application - fire the browser TTI trigger
		if (window.newrelic) {
			const now = new Date().getTime();
			// 1. Set a marker in the trace details
			window.newrelic.addToTrace({
				name: 'appInteractive',
				start: now,
				type: 'Browser app has rendered and is interactive',
			});
			// 2. Add a custom attribute to the PageView & BrowserInteraction events in Insights
			window.performance &&
				window.newrelic.setCustomAttribute(
					'timeToAppInteractive',
					now - window.performance.timing.navigationStart // this is the event that NR uses as 'start' of page load
				);
		}
	}

	/**
	 * @return {React.element} the page wrapping component
	 */
	render() {
		const { head, iconSprite, localeCode } = this.props;

		// Parse localeCode for ISO 639-1 languages code.
		// (ie. 'en', 'it', etc)
		// @see https://github.com/meetup/swarm-sasstools/blob/master/scss/utils/helpers/_i18n.scss
		const lang = localeCode.substring(0, 2);

		return (
			<div
				id="root"
				className={`column lang_${lang}`}
				style={{ minHeight: '100vh' }}
			>
				{head}

				<Helmet defaultTitle="Meetup" titleTemplate="%s - Meetup">
					<meta name="viewport" content="width=device-width, initial-scale=1" />
					<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><commit_msg>Seeting UserTiming mark and measure to show up in dev tools.<commit_after>import React from 'react';
import Helmet from 'react-helmet';
import PropTypes from 'prop-types';

/**
 * This component wraps all pages on the website, and through [Helmet](https://github.com/nfl/react-helmet/)
 * sets up base CSS, favicons, & javascript
 *
 * @module PageWrap
 */
class PageWrap extends React.Component {
	/**
	 * This method ensures important app state props passed
	 * from `AppContainer` are passed to children (feature containers)
	 *
	 * @method renderChildren
	 * @returns {Array} Children with mapped props
	 */
	renderChildren() {
		const { self, localeCode, location } = this.props;

		return React.Children.map(this.props.children, (child, key) =>
			React.cloneElement(child, { self, localeCode, location, key })
		);
	}

	componentDidMount() {
		// Browser has now rendered client-side application - fire the browser TTI triggers

		// Fire TTI trigger to be sent to NewRelic
		if (window.newrelic) {
			const now = new Date().getTime();
			// 1. Set a marker in the trace details
			window.newrelic.addToTrace({
				name: 'appInteractive',
				start: now,
				type: 'Browser app has rendered and is interactive',
			});
			// 2. Add a custom attribute to the PageView & BrowserInteraction events in Insights
			window.performance &&
				window.newrelic.setCustomAttribute(
					'timeToAppInteractive',
					now - window.performance.timing.navigationStart // this is the event that NR uses as 'start' of page load
				);
		}

		// Add W3C UserTiming mark for TTI and measure (from navigationStart to newly created mark)
		if (
			window.performance &&
			window.performance.mark &&
			window.performance.measure
		) {
			window.performance.mark('meetup-tti');
			window.performance.measure('navigationStart', 'meetup-tti');
		}

		// Specially for Developer Tools in the browsers (Chrome & Firefox), create entry for the event so it shows up on Performance timeline
		if (console && console.timeStamp) {
			console.timeStamp('meetup-tti');
		}
	}

	/**
	 * @return {React.element} the page wrapping component
	 */
	render() {
		const { head, iconSprite, localeCode } = this.props;

		// Parse localeCode for ISO 639-1 languages code.
		// (ie. 'en', 'it', etc)
		// @see https://github.com/meetup/swarm-sasstools/blob/master/scss/utils/helpers/_i18n.scss
		const lang = localeCode.substring(0, 2);

		return (
			<div
				id="root"
				className={`column lang_${lang}`}
				style={{ minHeight: '100vh' }}
			>
				{head}

				<Helmet defaultTitle="Meetup" titleTemplate="%s - Meetup">
					<meta name="viewport" content="width=device-width, initial-scale=1" />
					<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
{'fraction_non_alphanumeric': 0.12595027737826175, 'fraction_numerical': 0.006369426751592357, 'mean_word_length': 3.5074074074074075, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2978422', 'n_tokens_mistral': 1711, 'n_tokens_neox': 1465, 'n_words': 448}