<commit_before>define(['jquery', 'cropper'],
	function ($) {
		var scene = document.getElementById('scene'),
			image = document.getElementById('image'),
			canvas = document.getElementById('canvas'),
			cropper = document.getElementById('cropper'),
			$cropper = $(cropper),
			$image = $(image),
			$window = $(window),
			$parent = $image.parent();

		function setupImageCropper(callback) {
			$image
				.cropper({
					data: {
						x1: 0,
						y1: 0,
						width: image.naturalWidth,
						height: image.naturalHeight
					},
					done: callback
				});

			$window
				.on('resize.cc', function () {
					$image.cropper('disable');

					$parent
						.css({
							width: canvas.clientWidth,
							left: parseInt((scene.clientWidth - canvas.clientWidth) / 2)
						});

					$image.cropper('enable');
				})
				.trigger('resize.cc');

			$cropper
				.on('click.cc', function () {
					$image.cropper($image.data('cropper').active ? 'disable' : 'enable');
				});
		}

		function clearImageCropper() {
			$window
				.add($cropper)
				.off('.cc');

			$image.cropper('disable');
			$image.data('cropper', false);
		}

		return {
			setup: setupImageCropper,<commit_msg>Toggle CC now saves it's state<commit_after>define(['jquery', 'cropper'],
	function ($) {
		var scene = document.getElementById('scene'),
			image = document.getElementById('image'),
			canvas = document.getElementById('canvas'),
			cropper = document.getElementById('cropper'),
			$cropper = $(cropper),
			$image = $(image),
			$window = $(window),
			$parent = $image.parent();

		function setupImageCropper(callback) {
			var data;

			$image
				.cropper({
					data: {
						x1: 0,
						y1: 0,
						width: image.naturalWidth,
						height: image.naturalHeight
					},
					done: callback
				});

			$window
				.on('resize.cc', function () {
					$image.cropper('disable');

					$parent
						.css({
							width: canvas.clientWidth,
							left: parseInt((scene.clientWidth - canvas.clientWidth) / 2)
						});

					$image.cropper('enable');
				})
				.trigger('resize.cc');

			$cropper
				.on('click.cc', function () {
					var isActive = $image.data('cropper').active;

					if (isActive) {
						data = $image.cropper('getData');
						$image.cropper('disable');
					} else {
						$image.data('cropper').defaults.data = data;
						$image.cropper('enable');
					}
				});
		}

		function clearImageCropper() {
			$window
				.add($cropper)
				.off('.cc');

			$image.cropper('disable');
			$image.data('cropper', false);
		}

		return {
			setup: setupImageCropper,
{'fraction_non_alphanumeric': 0.1764018691588785, 'fraction_numerical': 0.003894080996884735, 'mean_word_length': 2.7394468704512374, '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': '3272466', 'n_tokens_mistral': 1166, 'n_tokens_neox': 810, 'n_words': 147}