--local UserInput = game:GetService("UserInputService")


local AvatarEditor = ReplicatedStorage.AvatarEditor
local remoteEvent = AvatarEditor.RemoteEvent
local Maid = require(AvatarEditor.Shared.Util.Maid)
local TableUtil = require(AvatarEditor.Shared.Util.TableUtil)
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Signal = require(AvatarEditor.Shared.Util.Signal)
local QueryMap = require(AvatarEditor.Shared.QueryMap)
local CatalogData = require(AvatarEditor.Shared.CatalogData)
local Colors = require(AvatarEditor.Shared.Colors)
local Settings = require(AvatarEditor.Shared.Settings)
local UserCanUse = require(AvatarEditor.Shared.UserCanUse)
local TabButton = require(AvatarEditor.Client.TabButton)
local Search = require(AvatarEditor.Client.Search)
local CatalogList = require(AvatarEditor.Client.CatalogList)
local Wearing = require(AvatarEditor.Client.Wearing)
local PromptOverlay = require(AvatarEditor.Client.PromptOverlay)
local ColorList = require(AvatarEditor.Client.ColorList)
local Scale = require(AvatarEditor.Client.Scale)
local Costume = require(AvatarEditor.Client.Costume)
local Theme = require(AvatarEditor.Client.Theme)
local Config = require(AvatarEditor.Client.Config)

local player = Players.LocalPlayer

local mainGui = AvatarEditor.AvatarEditorGui
local editorFrame = mainGui.Frame.Editor
local bodyFrame = editorFrame.Body
local footer = editorFrame.Footer

local viewportFrame = mainGui.Frame.Viewport
local expandButton = viewportFrame.Footer.Expand

local mainFrame = bodyFrame.Main
local mainHeader = mainFrame.Header
local mainContainer = mainFrame.Container

local bodyPageLayout = bodyFrame.UIPageLayout
local subcategoryPageLayout = mainHeader.SubTabs.UIPageLayout

local bodyPageIndex = 1
local categoryPageIndex = 1
local subcategoryPageIndex = 0

local categoryButtons = {}
local subcategoryButtons = {}

local tweenSpring = Spring.new(0)
tweenSpring.Damper = 1
tweenSpring.Speed = 20

local maid = Maid.new()

local search, catalogList, promptOverlay, colorList, scale, costume, config

local searchState = {
	search = "",
	assetType = 8,
	wearing = false,
	uid = "",
}

local module = {}
module.Started = Signal.new()
module.Loaded = Signal.new()
module.PermissionFailed = Signal.new()
module.Destroyed = Signal.new()

