local k={}k.__index=k function k.new()local w=setmetatable({},k)w.lastUpdate=tick()w.transparencyDirty=false w.enabled=false w.lastTransparency=nil w.descendantAddedConn=nil w.descendantRemovingConn=nil w.toolDescendantAddedConns={}w.toolDescendantRemovingConns={}w.cachedParts={}return w end function k.HasToolAncestor(k,w)if w.Parent==nil then return false end if w.Parent:IsA("\084\111\111\108")then return true end if w.Parent:IsA("\065\099\099\101\115\115\111\114\121")and string.find(w.Parent.Name,"\070\108\097\115\104\108\105\103\104\116")then return true end return k:HasToolAncestor(w.Parent)end function k.IsValidPartToModify(k,w)if not w:IsA("\066\097\115\101\080\097\114\116")and not w:IsA("\068\101\099\097\108")then return false end return not k:HasToolAncestor(w)end function k.CachePartsRecursive(k,w)if w then if k:IsValidPartToModify(w)then k.cachedParts[w]=true k.transparencyDirty=true end for w,u in pairs(w:GetChildren())do k:CachePartsRecursive(u)end end end function k.TeardownTransparency(k)for k,w in pairs(k.cachedParts)do k.LocalTransparencyModifier=0 end k.cachedParts={}k.transparencyDirty=true k.lastTransparency=nil if k.descendantAddedConn then k.descendantAddedConn:disconnect()k.descendantAddedConn=nil end if k.descendantRemovingConn then k.descendantRemovingConn:disconnect()k.descendantRemovingConn=nil end for w,u in pairs(k.toolDescendantAddedConns)do u:Disconnect()k.toolDescendantAddedConns[w]=nil end for w,u in pairs(k.toolDescendantRemovingConns)do u:Disconnect()k.toolDescendantRemovingConns[w]=nil end end function k.SetupTransparency(k,w)k:TeardownTransparency()if k.descendantAddedConn then k.descendantAddedConn:disconnect()end k.descendantAddedConn=w.DescendantAdded:Connect(function(u)if k:IsValidPartToModify(u)then k.cachedParts[u]=true k.transparencyDirty=true return end if u:IsA("\084\111\111\108")then if k.toolDescendantAddedConns[u]then k.toolDescendantAddedConns[u]:Disconnect()end k.toolDescendantAddedConns[u]=u.DescendantAdded:Connect(function(w)k.cachedParts[w]=nil if w:IsA("\066\097\115\101\080\097\114\116")or w:IsA("\068\101\099\097\108")then w.LocalTransparencyModifier=0 end end)if k.toolDescendantRemovingConns[u]then k.toolDescendantRemovingConns[u]:disconnect()end k.toolDescendantRemovingConns[u]=u.DescendantRemoving:Connect(function(u)wait()if w and(u and(u:IsDescendantOf(w)and k:IsValidPartToModify(u)))then k.cachedParts[u]=true k.transparencyDirty=true end end)end end)if k.descendantRemovingConn then k.descendantRemovingConn:disconnect()end k.descendantRemovingConn=w.DescendantRemoving:connect(function(w)if k.cachedParts[w]then k.cachedParts[w]=nil w.LocalTransparencyModifier=0 end end)k:CachePartsRecursive(w)end function k.Enable(k,w)if k.enabled~=w then k.enabled=w k:Update()end end function k.SetSubject(k,w)local u=nil if w and w:IsA("\072\117\109\097\110\111\105\100")then u=w.Parent end if w and(w:IsA("\086\101\104\105\099\108\101\083\101\097\116")and w.Occupant)then u=w.Occupant.Parent end if not u then k:TeardownTransparency()return end k:SetupTransparency(u)end local w=require(script.Parent:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))function k.Update(k)local u=tick()local R=workspace.CurrentCamera if R then local y=0 if k.enabled then local r=(R.Focus.p-R.CoordinateFrame.p).magnitude local l=r<2 and 1-(r-.5)/1.5 or 0 if l<.5 then l=0 end if k.lastTransparency then local R=l-k.lastTransparency if true and(l<1 and k.lastTransparency<.95)then local y=2.8*(u-k.lastUpdate)R=w.Clamp(-y,y,R)end l=k.lastTransparency+R else k.transparencyDirty=true end y=w.Clamp(0,1,w.Round(l,2))end if k.transparencyDirty or k.lastTransparency~=y then for k,w in pairs(k.cachedParts)do k.LocalTransparencyModifier=y end k.transparencyDirty=false k.lastTransparency=y end end k.lastUpdate=u end return k
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {}
v1.__index = v1
function v1.new()
	local v2 = setmetatable({}, v1)
	v2.lastUpdate = tick()
	v2.transparencyDirty = false
	v2.enabled = false
	v2.lastTransparency = nil
	v2.descendantAddedConn = nil
	v2.descendantRemovingConn = nil
	v2.toolDescendantAddedConns = {}
	v2.toolDescendantRemovingConns = {}
	v2.cachedParts = {}
	return v2
end
function v1.HasToolAncestor(p1, p2)
	if p2.Parent == nil then
		return false
	end
	if p2.Parent:IsA("Tool") then
		return true
	end
	if p2.Parent:IsA("Accessory") and string.find(p2.Parent.Name, "Flashlight") then
		return true
	end
	return p1:HasToolAncestor(p2.Parent)
end
function v1.IsValidPartToModify(p3, p4)
	if not p4:IsA("BasePart") and not p4:IsA("Decal") then
		return false
	end
	return not p3:HasToolAncestor(p4)
end
function v1.CachePartsRecursive(p5, p6)
	if p6 then
		if p5:IsValidPartToModify(p6) then
			p5.cachedParts[p6] = true
			p5.transparencyDirty = true
		end
		for v3, v4 in pairs(p6:GetChildren()) do
			p5:CachePartsRecursive(v4)
		end
	end
end
function v1.TeardownTransparency(p7)
	for v5, v6 in pairs(p7.cachedParts) do
		v5.LocalTransparencyModifier = 0
	end
	p7.cachedParts = {}
	p7.transparencyDirty = true
	p7.lastTransparency = nil
	if p7.descendantAddedConn then
		p7.descendantAddedConn:disconnect()
		p7.descendantAddedConn = nil
	end
	if p7.descendantRemovingConn then
		p7.descendantRemovingConn:disconnect()
		p7.descendantRemovingConn = nil
	end
	for v7, v8 in pairs(p7.toolDescendantAddedConns) do
		v8:Disconnect()
		p7.toolDescendantAddedConns[v7] = nil
	end
	for v9, v10 in pairs(p7.toolDescendantRemovingConns) do
		v10:Disconnect()
		p7.toolDescendantRemovingConns[v9] = nil
	end
end
function v1.SetupTransparency(p8, p9)
	p8:TeardownTransparency()
	if p8.descendantAddedConn then
		p8.descendantAddedConn:disconnect()
	end
	p8.descendantAddedConn = p9.DescendantAdded:Connect(function(p10)
		if p8:IsValidPartToModify(p10) then
			p8.cachedParts[p10] = true
			p8.transparencyDirty = true
			return
		end
		if p10:IsA("Tool") then
			if p8.toolDescendantAddedConns[p10] then
				p8.toolDescendantAddedConns[p10]:Disconnect()
			end
			p8.toolDescendantAddedConns[p10] = p10.DescendantAdded:Connect(function(p11)
				p8.cachedParts[p11] = nil
				if p11:IsA("BasePart") or p11:IsA("Decal") then
					p11.LocalTransparencyModifier = 0
				end
			end)
			if p8.toolDescendantRemovingConns[p10] then
				p8.toolDescendantRemovingConns[p10]:disconnect()
			end
			p8.toolDescendantRemovingConns[p10] = p10.DescendantRemoving:Connect(function(p12)
				wait()
				if p9 and p12 and p12:IsDescendantOf(p9) and p8:IsValidPartToModify(p12) then
					p8.cachedParts[p12] = true
					p8.transparencyDirty = true
				end
			end)
		end
	end)
	if p8.descendantRemovingConn then
		p8.descendantRemovingConn:disconnect()
	end
	p8.descendantRemovingConn = p9.DescendantRemoving:connect(function(p13)
		if p8.cachedParts[p13] then
			p8.cachedParts[p13] = nil
			p13.LocalTransparencyModifier = 0
		end
	end)
	p8:CachePartsRecursive(p9)
end
function v1.Enable(p14, p15)
	if p14.enabled ~= p15 then
		p14.enabled = p15
		p14:Update()
	end
end
function v1.SetSubject(p16, p17)
	local v11 = nil
	if p17 and p17:IsA("Humanoid") then
		v11 = p17.Parent
	end
	if p17 and p17:IsA("VehicleSeat") and p17.Occupant then
		v11 = p17.Occupant.Parent
	end
	if not v11 then
		p16:TeardownTransparency()
		return
	end
	p16:SetupTransparency(v11)
end
local u1 = require(script.Parent:WaitForChild("CameraUtils"))
function v1.Update(p18)
	local v12 = tick()
	local l__CurrentCamera__13 = workspace.CurrentCamera
	if l__CurrentCamera__13 then
		local v14 = 0
		if p18.enabled then
			local l__magnitude__15 = (l__CurrentCamera__13.Focus.p - l__CurrentCamera__13.CoordinateFrame.p).magnitude
			local v16 = l__magnitude__15 < 2 and 1 - (l__magnitude__15 - 0.5) / 1.5 or 0
			if v16 < 0.5 then
				v16 = 0
			end
			if p18.lastTransparency then
				local v17 = v16 - p18.lastTransparency
				if not false and v16 < 1 and p18.lastTransparency < 0.95 then
					local v18 = 2.8 * (v12 - p18.lastUpdate)
					v17 = u1.Clamp(-v18, v18, v17)
				end
				v16 = p18.lastTransparency + v17
			else
				p18.transparencyDirty = true
			end
			v14 = u1.Clamp(0, 1, u1.Round(v16, 2))
		end
		if p18.transparencyDirty or p18.lastTransparency ~= v14 then
			for v19, v20 in pairs(p18.cachedParts) do
				v19.LocalTransparencyModifier = v14
			end
			p18.transparencyDirty = false
			p18.lastTransparency = v14
		end
	end
	p18.lastUpdate = v12
end
return v1
