<commit_before><!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/index.css" />
<title>MetaX Deck Builder</title>

<body>
<script src="/elm.js"></script>
<script>
	var app = Elm.Main.fullscreen(localStorage.session || null);

	app.ports.storeSession.subscribe(function(session) {
		localStorage.session = session;
	});

	app.ports.exportSession.subscribe(function(session) {
		var decklist = JSON.parse(session);
		var doc = new jsPDF({ format: 'letter' });

		// TODO: This should probably be done in Elm!
		var characters = decklist.filter(function(card) {
			return card.card_type === 'Character';
		});
		var characterSum = characters.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		var battle = decklist.filter(function(card) {
			return card.card_type === 'Battle';
		});
		var battleSum = battle.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		var events = decklist.filter(function(card) {
			return card.card_type === 'Events';
		});
		var eventSum = events.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		function toLine(card, idx) {
			var line = card.quantity + 'x ' + card.title + ' (' + card.id + ')';
			return line;
		}

		var characterLines = characters.map(toLine);
		var battleLines = battle.map(toLine);
		var eventLines = events.map(toLine);

		var lines = []

		if (characterLines.length) {
			lines = lines.concat(['Characters (' + characterSum + ')'], characterLines);
		}

		if (battleLines.length) {
			lines = lines.concat(['', 'Battle Cards (' + battleSum + ')'], battleLines);
		}

		if (eventLines.length) {
			lines = lines.concat(['', 'Events (' + eventSum + ')'], eventLines);
		}<commit_msg>Typo on export<commit_after><!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/index.css" />
<title>MetaX Deck Builder</title>

<body>
<script src="/elm.js"></script>
<script>
	var app = Elm.Main.fullscreen(localStorage.session || null);

	app.ports.storeSession.subscribe(function(session) {
		localStorage.session = session;
	});

	app.ports.exportSession.subscribe(function(session) {
		var decklist = JSON.parse(session);
		var doc = new jsPDF({ format: 'letter' });

		// TODO: This should probably be done in Elm!
		var characters = decklist.filter(function(card) {
			return card.card_type === 'Character';
		});
		var characterSum = characters.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		var battle = decklist.filter(function(card) {
			return card.card_type === 'Battle';
		});
		var battleSum = battle.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		var events = decklist.filter(function(card) {
			return card.card_type === 'Event';
		});
		var eventSum = events.reduce(function(sum, card) {
			return (sum + card.quantity);
		}, 0);

		function toLine(card, idx) {
			var line = card.quantity + 'x ' + card.title + ' (' + card.id + ')';
			return line;
		}

		var characterLines = characters.map(toLine);
		var battleLines = battle.map(toLine);
		var eventLines = events.map(toLine);

		var lines = []

		if (characterLines.length) {
			lines = lines.concat(['Characters (' + characterSum + ')'], characterLines);
		}

		if (battleLines.length) {
			lines = lines.concat(['', 'Battle Cards (' + battleSum + ')'], battleLines);
		}

		if (eventLines.length) {
			lines = lines.concat(['', 'Events (' + eventSum + ')'], eventLines);
		}
{'fraction_non_alphanumeric': 0.1727221911682504, 'fraction_numerical': 0.002794857462269424, 'mean_word_length': 4.062234794908062, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '7092634', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1154, 'n_words': 258}