<commit_before>(typeof define === 'function' && define.amd ? define : /* istanbul ignore next */ function (factory) {
	this.RecorderProxy = factory();
})(function () {
	function getHotkey(event) {
		var hotkey = {};

		[ 'altKey', 'ctrlKey', 'keyIdentifier', 'metaKey', 'shiftKey' ].forEach(function (key) {
			hotkey[key] = event[key];
		});

		return hotkey;
	}

	function RecorderProxy(chrome, panel) {
		this.chrome = chrome;
		this.panel = panel;

		this._initializeUi();
		this._initializePort();
	}

	RecorderProxy.prototype = {
		constructor: RecorderProxy,

		chrome: null,

		contentWindow: null,

		panel: null,

		_port: null,

		recording: false,

		_recordButton: null,

		_script: null,

		_toggleOnShow: null,

		_getHotkeyLabel: function (hotkey) {
			var charMap;
			var metaMap;
			var getKey;

			function getChar(key) {
				return key.slice(0, 2) === 'U+' ?
					String.fromCharCode(Number('0x' + key.slice(2))).toUpperCase() :
					null;
			}

			if (this.contentWindow.navigator.platform === 'MacIntel') {
				metaMap = {
					'Alt': '⌥',
					'Control': '^',
					'Meta': '⌘',
					'Shift': '⇧'
				};
				charMap = {
					'U+0008': 'Backspace',
					'U+0009': '↹',
					'U+0020': 'Space',
					'U+001B': '⎋',
					'U+007F': 'Delete',
					'Down': '↓',
					'Left': '←',
					'Right': '→',
					'Up': '↑'
				};
				getKey = function (hotkey) {
					return hotkey.keyIdentifier;
				};
			}
			else {
				metaMap = {
					'Alt': 'Alt+',
					'Control': 'Ctrl+',
					'Meta': 'Win+',
					'Shift': 'Shift+'
				};
				charMap = {
					'U+0008': 'Backspace',
					'U+0009': 'Tab',
					'U+0020': 'Space',
					'U+001B': 'Esc',
					'U+007F': 'Del'
				};
				// Chrome on Windows has character layout bugs, see
				// https://code.google.com/p/chromium/issues/detail?id=48111
				// To resolve this for now we just add more maps for the incorrect values on standard US keyboard
				getKey = (function () {
					var badKeyIdentifiers = {
						'U+00BA': [ 'U+003B', 'U+003A' ],
						'U+00BB': [ 'U+003D', 'U+002B' ],
						'U+00BC': [ 'U+002C', 'U+003C' ],
						'U+00BD': [ 'U+002D', 'U+005F' ],
						'U+00BE': [ 'U+002E', 'U+003E' ],
						'U+00BF': [ 'U+002F', 'U+003F' ],
						'U+00DB': [ 'U+005B', 'U+007B' ],
						'U+00DC': [ 'U+005C', 'U+007C' ],
						'U+00DD': [ 'U+005D', 'U+007D' ],
						'U+00C0': [ 'U+0060', 'U+007E' ],
						'U+00DE': [ 'U+0027', 'U+0022' ]
					};

					return function (hotkey) {
						var fixedValues = badKeyIdentifiers[hotkey.keyIdentifier];
						if (fixedValues) {
							return fixedValues[hotkey.shiftKey ? 1 : 0];
						}
						return hotkey.keyIdentifier;
					};
				})();
			}

			function getHotkeyLabel(hotkey) {
				function append(key) {<commit_msg>Make bad key identifier map more human-readable<commit_after>(typeof define === 'function' && define.amd ? define : /* istanbul ignore next */ function (factory) {
	this.RecorderProxy = factory();
})(function () {
	function getHotkey(event) {
		var hotkey = {};

		[ 'altKey', 'ctrlKey', 'keyIdentifier', 'metaKey', 'shiftKey' ].forEach(function (key) {
			hotkey[key] = event[key];
		});

		return hotkey;
	}

	function RecorderProxy(chrome, panel) {
		this.chrome = chrome;
		this.panel = panel;

		this._initializeUi();
		this._initializePort();
	}

	RecorderProxy.prototype = {
		constructor: RecorderProxy,

		chrome: null,

		contentWindow: null,

		panel: null,

		_port: null,

		recording: false,

		_recordButton: null,

		_script: null,

		_toggleOnShow: null,

		_getHotkeyLabel: function (hotkey) {
			var charMap;
			var metaMap;
			var getKey;

			function getChar(key) {
				return key.slice(0, 2) === 'U+' ?
					String.fromCharCode(Number('0x' + key.slice(2))).toUpperCase() :
					null;
			}

			if (this.contentWindow.navigator.platform === 'MacIntel') {
				metaMap = {
					'Alt': '⌥',
					'Control': '^',
					'Meta': '⌘',
					'Shift': '⇧'
				};
				charMap = {
					'U+0008': 'Backspace',
					'U+0009': '↹',
					'U+0020': 'Space',
					'U+001B': '⎋',
					'U+007F': 'Delete',
					'Down': '↓',
					'Left': '←',
					'Right': '→',
					'Up': '↑'
				};
				getKey = function (hotkey) {
					return hotkey.keyIdentifier;
				};
			}
			else {
				metaMap = {
					'Alt': 'Alt+',
					'Control': 'Ctrl+',
					'Meta': 'Win+',
					'Shift': 'Shift+'
				};
				charMap = {
					'U+0008': 'Backspace',
					'U+0009': 'Tab',
					'U+0020': 'Space',
					'U+001B': 'Esc',
					'U+007F': 'Del'
				};
				// Chrome on Windows has character layout bugs, see
				// https://code.google.com/p/chromium/issues/detail?id=48111
				// To resolve this for now we just add more maps for the incorrect values on standard US keyboard
				getKey = (function () {
					var badKeyIdentifiers = {
						'U+00BA': ';:',
						'U+00BB': '=+',
						'U+00BC': ',<',
						'U+00BD': '-_',
						'U+00BE': '.>',
						'U+00BF': '/?',
						'U+00DB': '[{',
						'U+00DC': '\\|',
						'U+00DD': ']}',
						'U+00C0': '`~',
						'U+00DE': '\'"'
					};

					return function (hotkey) {
						var fixedValues = badKeyIdentifiers[hotkey.keyIdentifier];
						if (fixedValues) {
							return 'U+00' + fixedValues.charCodeAt(hotkey.shiftKey ? 1 : 0).toString(16).toUpperCase();
						}
						return hotkey.keyIdentifier;
					};
				})();
			}

			function getHotkeyLabel(hotkey) {
				function append(key) {
{'fraction_non_alphanumeric': 0.1992121553179516, 'fraction_numerical': 0.03995498030388295, 'mean_word_length': 2.6272108843537416, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5590092', 'n_tokens_mistral': 2746, 'n_tokens_neox': 2000, 'n_words': 409}