local L,m do local i="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061"..MAP_ID;(game:GetService("\067\111\110\116\101\110\116\080\114\111\118\105\100\101\114")):Preload(i)local M do local L=math.floor function M(m)return L((m/14)%14),L(m%14)end end function L(L,m)local N,T=M(m)local x=Vector2_new(256,256)local f,H=2,1 local t=16 local b="\070\114\097\109\101"if type(L)=="\115\116\114\105\110\103"then b=L L=nil end if not L then L=Create(b,{Name="\073\099\111\110",BackgroundTransparency=1,ClipsDescendants=true;Create("\073\109\097\103\101\076\097\098\101\108",{Name="\073\099\111\110\077\097\112";Active=false,BackgroundTransparency=1;Image=i;Size=UDim2_new(x.x/t,0,x.y/t,0)})})end L.IconMap.Position=UDim2_new(-T-(f*(T+1)+H)/t,0,-N-(f*(N+1)+H)/t,0)return L end function m(L,m)local i=m*16 local M="\070\114\097\109\101"if type(L)=="\115\116\114\105\110\103"then M=L L=nil end if not L then L=Create(M,{Name="\073\099\111\110",BackgroundTransparency=1;ClipsDescendants=true,Create("\073\109\097\103\101\076\097\098\101\108",{Name="\073\099\111\110\077\097\112";BackgroundTransparency=1,Image=CLASS_MAP_ID;ImageRectSize=Vector2_new(16,16),ImageRectOffset=Vector2_new(i,0),Size=UDim2_new(1,0,1,0);Parent=L})})end L.IconMap.ImageRectOffset=Vector2_new(i,0)return L end end

local Icon, ClassIcon do
	local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
	game:GetService('ContentProvider'):Preload(iconMap)
	local iconDehash do
		-- 14 x 14, 0-based input, 0-based output
		local f=math.floor
		function iconDehash(h)
			return f(h/14%14),f(h%14)
		end
	end

	function Icon(IconFrame,index)
		local row,col = iconDehash(index)
		local mapSize = Vector2_new(256,256)
		local pad,border = 2,1
		local iconSize = 16

		local class = 'Frame'
		if type(IconFrame) == 'string' then
			class = IconFrame
			IconFrame = nil
		end

		if not IconFrame then
			IconFrame = Create(class,{
				Name = "Icon";
				BackgroundTransparency = 1;
				ClipsDescendants = true;
				Create('ImageLabel',{
					Name = "IconMap";
					Active = false;
					BackgroundTransparency = 1;
					Image = iconMap;
					Size = UDim2_new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
				});
			})
		end

		IconFrame.IconMap.Position = UDim2_new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
		return IconFrame
	end

	function ClassIcon(IconFrame, index)
		local offset = index * 16

		local class = 'Frame'
		if type(IconFrame) == 'string' then
			class = IconFrame
			IconFrame = nil
		end

		if not IconFrame then
			IconFrame = Create(class,{
				Name = "Icon";
				BackgroundTransparency = 1;
				ClipsDescendants = true;
				Create('ImageLabel',{
					Name = "IconMap";
					BackgroundTransparency = 1;
					Image = CLASS_MAP_ID;
					ImageRectSize = Vector2_new(16, 16);
					ImageRectOffset = Vector2_new(offset, 0);
					Size = UDim2_new(1, 0, 1, 0);
					Parent = IconFrame
				});
			})
		end 

		IconFrame.IconMap.ImageRectOffset = Vector2_new(offset, 0);
		return IconFrame
	end
end
