local C=require(script.Parent.Parent.Shared.Util)local O={"\087\104\105\116\101";"\071\114\101\121";"\076\105\103\104\116 \121\101\108\108\111\119";"\066\114\105\099\107 \121\101\108\108\111\119";"\076\105\103\104\116 \103\114\101\101\110 \040\077\105\110\116\041";"\076\105\103\104\116 \114\101\100\100\105\115\104 \118\105\111\108\101\116","\080\097\115\116\101\108 \066\108\117\101","\076\105\103\104\116 \111\114\097\110\103\101 \098\114\111\119\110","\078\111\117\103\097\116","\066\114\105\103\104\116 \114\101\100","\077\101\100\046 \114\101\100\100\105\115\104 \118\105\111\108\101\116","\066\114\105\103\104\116 \098\108\117\101";"\066\114\105\103\104\116 \121\101\108\108\111\119";"\069\097\114\116\104 \111\114\097\110\103\101","\066\108\097\099\107","\068\097\114\107 \103\114\101\121";"\068\097\114\107 \103\114\101\101\110","\077\101\100\105\117\109 \103\114\101\101\110","\076\105\103\046 \089\101\108\108\111\119\105\099\104 \111\114\097\110\103\101";"\066\114\105\103\104\116 \103\114\101\101\110","\068\097\114\107 \111\114\097\110\103\101","\076\105\103\104\116 \098\108\117\105\115\104 \118\105\111\108\101\116","\084\114\097\110\115\112\097\114\101\110\116";"\084\114\046 \082\101\100";"\084\114\046 \076\103 \098\108\117\101";"\084\114\046 \066\108\117\101";"\084\114\046 \089\101\108\108\111\119","\076\105\103\104\116 \098\108\117\101","\084\114\046 \070\108\117\046 \082\101\100\100\105\115\104 \111\114\097\110\103\101","\084\114\046 \071\114\101\101\110";"\084\114\046 \070\108\117\046 \071\114\101\101\110","\080\104\111\115\112\104\046 \087\104\105\116\101";"\076\105\103\104\116 \114\101\100","\077\101\100\105\117\109 \114\101\100","\077\101\100\105\117\109 \098\108\117\101";"\076\105\103\104\116 \103\114\101\121","\066\114\105\103\104\116 \118\105\111\108\101\116","\066\114\046 \121\101\108\108\111\119\105\115\104 \111\114\097\110\103\101";"\066\114\105\103\104\116 \111\114\097\110\103\101","\066\114\105\103\104\116 \098\108\117\105\115\104 \103\114\101\101\110";"\069\097\114\116\104 \121\101\108\108\111\119","\066\114\105\103\104\116 \098\108\117\105\115\104 \118\105\111\108\101\116";"\084\114\046 \066\114\111\119\110";"\077\101\100\105\117\109 \098\108\117\105\115\104 \118\105\111\108\101\116","\084\114\046 \077\101\100\105\046 \114\101\100\100\105\115\104 \118\105\111\108\101\116";"\077\101\100\046 \121\101\108\108\111\119\105\115\104 \103\114\101\101\110","\077\101\100\046 \098\108\117\105\115\104 \103\114\101\101\110";"\076\105\103\104\116 \098\108\117\105\115\104 \103\114\101\101\110";"\066\114\046 \121\101\108\108\111\119\105\115\104 \103\114\101\101\110";"\076\105\103\046 \121\101\108\108\111\119\105\115\104 \103\114\101\101\110","\077\101\100\046 \121\101\108\108\111\119\105\115\104 \111\114\097\110\103\101","\066\114\046 \114\101\100\100\105\115\104 \111\114\097\110\103\101";"\066\114\105\103\104\116 \114\101\100\100\105\115\104 \118\105\111\108\101\116";"\076\105\103\104\116 \111\114\097\110\103\101","\084\114\046 \066\114\105\103\104\116 \098\108\117\105\115\104 \118\105\111\108\101\116";"\071\111\108\100","\068\097\114\107 \110\111\117\103\097\116","\083\105\108\118\101\114";"\078\101\111\110 \111\114\097\110\103\101";"\078\101\111\110 \103\114\101\101\110","\083\097\110\100 \098\108\117\101","\083\097\110\100 \118\105\111\108\101\116";"\077\101\100\105\117\109 \111\114\097\110\103\101","\083\097\110\100 \121\101\108\108\111\119";"\069\097\114\116\104 \098\108\117\101";"\069\097\114\116\104 \103\114\101\101\110";"\084\114\046 \070\108\117\046 \066\108\117\101","\083\097\110\100 \098\108\117\101 \109\101\116\097\108\108\105\099","\083\097\110\100 \118\105\111\108\101\116 \109\101\116\097\108\108\105\099";"\083\097\110\100 \121\101\108\108\111\119 \109\101\116\097\108\108\105\099","\068\097\114\107 \103\114\101\121 \109\101\116\097\108\108\105\099";"\066\108\097\099\107 \109\101\116\097\108\108\105\099","\076\105\103\104\116 \103\114\101\121 \109\101\116\097\108\108\105\099";"\083\097\110\100 \103\114\101\101\110","\083\097\110\100 \114\101\100","\068\097\114\107 \114\101\100";"\084\114\046 \070\108\117\046 \089\101\108\108\111\119","\084\114\046 \070\108\117\046 \082\101\100";"\071\117\110 \109\101\116\097\108\108\105\099";"\082\101\100 \102\108\105\112\047\102\108\111\112";"\089\101\108\108\111\119 \102\108\105\112\047\102\108\111\112","\083\105\108\118\101\114 \102\108\105\112\047\102\108\111\112","\067\117\114\114\121";"\070\105\114\101 \089\101\108\108\111\119";"\070\108\097\109\101 \121\101\108\108\111\119\105\115\104 \111\114\097\110\103\101","\082\101\100\100\105\115\104 \098\114\111\119\110","\070\108\097\109\101 \114\101\100\100\105\115\104 \111\114\097\110\103\101","\077\101\100\105\117\109 \115\116\111\110\101 \103\114\101\121","\082\111\121\097\108 \098\108\117\101";"\068\097\114\107 \082\111\121\097\108 \098\108\117\101";"\066\114\105\103\104\116 \114\101\100\100\105\115\104 \108\105\108\097\099";"\068\097\114\107 \115\116\111\110\101 \103\114\101\121";"\076\101\109\111\110 \109\101\116\097\108\105\099";"\076\105\103\104\116 \115\116\111\110\101 \103\114\101\121";"\068\097\114\107 \067\117\114\114\121";"\070\097\100\101\100 \103\114\101\101\110";"\084\117\114\113\117\111\105\115\101";"\076\105\103\104\116 \082\111\121\097\108 \098\108\117\101";"\077\101\100\105\117\109 \082\111\121\097\108 \098\108\117\101";"\082\117\115\116";"\066\114\111\119\110","\082\101\100\100\105\115\104 \108\105\108\097\099";"\076\105\108\097\099";"\076\105\103\104\116 \108\105\108\097\099";"\066\114\105\103\104\116 \112\117\114\112\108\101";"\076\105\103\104\116 \112\117\114\112\108\101";"\076\105\103\104\116 \112\105\110\107";"\076\105\103\104\116 \098\114\105\099\107 \121\101\108\108\111\119","\087\097\114\109 \121\101\108\108\111\119\105\115\104 \111\114\097\110\103\101";"\067\111\111\108 \121\101\108\108\111\119","\068\111\118\101 \098\108\117\101";"\077\101\100\105\117\109 \108\105\108\097\099";"\083\108\105\109\101 \103\114\101\101\110","\083\109\111\107\121 \103\114\101\121","\068\097\114\107 \098\108\117\101";"\080\097\114\115\108\101\121 \103\114\101\101\110","\083\116\101\101\108 \098\108\117\101";"\083\116\111\114\109 \098\108\117\101";"\076\097\112\105\115";"\068\097\114\107 \105\110\100\105\103\111","\083\101\097 \103\114\101\101\110";"\083\104\097\109\114\111\099\107","\070\111\115\115\105\108","\077\117\108\098\101\114\114\121";"\070\111\114\101\115\116 \103\114\101\101\110","\067\097\100\101\116 \098\108\117\101";"\069\108\101\099\116\114\105\099 \098\108\117\101","\069\103\103\112\108\097\110\116";"\077\111\115\115";"\065\114\116\105\099\104\111\107\101","\083\097\103\101 \103\114\101\101\110";"\071\104\111\115\116 \103\114\101\121";"\076\105\108\097\099";"\080\108\117\109","\079\108\105\118\105\110\101";"\076\097\117\114\101\108 \103\114\101\101\110","\081\117\105\108\108 \103\114\101\121","\067\114\105\109\115\111\110","\077\105\110\116","\066\097\098\121 \098\108\117\101";"\067\097\114\110\097\116\105\111\110 \112\105\110\107","\080\101\114\115\105\109\109\111\110","\077\097\114\111\111\110";"\071\111\108\100";"\068\097\105\115\121 \111\114\097\110\103\101";"\080\101\097\114\108","\070\111\103";"\083\097\108\109\111\110","\084\101\114\114\097 \067\111\116\116\097","\067\111\099\111\097";"\087\104\101\097\116";"\066\117\116\116\101\114\109\105\108\107";"\077\097\117\118\101";"\083\117\110\114\105\115\101";"\084\097\119\110\121";"\082\117\115\116";"\067\097\115\104\109\101\114\101";"\075\104\097\107\105";"\076\105\108\121 \119\104\105\116\101";"\083\101\097\115\104\101\108\108","\066\117\114\103\117\110\100\121";"\067\111\114\107","\066\117\114\108\097\112";"\066\101\105\103\101";"\079\121\115\116\101\114";"\080\105\110\101 \067\111\110\101";"\070\097\119\110 \098\114\111\119\110";"\072\117\114\114\105\099\097\110\101 \103\114\101\121","\067\108\111\117\100\121 \103\114\101\121";"\076\105\110\101\110","\067\111\112\112\101\114";"\068\105\114\116 \098\114\111\119\110","\066\114\111\110\122\101";"\070\108\105\110\116";"\068\097\114\107 \116\097\117\112\101";"\066\117\114\110\116 \083\105\101\110\110\097";"\073\110\115\116\105\116\117\116\105\111\110\097\108 \119\104\105\116\101";"\077\105\100 \103\114\097\121","\082\101\097\108\108\121 \098\108\097\099\107";"\082\101\097\108\108\121 \114\101\100";"\068\101\101\112 \111\114\097\110\103\101","\065\108\100\101\114","\068\117\115\116\121 \082\111\115\101";"\079\108\105\118\101";"\078\101\119 \089\101\108\108\101\114","\082\101\097\108\108\121 \098\108\117\101","\078\097\118\121 \098\108\117\101";"\068\101\101\112 \098\108\117\101";"\067\121\097\110","\067\071\065 \098\114\111\119\110";"\077\097\103\101\110\116\097","\080\105\110\107","\068\101\101\112 \111\114\097\110\103\101","\084\101\097\108";"\084\111\111\116\104\112\097\115\116\101";"\076\105\109\101 \103\114\101\101\110";"\067\097\109\111";"\071\114\105\109\101";"\076\097\118\101\110\100\101\114";"\080\097\115\116\101\108 \108\105\103\104\116 \098\108\117\101","\080\097\115\116\101\108 \111\114\097\110\103\101";"\080\097\115\116\101\108 \118\105\111\108\101\116";"\080\097\115\116\101\108 \098\108\117\101-\103\114\101\101\110","\080\097\115\116\101\108 \103\114\101\101\110";"\080\097\115\116\101\108 \121\101\108\108\111\119";"\080\097\115\116\101\108 \098\114\111\119\110";"\082\111\121\097\108 \112\117\114\112\108\101","\072\111\116 \112\105\110\107"}local V=C.MakeFuzzyFinder(O)local L={Prefixes="\037 \116\101\097\109\067\111\108\111\114",Transform=function(C)local O={}for C,V in pairs(V(C))do O[C]=BrickColor.new(V)end return O end,Validate=function(C)return#C>0,"\078\111 \118\097\108\105\100 \098\114\105\099\107 \099\111\108\111\114\115 \119\105\116\104 \116\104\097\116 \110\097\109\101 \099\111\117\108\100 \098\101 \102\111\117\110\100\046"end,Autocomplete=function(O)return C.GetNames(O)end,Parse=function(C)return C[1]end}local j={Transform=L.Transform,Validate=L.Validate,Autocomplete=L.Autocomplete;Parse=function(C)return C[1].Color end}return function(O)O:RegisterType("\098\114\105\099\107\067\111\108\111\114",L)O:RegisterType("\098\114\105\099\107\067\111\108\111\114\115",C.MakeListableType(L,{Prefixes="\037 \116\101\097\109\067\111\108\111\114\115"}))O:RegisterType("\098\114\105\099\107\067\111\108\111\114\051",j)O:RegisterType("\098\114\105\099\107\067\111\108\111\114\051\115",C.MakeListableType(j))end
local Util = require(script.Parent.Parent.Shared.Util)

local brickColorNames = {
    "White", "Grey", "Light yellow", "Brick yellow", "Light green (Mint)", "Light reddish violet", "Pastel Blue",
    "Light orange brown", "Nougat", "Bright red", "Med. reddish violet", "Bright blue", "Bright yellow", "Earth orange",
    "Black", "Dark grey", "Dark green", "Medium green", "Lig. Yellowich orange", "Bright green", "Dark orange",
    "Light bluish violet", "Transparent", "Tr. Red", "Tr. Lg blue", "Tr. Blue", "Tr. Yellow", "Light blue",
    "Tr. Flu. Reddish orange", "Tr. Green", "Tr. Flu. Green", "Phosph. White", "Light red", "Medium red", "Medium blue",
    "Light grey", "Bright violet", "Br. yellowish orange", "Bright orange", "Bright bluish green", "Earth yellow",
    "Bright bluish violet", "Tr. Brown", "Medium bluish violet", "Tr. Medi. reddish violet", "Med. yellowish green",
    "Med. bluish green", "Light bluish green", "Br. yellowish green", "Lig. yellowish green", "Med. yellowish orange",
    "Br. reddish orange", "Bright reddish violet", "Light orange", "Tr. Bright bluish violet", "Gold", "Dark nougat",
    "Silver", "Neon orange", "Neon green", "Sand blue", "Sand violet", "Medium orange", "Sand yellow", "Earth blue",
    "Earth green", "Tr. Flu. Blue", "Sand blue metallic", "Sand violet metallic", "Sand yellow metallic",
    "Dark grey metallic", "Black metallic", "Light grey metallic", "Sand green", "Sand red", "Dark red",
    "Tr. Flu. Yellow", "Tr. Flu. Red", "Gun metallic", "Red flip/flop", "Yellow flip/flop", "Silver flip/flop", "Curry",
    "Fire Yellow", "Flame yellowish orange", "Reddish brown", "Flame reddish orange", "Medium stone grey", "Royal blue",
    "Dark Royal blue", "Bright reddish lilac", "Dark stone grey", "Lemon metalic", "Light stone grey", "Dark Curry",
    "Faded green", "Turquoise", "Light Royal blue", "Medium Royal blue", "Rust", "Brown", "Reddish lilac", "Lilac",
    "Light lilac", "Bright purple", "Light purple", "Light pink", "Light brick yellow", "Warm yellowish orange",
    "Cool yellow", "Dove blue", "Medium lilac", "Slime green", "Smoky grey", "Dark blue", "Parsley green", "Steel blue",
    "Storm blue", "Lapis", "Dark indigo", "Sea green", "Shamrock", "Fossil", "Mulberry", "Forest green", "Cadet blue",
    "Electric blue", "Eggplant", "Moss", "Artichoke", "Sage green", "Ghost grey", "Lilac", "Plum", "Olivine",
    "Laurel green", "Quill grey", "Crimson", "Mint", "Baby blue", "Carnation pink", "Persimmon", "Maroon", "Gold",
    "Daisy orange", "Pearl", "Fog", "Salmon", "Terra Cotta", "Cocoa", "Wheat", "Buttermilk", "Mauve", "Sunrise",
    "Tawny", "Rust", "Cashmere", "Khaki", "Lily white", "Seashell", "Burgundy", "Cork", "Burlap", "Beige", "Oyster",
    "Pine Cone", "Fawn brown", "Hurricane grey", "Cloudy grey", "Linen", "Copper", "Dirt brown", "Bronze", "Flint",
    "Dark taupe", "Burnt Sienna", "Institutional white", "Mid gray", "Really black", "Really red", "Deep orange",
    "Alder", "Dusty Rose", "Olive", "New Yeller", "Really blue", "Navy blue", "Deep blue", "Cyan", "CGA brown",
    "Magenta", "Pink", "Deep orange", "Teal", "Toothpaste", "Lime green", "Camo", "Grime", "Lavender",
    "Pastel light blue", "Pastel orange", "Pastel violet", "Pastel blue-green", "Pastel green", "Pastel yellow",
    "Pastel brown", "Royal purple", "Hot pink"
}

local brickColorFinder = Util.MakeFuzzyFinder(brickColorNames)

local brickColorType =  {
	Prefixes = "% teamColor";

    Transform = function(text)
        local brickColors = {}
        for i, name in pairs(brickColorFinder(text)) do
            brickColors[i] = BrickColor.new(name)
        end
        return brickColors
    end;

    Validate = function(brickColors)
        return #brickColors > 0, "No valid brick colors with that name could be found."
    end;

    Autocomplete = function(brickColors)
        return Util.GetNames(brickColors)
    end;

    Parse = function(brickColors)
        return brickColors[1]
    end;
}

local brickColor3Type = {
	Transform = brickColorType.Transform;
	Validate = brickColorType.Validate;
	Autocomplete = brickColorType.Autocomplete;

	Parse = function(brickColors)
		return brickColors[1].Color
	end;
}

return function(registry)
    registry:RegisterType("brickColor", brickColorType)
	registry:RegisterType("brickColors", Util.MakeListableType(brickColorType, {
		Prefixes = "% teamColors"
	}))

	registry:RegisterType("brickColor3", brickColor3Type)
    registry:RegisterType("brickColor3s", Util.MakeListableType(brickColor3Type))
end