ImageLabel.defaultProps={BackgroundTransparency=1,BorderSizePixel=0;Size=UDim2.new(1,0,1,0);Image=""}function ImageLabel.render(Z)local Q=Support.CloneTable(Z.props)local A=Z.state if Q.AspectRatio then local Z=new("\085\073\065\115\112\101\099\116\082\097\116\105\111\067\111\110\115\116\114\097\105\110\116",{AspectRatio=Q.AspectRatio})Q[Roact.Children]=Support.Merge({AspectRatio=Z},Q[Roact.Children]or{})end if Q.Layout=="\076\105\115\116"then local A=new("\085\073\076\105\115\116\076\097\121\111\117\116",{FillDirection=Q.LayoutDirection,Padding=Q.LayoutPadding;HorizontalAlignment=Q.HorizontalAlignment,VerticalAlignment=Q.VerticalAlignment,SortOrder=Q.SortOrder or"\076\097\121\111\117\116\079\114\100\101\114",[Roact.Ref]=function(Q)Z:UpdateContentSize(Q)end;[Roact.Change.AbsoluteContentSize]=function(Q)Z:UpdateContentSize(Q)end})Q.Size=Z:GetSize()Q[Roact.Children]=Support.Merge({Layout=A},Q[Roact.Children])end if type(Q.ImageColor)=="\115\116\114\105\110\103"then local Z,A,F=(Q.ImageColor:lower()):match("\035\063\040\046\046\041\040\046\046\041\040\046\046\041")Q.ImageColor3=Color3.fromRGB(tonumber(Z,16),tonumber(A,16),tonumber(F,16))end Q.AspectRatio=nil Q.Layout=nil Q.LayoutDirection=nil Q.LayoutPadding=nil Q.HorizontalAlignment=nil Q.VerticalAlignment=nil Q.HorizontalPadding=nil Q.VerticalPadding=nil Q.SortOrder=nil Q.Width=nil Q.Height=nil Q.ImageColor=nil return new("\073\109\097\103\101\076\097\098\101\108",Q)end function ImageLabel.GetSize(Q,Z)local A=Q.props local F=A.Size=="\087\082\065\080\095\067\079\078\084\069\078\084"or A.Width=="\087\082\065\080\095\067\079\078\084\069\078\084"local b=A.Size=="\087\082\065\080\095\067\079\078\084\069\078\084"or A.Height=="\087\082\065\080\095\067\079\078\084\069\078\084"local q=F or b local U=UDim2.new(0,A.HorizontalPadding or 0,0,A.VerticalPadding or 0)return U+UDim2.new((Z and F)and UDim.new(0,Z.X)or typeof(A.Width)=="\085\068\105\109"and A.Width or A.Size.X,(Z and b)and UDim.new(0,Z.Y)or typeof(A.Height)=="\085\068\105\109"and A.Height or A.Size.Y)end function ImageLabel.UpdateContentSize(Q,Z)if not(Z and Z.Parent)then return end Z.Parent.Size=Q:GetSize(Z.AbsoluteContentSize)end return ImageLabel
-- Set defaults
ImageLabel.defaultProps = {
	BackgroundTransparency = 1,
	BorderSizePixel = 0,
	Size = UDim2.new(1, 0, 1, 0),
	Image = "",
}

function ImageLabel:render()
	local props = Support.CloneTable(self.props)
	local state = self.state

	-- Include aspect ratio constraint if specified
	if props.AspectRatio then
		local Constraint = new("UIAspectRatioConstraint", {
			AspectRatio = props.AspectRatio,
		})

		-- Insert constraint into children
		props[Roact.Children] = Support.Merge({ AspectRatio = Constraint }, props[Roact.Children] or {})
	end

	-- Include list layout if specified
	if props.Layout == "List" then
		local Layout = new("UIListLayout", {
			FillDirection = props.LayoutDirection,
			Padding = props.LayoutPadding,
			HorizontalAlignment = props.HorizontalAlignment,
			VerticalAlignment = props.VerticalAlignment,
			SortOrder = props.SortOrder or "LayoutOrder",
			[Roact.Ref] = function(rbx)
				self:UpdateContentSize(rbx)
			end,
			[Roact.Change.AbsoluteContentSize] = function(rbx)
				self:UpdateContentSize(rbx)
			end,
		})

		-- Update size
		props.Size = self:GetSize()

		-- Insert layout into children
		props[Roact.Children] = Support.Merge({ Layout = Layout }, props[Roact.Children])
	end

	-- Parse hex colors
	if type(props.ImageColor) == "string" then
		local R, G, B = props.ImageColor:lower():match("#?(..)(..)(..)")
		props.ImageColor3 = Color3.fromRGB(tonumber(R, 16), tonumber(G, 16), tonumber(B, 16))
	end

	-- Filter out custom properties
	props.AspectRatio = nil
	props.Layout = nil
	props.LayoutDirection = nil
	props.LayoutPadding = nil
	props.HorizontalAlignment = nil
	props.VerticalAlignment = nil
	props.HorizontalPadding = nil
	props.VerticalPadding = nil
	props.SortOrder = nil
	props.Width = nil
	props.Height = nil
	props.ImageColor = nil

	-- Display component in wrapper
	return new("ImageLabel", props)
end

function ImageLabel:GetSize(ContentSize)
	local props = self.props

	-- Determine dynamic dimensions
	local DynamicWidth = props.Size == "WRAP_CONTENT" or props.Width == "WRAP_CONTENT"
	local DynamicHeight = props.Size == "WRAP_CONTENT" or props.Height == "WRAP_CONTENT"
	local DynamicSize = DynamicWidth or DynamicHeight

	-- Get padding from props
	local Padding = UDim2.new(0, props.HorizontalPadding or 0, 0, props.VerticalPadding or 0)

	-- Calculate size based on content if dynamic
	return Padding
		+ UDim2.new(
			(ContentSize and DynamicWidth) and UDim.new(0, ContentSize.X)
				or (typeof(props.Width) == "UDim" and props.Width or props.Size.X),
			(ContentSize and DynamicHeight) and UDim.new(0, ContentSize.Y)
				or (typeof(props.Height) == "UDim" and props.Height or props.Size.Y)
		)
end

function ImageLabel:UpdateContentSize(Layout)
	if not (Layout and Layout.Parent) then
		return
	end

	-- Set container size based on content
	Layout.Parent.Size = self:GetSize(Layout.AbsoluteContentSize)
end

return ImageLabel
