@use "sass:list";
@use "sass:meta";
@use "sass:string";
/* TAGGED USERS */
// prettier-ignore
$tagged: (
	// Creator
	"CV Creator": (
		"144881947557101568",	// Zerthox
	),

	// Admins
	"CV Admin": (
		"194151269399527425",	// untuned
		"393900343135830016",	// Nyx
	),

	// Team
	"CV Team": (
		"332394843743584256",	// cruxie
		"240437190339854337",	// Leozard
		"126652966265421824",	// Scars
	),

	// Contributors
	"CV Contributor": (
		"195270435015884800",	// Daemonicdeveloper
		"236579127090610176",	// Danielle
		"97797564866236416",	// Heebeejeebees
		"150750980097441792",	// Orangutan
		"213067580531933196",	// KitKat
		"858800346884997142",	// ShadowDevilsAvenged
		"310468127534350347",	// Miyu
		"384167892012498944",	// Randymations
		"1141445806386319370",  // J-Emil-P
		"427114049487241227",  // NeoNyaa
	),

	// Legacy Donators
	"CV Donator": (
		"262989909411758080",	// coldarchie
		"168551219135119361",	// Auroatic
		"241500427105992704",	// Ghost_Recon131
		"151995147150819328",	// It
		"157699533134888961",	// Jayzer
		"157492606752784384",	// Kazumi
		"174525242939670528",	// lts
		"78890013378486272",	// Macpot
		"213263668312408066",	// Nikolas
		"152431535914614785",	// Paco
		"112619227466182656",	// PieterVMB
		"297873043265552384",	// PureFallen
		"258031697646321666",	// Rich246™
		"109933711142719488",	// Samboy Chips
		"251260900252712962",	// viwalon
		"199184208319610880",	// xImGaming
		"122731339890950145",	// Lilith
		"436228721033216009",	// Hattyot
		"66214870705516544",	// Lordmau5
		"172426681800196096",	// Luan San
		"158311402677731328",	// theLMGN
		"284122164582416385",	// Aetheryx
		"107965218868457472",	// Mudock Yatho
		"183795147236966412",	// blamecoopa
		"245133485688225793",	// Shadowcloud
	),

	// Testers, commented out for now as we aren't really testing anything.
	/*
	"CV Tester": (
		"266991742216175616",	// Alpha$★☆
		"97549189629636608",	// Baked
		"128948605263413248",	// Dingus
		"168481642309091328",	// Jen
		"165581066524950530",	// MoXAriApph
		"102621249892544512",	// Shiniyami ߷
		"94553281296084992",	// Squibbus
		"85410928408924160",	// †电离龙†
		"143476079267414016",	// Reĝino Kastilo
		"131917628800237570",	// FunkoChan
		"155379920242081793",	// Dimii04
		"135130130942132224",	// MTPyronaut
		"123340872333918215",	// Purvesh9211
		"250721335305568258",	// Valcreed
		"297041315852713984",	// Zou_Yongqi
		"128006451053592577",	// Rawrcolond
		"102009847792291840",	// SirSuperDeath
		"513423192484872223",	// O...O (yes that's a real username)
		"580867069621567488",	// skyspell413 / Primrose
	),
	*/

	// Translators / Guide Makers
	"CV Translator": (
		"538745942493495298",	// Kuroikitten
	),
	"CV Guide Maker": (
		"265627010733178892",	// Big Steve
	),

	// Former CV Team Members
	"Retired Old Man": (
  		"335677038830682112",	// Snow
	),
	"Former CV Team": (
		"309976820109803520",	// Leafy
	),

);

// OUTPUT
%messageContent > img {
  & ~ %messageHeader %messageUsername::after {
    content: var(--tag, none);
    color: currentcolor;
    text-shadow: 0 0 2px currentcolor;
    border: 1px solid;
    border-radius: 6px;
    margin-left: 8px;
    background-color: rgba(255, 255, 255, 0.07);
    font-size: 10px;
    padding: 0 5px;
  }
}
// group = what tag will be used, will be used for content: #{$group}
// user = string list for what user(s) will have that tag
// itm = an item in alias when it's a list
// output --lang is the name, as above
@each $group, $user in $tagged {
	// for lists
	$k: "";
	@if meta.type-of($user) == list {
		@if list.length($user) > 1 {
			$k: ":is("; // start :is(
			@for $i from 1 through list.length($user) {
				$k: string.insert($k,"[src*=\"" + list.nth($user,$i) + "\"],",-1);
			}
			// remove extra comma, add closing )
			$k: string.slice($k,0,-2) + ")";
		} @else {
			$k: "[src*=\"" + list.nth($user,1) + "\"]";
		}
	} @else {
	// and for single strings
		$k: "[src*=\"#{$user}\"]";
	}
	%avatarLarge#{$k} ~ %messageHeader {
		--tag: "#{$group}";
	}
}
