local s=ReplicatedStorage.AvatarEditor local d=s.RemoteEvent local h=require(s.Shared.Util.Maid)local F=require(s.Shared.Util.TableUtil)local o=require(s.Shared.Util.Spring)local A=require(s.Shared.Util.Signal)local M=require(s.Shared.QueryMap)local k=require(s.Shared.CatalogData)local b=require(s.Shared.Colors)local i=require(s.Shared.Settings)local V=require(s.Shared.UserCanUse)local m=require(s.Client.TabButton)local t=require(s.Client.Search)local c=require(s.Client.CatalogList)local x=require(s.Client.Wearing)local X=require(s.Client.PromptOverlay)local f=require(s.Client.ColorList)local u=require(s.Client.Scale)local q=require(s.Client.Costume)local I=require(s.Client.Theme)local p=require(s.Client.Config)local a=Players.LocalPlayer local L=s.AvatarEditorGui local U=L.Frame.Editor local R=U.Body local O=U.Footer local K=L.Frame.Viewport local v=K.Footer.Expand local Y=R.Main local l=Y.Header local D=Y.Container local r=R.UIPageLayout local Z=l.SubTabs.UIPageLayout local B=1 local E=1 local T=0 local H={}local C={}local e=o.new(0)e.Damper=1 e.Speed=20 local W=h.new()local S,P,w,n,N,y,G local J={search="";assetType=8,wearing=false,uid=""}local g={}g.Started=A.new()g.Loaded=A.new()g.PermissionFailed=A.new()g.Destroyed=A.new()
--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()
