use utf8;
use strict;
use warnings;
no warnings 'qw';
use Shiar_Sheet::KeyboardChars 'kbchars';

my %rows = qw(
	` 🤖
	1 🦄
	2 🔥
	3 🎉
	4 💰
	~ 🏻 ! 🏼 @ 🏽 # 🏾 $ 🏿
	5 🎶 % 🍿
	6 💩 ^ 🍑
	7 🙈 & 🌭
	8 ☀️ * ☔
	9 👀 ( ❄️
	0 💯 ) 🇺🇸
	- 🔫 _ 🕊️
	= 💁 + 🙅
	q 👉 Q 👈 ^q ☝
	w ✌ W 🤘 ^w ✊
	e 🙌 E 💪 ^e 🏋
	r 👌 R 👋 ^r 💦
	t 👍 T 👎 ^t 👑
	y ♥ Y 💔 ^y 💙
	u 💕 U 💋 ^u 💏
	i 👏 I ⚡ ^i 🎁
	o 🙏 O 👊 ^o 🕴
	p ✋ P 👆 ^p 🍔
	[ 🌮 { 🍕
	] ☕ } 🍻
	\ ✨ | 🌟
	a 😍 A 😻 ^a 🏀
	s 😘 S 👫 ^s 🏈
	d 😳 D 😨 ^d ⚽
	f 😜 F 😋 ^f 😝
	g 😊 G 🤗 ^g 🏃
	h 😂 H 😆 ^h 💐
	j 😄 J 🙃 ^j 🌹
	k 😉 K 👯 ^k 🌈
	l 😌 L 💃 ^l 🍭
	; 😎 : 🤓
	' 🤔 " 🎅
	z 😈 Z ⛄ ^z 👻
	x 😡 X ☠️ ^x ⚔️
	c 😱 C 🙊 ^c 👽
	v 😬 V 👼 ^v 🛠️
	b 😑 B 😶 ^b 😷
	n 😒 N 🙄 ^n 😏
	m 😢 M 👶 ^m 🐶
	, 😭 < 😖
	. 😔 > 😩
	/ 😴 ? 😞
);

my $groups = kbchars(\%rows);

while (my ($k, $c) = each %rows) {
	# override letter-based classes by unicode versions
	$groups->{def}{''}{$k} = (
		$c =~ /\p{General_Category=Modifier_Symbol}/ ? 'g9' :
		$c =~ /\p{In=1.1}/ ? 'g2' :
		$c =~ /\p{In=5.2}/ ? 'g3' :
		$c =~ /\p{In=6.0}/ ? 'g4' :
		$c =~ /\p{In=7.0}/ ? 'g5' :
		$c =~ /\p{In=8.0}/ ? 'g7' :
		'g0' # unexpectedly newer
	);
}

+{
	%{$groups},
	title => 'EmojiWorks',
	version => '1.0',
	category => 'legacy/emoji',
	tableclass => 'keys big',
	intro => join("\n",
		"Commercial product from 2015 (no longer available)",
		"with <em>emoji</em> (Alt) buttons",
		"to insert various Unicode emoticons and other symbols.",
	),
	description => [
		"Legacy EmojiWorks keyboard layout",
		"for typing a selection of Unicode emoji symbols.",
	],
	rows => [2, 1, 0],
	moderows => '321-21',
	image => 'data/keyboard/thumb/emojiworks.jpg',
	flag => {
		g2 => ['legacy'   => "Already in Unicode 1.1 released in 1993 as text symbols"],
		g3 => ['predated' => "Updates up to Unicode 5.2 between, retroactively emojified"],
		g4 => ['first'    => "Initial emoji support with Unicode 6.0 in 2010"],
		g5 => ['update'   => "Extensions in Unicode 6.1 and 7.0 (2014)"],
		g7 => ['latest'   => "Added in Unicode 8.0, in 2015 when these characters were selected"],
		g9 => ['modifier' => "Fitzpatrick skin colour selection marks in Unicode 8.0"],
	},
}
