local J=game:GetService("\067\111\110\116\101\120\116\065\099\116\105\111\110\083\101\114\118\105\099\101")local k=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local d=game:GetService("\082\117\110\083\101\114\118\105\099\101")local n=(UserSettings()):GetService("\085\115\101\114\071\097\109\101\083\101\116\116\105\110\103\115")local A=(game:GetService("\080\108\097\121\101\114\115")).LocalPlayer local Q=math.rad(120)local u=Vector2.new(1,.77)*math.rad(.5)local C=Vector2.new(1,.77)*math.rad(7)local D=Vector2.new(1,.66)*math.rad(1)local U=Vector2.new(1,.77)*math.rad(4)local L=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")local x=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")local M=L k.InputBegan:Connect(function(J,k)if not k and J.UserInputType==Enum.UserInputType.MouseButton2 then M:Fire()end end)local r=x k.InputEnded:Connect(function(J,k)if J.UserInputType==Enum.UserInputType.MouseButton2 then r:Fire()end end)M=nil M=function(J)return math.sign(J)*math.clamp((math.exp(2*((math.abs(J)-.1)/.9))-1)/(math.exp(2)-1),0,1)end r=function(J)local k=workspace.CurrentCamera if not k then return J end local d=k.CFrame:ToEulerAnglesYXZ()if J.Y*d>=0 then return J end return Vector2.new(1,(1-((2*math.abs(d))/math.pi)^.75)*.75+.25)*J end local w=.016666666666667 d.Stepped:Connect(function(J,k)w=k end)local i={}local a=0 local T=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")i.gamepadZoomPress=T.Event local B={Thumbstick2=Vector2.new()}function i.getRotationActivated()local J=true if not(a>0)then J=B.Thumbstick2.Magnitude>0 end return J end local v={Left=0,Right=0;I=0;O=0}local S={Movement=Vector2.new();Wheel=0;Pan=Vector2.new(),Pinch=0}local F={Move=Vector2.new(),Pinch=0}function i.getRotation(J)local k=Vector2.new(1,n:GetCameraYInvertValue())local d=Vector2.new(v.Right-v.Left,0)*w if J then d=Vector2.new()end return((((d*Q+B.Thumbstick2*U)+S.Movement*u)+S.Pan*C)+r(F.Move)*D)*k end function i.getZoomDelta()return((v.O-v.I)*.1+(-S.Wheel+S.Pinch)*1)+-F.Pinch*.04 end local V=nil local function X(J)local k=A:FindFirstChildOfClass("\080\108\097\121\101\114\071\117\105")local d=k and k:FindFirstChild("\084\111\117\099\104\071\117\105")local n=d and d:FindFirstChild("\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101")local Q=n and n:FindFirstChild("\068\121\110\097\109\105\099\084\104\117\109\098\115\116\105\099\107\070\114\097\109\101")if not Q then return false end if not d.Enabled then return false end local u=Q.AbsolutePosition local C=u+Q.AbsoluteSize local D=false if u.X<=J.X then D=false if u.Y<=J.Y then D=false if J.X<=C.X then D=J.Y<=C.Y end end end return D end local function I()a=math.max(0,a+1)end local H={}local N=nil local function g()a=math.max(0,a-1)end local function m(J,k)assert(J.UserInputType==Enum.UserInputType.Touch)assert(J.UserInputState==Enum.UserInputState.Begin)if V==nil and(X(J.Position)and not k)then V=J return end if not k then I()end H[J]=k end local function O(J,k)assert(J.UserInputType==Enum.UserInputType.Touch)assert(J.UserInputState==Enum.UserInputState.Change)if J==V then return end if H[J]==nil then H[J]=k end local d={}for J,k in pairs(H)do if not k then table.insert(d,J)end end if#d==1 and H[J]==false then local k=J.Delta F.Move=F.Move+Vector2.new(k.X,k.Y)end if#d~=2 then N=nil return end local n=(d[1].Position-d[2].Position).Magnitude if N then F.Pinch=F.Pinch+(n-N)end N=n end local function E(J)local k=J.Delta S.Movement=Vector2.new(k.X,k.Y)end local function G(J,k)assert(J.UserInputType==Enum.UserInputType.Touch)assert(J.UserInputState==Enum.UserInputState.End)if J==V then V=nil end if H[J]==false then N=nil g()end H[J]=nil end local K=false local function s()for J,k in pairs({B;v,S,F})do for J,d in pairs(k)do if type(d)=="\098\111\111\108\101\097\110"then k[J]=false else k[J]=k[J]*0 end end end end local function l()H={}V=nil N=nil end local function c(J,k,d)local n=d.Position B[d.KeyCode.Name]=Vector2.new(M(n.X),-M(n.Y))end local b=Enum.ContextActionPriority.Default.Value local function P(J,k,d)if k==Enum.UserInputState.Begin then local J=1 else v38=0 end v[d.KeyCode.Name]=v38 end local function t(J,k,d)if k==Enum.UserInputState.Begin then T:Fire()end end local Z={}local function y(J,k)if J.UserInputType==Enum.UserInputType.Touch then m(J,k)return end if J.UserInputType==Enum.UserInputType.MouseButton2 and not k then I()end end local function p(J,k)if J.UserInputType==Enum.UserInputType.Touch then O(J,k)return end if J.UserInputType==Enum.UserInputType.MouseMovement then E(J)end end local function e(J,k)if J.UserInputType==Enum.UserInputType.Touch then G(J,k)return end if J.UserInputType==Enum.UserInputType.MouseButton2 then g()end end local function W(J,k,d,n)if not n then S.Wheel=J S.Pan=k S.Pinch=-d end end function i.setInputEnabled(d)if K==d then return end K=d s()l()if not K then J:UnbindAction("\082\098\120\067\097\109\101\114\097\084\104\117\109\098\115\116\105\099\107")J:UnbindAction("\082\098\120\067\097\109\101\114\097\077\111\117\115\101\077\111\118\101")J:UnbindAction("\082\098\120\067\097\109\101\114\097\077\111\117\115\101\087\104\101\101\108")J:UnbindAction("\082\098\120\067\097\109\101\114\097\075\101\121\112\114\101\115\115")for J,k in pairs(Z)do k:Disconnect()end Z={}return end J:BindActionAtPriority("\082\098\120\067\097\109\101\114\097\084\104\117\109\098\115\116\105\099\107",c,false,b,Enum.KeyCode.Thumbstick2)J:BindActionAtPriority("\082\098\120\067\097\109\101\114\097\075\101\121\112\114\101\115\115",P,false,b,Enum.KeyCode.Left,Enum.KeyCode.Right,Enum.KeyCode.I,Enum.KeyCode.O)J:BindAction("\082\098\120\067\097\109\101\114\097\071\097\109\101\112\097\100\090\111\111\109",t,false,Enum.KeyCode.ButtonR3)table.insert(Z,k.InputBegan:Connect(y))table.insert(Z,k.InputChanged:Connect(p))table.insert(Z,k.InputEnded:Connect(e))table.insert(Z,k.PointerAction:Connect(W))end function i.getInputEnabled()return K end function i.resetInputForFrameEnd()S.Movement=Vector2.new()F.Move=Vector2.new()F.Pinch=0 S.Wheel=0 S.Pan=Vector2.new()S.Pinch=0 end k.WindowFocused:Connect(s)k.WindowFocusReleased:Connect(s)local q=false function i.getHoldPan()return q end local f=false function i.getTogglePan()return f end function i.getPanning()return f or q end function i.setTogglePan(J)f=J end local h=false local R=nil local z=nil local Y=L.Event local o=0 local j=x.Event function i.enableCameraToggleInput()if h then return end h=true q=false f=false if R then R:Disconnect()end if z then z:Disconnect()end R=Y:Connect(function()q=true o=tick()end)z=j:Connect(function()q=false if tick()-o<.3 and(f or(k:GetMouseDelta()).Magnitude<2)then f=not f end end)end function i.disableCameraToggleInput()if not h then return end h=false if R then R:Disconnect()R=nil end if z then z:Disconnect()z=nil end end return i


local l__ContextActionService__1 = game:GetService("ContextActionService");
local l__UserInputService__2 = game:GetService("UserInputService");
local l__RunService__3 = game:GetService("RunService");
local l__UserGameSettings__4 = UserSettings():GetService("UserGameSettings");
local l__LocalPlayer__5 = game:GetService("Players").LocalPlayer;
local v6 = math.rad(120);
local v7 = Vector2.new(1, 0.77) * math.rad(0.5);
local v8 = Vector2.new(1, 0.77) * math.rad(7);
local v9 = Vector2.new(1, 0.66) * math.rad(1);
local v10 = Vector2.new(1, 0.77) * math.rad(4);
local v11 = Instance.new("BindableEvent");
local v12 = Instance.new("BindableEvent");
local u1 = v11;
l__UserInputService__2.InputBegan:Connect(function(p1, p2)
	if not p2 and p1.UserInputType == Enum.UserInputType.MouseButton2 then
		u1:Fire();
	end;
end);
local u2 = v12;
l__UserInputService__2.InputEnded:Connect(function(p3, p4)
	if p3.UserInputType == Enum.UserInputType.MouseButton2 then
		u2:Fire();
	end;
end);
u1 = nil;
u1 = function(p5)
	return math.sign(p5) * math.clamp((math.exp(2 * ((math.abs(p5) - 0.1) / 0.9)) - 1) / (math.exp(2) - 1), 0, 1);
end;
u2 = function(p6)
	local l__CurrentCamera__13 = workspace.CurrentCamera;
	if not l__CurrentCamera__13 then
		return p6;
	end;
	local v14 = l__CurrentCamera__13.CFrame:ToEulerAnglesYXZ();
	if p6.Y * v14 >= 0 then
		return p6;
	end;
	return Vector2.new(1, (1 - (2 * math.abs(v14) / math.pi) ^ 0.75) * 0.75 + 0.25) * p6;
end;
local u3 = 0.016666666666666666;
l__RunService__3.Stepped:Connect(function(p7, p8)
	u3 = p8;
end);
local v15 = {};
local u4 = 0;
local v16 = Instance.new("BindableEvent");
v15.gamepadZoomPress = v16.Event;
local u5 = {
	Thumbstick2 = Vector2.new()
};
function v15.getRotationActivated()
	local v17 = true;
	if not (u4 > 0) then
		v17 = u5.Thumbstick2.Magnitude > 0;
	end;
	return v17;
end;
local u6 = {
	Left = 0, 
	Right = 0, 
	I = 0, 
	O = 0
};
local u7 = {
	Movement = Vector2.new(), 
	Wheel = 0, 
	Pan = Vector2.new(), 
	Pinch = 0
};
local u8 = {
	Move = Vector2.new(), 
	Pinch = 0
};
function v15.getRotation(p9)
	local v18 = Vector2.new(1, l__UserGameSettings__4:GetCameraYInvertValue());
	local v19 = Vector2.new(u6.Right - u6.Left, 0) * u3;
	if p9 then
		v19 = Vector2.new();
	end;
	return (v19 * v6 + u5.Thumbstick2 * v10 + u7.Movement * v7 + u7.Pan * v8 + u2(u8.Move) * v9) * v18;
end;
function v15.getZoomDelta()
	return (u6.O - u6.I) * 0.1 + (-u7.Wheel + u7.Pinch) * 1 + -u8.Pinch * 0.04;
end;
local u9 = nil;
local function u10(p10)
	local v20 = l__LocalPlayer__5:FindFirstChildOfClass("PlayerGui");
	local v21 = v20 and v20:FindFirstChild("TouchGui");
	local v22 = v21 and v21:FindFirstChild("TouchControlFrame");
	local v23 = v22 and v22:FindFirstChild("DynamicThumbstickFrame");
	if not v23 then
		return false;
	end;
	if not v21.Enabled then
		return false;
	end;
	local l__AbsolutePosition__24 = v23.AbsolutePosition;
	local v25 = l__AbsolutePosition__24 + v23.AbsoluteSize;
	local v26 = false;
	if l__AbsolutePosition__24.X <= p10.X then
		v26 = false;
		if l__AbsolutePosition__24.Y <= p10.Y then
			v26 = false;
			if p10.X <= v25.X then
				v26 = p10.Y <= v25.Y;
			end;
		end;
	end;
	return v26;
end;
local function u11()
	u4 = math.max(0, u4 + 1);
end;
local u12 = {};
local u13 = nil;
local function u14()
	u4 = math.max(0, u4 - 1);
end;
local function u15(p11, p12)
	assert(p11.UserInputType == Enum.UserInputType.Touch);
	assert(p11.UserInputState == Enum.UserInputState.Begin);
	if u9 == nil and u10(p11.Position) and not p12 then
		u9 = p11;
		return;
	end;
	if not p12 then
		u11();
	end;
	u12[p11] = p12;
end;
local function u16(p13, p14)
	assert(p13.UserInputType == Enum.UserInputType.Touch);
	assert(p13.UserInputState == Enum.UserInputState.Change);
	if p13 == u9 then
		return;
	end;
	if u12[p13] == nil then
		u12[p13] = p14;
	end;
	local v27 = {};
	for v28, v29 in pairs(u12) do
		if not v29 then
			table.insert(v27, v28);
		end;
	end;
	if #v27 == 1 and u12[p13] == false then
		local l__Delta__30 = p13.Delta;
		u8.Move = u8.Move + Vector2.new(l__Delta__30.X, l__Delta__30.Y);
	end;
	if #v27 ~= 2 then
		u13 = nil;
		return;
	end;
	local l__Magnitude__31 = (v27[1].Position - v27[2].Position).Magnitude;
	if u13 then
		u8.Pinch = u8.Pinch + (l__Magnitude__31 - u13);
	end;
	u13 = l__Magnitude__31;
end;
local function u17(p15)
	local l__Delta__32 = p15.Delta;
	u7.Movement = Vector2.new(l__Delta__32.X, l__Delta__32.Y);
end;
local function u18(p16, p17)
	assert(p16.UserInputType == Enum.UserInputType.Touch);
	assert(p16.UserInputState == Enum.UserInputState.End);
	if p16 == u9 then
		u9 = nil;
	end;
	if u12[p16] == false then
		u13 = nil;
		u14();
	end;
	u12[p16] = nil;
end;
local u19 = false;
local function u20()
	for v33, v34 in pairs({ u5, u6, u7, u8 }) do
		for v35, v36 in pairs(v34) do
			if type(v36) == "boolean" then
				v34[v35] = false;
			else
				v34[v35] = v34[v35] * 0;
			end;
		end;
	end;
end;
local function u21()
	u12 = {};
	u9 = nil;
	u13 = nil;
end;
local function u22(p18, p19, p20)
	local l__Position__37 = p20.Position;
	u5[p20.KeyCode.Name] = Vector2.new(u1(l__Position__37.X), -u1(l__Position__37.Y));
end;
local l__Value__23 = Enum.ContextActionPriority.Default.Value;
local function u24(p21, p22, p23)
	if p22 == Enum.UserInputState.Begin then
		local v38 = 1;
	else
		v38 = 0;
	end;
	u6[p23.KeyCode.Name] = v38;
end;
local function u25(p24, p25, p26)
	if p25 == Enum.UserInputState.Begin then
		v16:Fire();
	end;
end;
local u26 = {};
local function u27(p27, p28)
	if p27.UserInputType == Enum.UserInputType.Touch then
		u15(p27, p28);
		return;
	end;
	if p27.UserInputType == Enum.UserInputType.MouseButton2 and not p28 then
		u11();
	end;
end;
local function u28(p29, p30)
	if p29.UserInputType == Enum.UserInputType.Touch then
		u16(p29, p30);
		return;
	end;
	if p29.UserInputType == Enum.UserInputType.MouseMovement then
		u17(p29);
	end;
end;
local function u29(p31, p32)
	if p31.UserInputType == Enum.UserInputType.Touch then
		u18(p31, p32);
		return;
	end;
	if p31.UserInputType == Enum.UserInputType.MouseButton2 then
		u14();
	end;
end;
local function u30(p33, p34, p35, p36)
	if not p36 then
		u7.Wheel = p33;
		u7.Pan = p34;
		u7.Pinch = -p35;
	end;
end;
function v15.setInputEnabled(p37)
	if u19 == p37 then
		return;
	end;
	u19 = p37;
	u20();
	u21();
	if not u19 then
		l__ContextActionService__1:UnbindAction("RbxCameraThumbstick");
		l__ContextActionService__1:UnbindAction("RbxCameraMouseMove");
		l__ContextActionService__1:UnbindAction("RbxCameraMouseWheel");
		l__ContextActionService__1:UnbindAction("RbxCameraKeypress");
		for v39, v40 in pairs(u26) do
			v40:Disconnect();
		end;
		u26 = {};
		return;
	end;
	l__ContextActionService__1:BindActionAtPriority("RbxCameraThumbstick", u22, false, l__Value__23, Enum.KeyCode.Thumbstick2);
	l__ContextActionService__1:BindActionAtPriority("RbxCameraKeypress", u24, false, l__Value__23, Enum.KeyCode.Left, Enum.KeyCode.Right, Enum.KeyCode.I, Enum.KeyCode.O);
	l__ContextActionService__1:BindAction("RbxCameraGamepadZoom", u25, false, Enum.KeyCode.ButtonR3);
	table.insert(u26, l__UserInputService__2.InputBegan:Connect(u27));
	table.insert(u26, l__UserInputService__2.InputChanged:Connect(u28));
	table.insert(u26, l__UserInputService__2.InputEnded:Connect(u29));
	table.insert(u26, l__UserInputService__2.PointerAction:Connect(u30));
end;
function v15.getInputEnabled()
	return u19;
end;
function v15.resetInputForFrameEnd()
	u7.Movement = Vector2.new();
	u8.Move = Vector2.new();
	u8.Pinch = 0;
	u7.Wheel = 0;
	u7.Pan = Vector2.new();
	u7.Pinch = 0;
end;
l__UserInputService__2.WindowFocused:Connect(u20);
l__UserInputService__2.WindowFocusReleased:Connect(u20);
local u31 = false;
function v15.getHoldPan()
	return u31;
end;
local u32 = false;
function v15.getTogglePan()
	return u32;
end;
function v15.getPanning()
	return u32 or u31;
end;
function v15.setTogglePan(p38)
	u32 = p38;
end;
local u33 = false;
local u34 = nil;
local u35 = nil;
local l__Event__36 = v11.Event;
local u37 = 0;
local l__Event__38 = v12.Event;
function v15.enableCameraToggleInput()
	if u33 then
		return;
	end;
	u33 = true;
	u31 = false;
	u32 = false;
	if u34 then
		u34:Disconnect();
	end;
	if u35 then
		u35:Disconnect();
	end;
	u34 = l__Event__36:Connect(function()
		u31 = true;
		u37 = tick();
	end);
	u35 = l__Event__38:Connect(function()
		u31 = false;
		if tick() - u37 < 0.3 and (u32 or l__UserInputService__2:GetMouseDelta().Magnitude < 2) then
			u32 = not u32;
		end;
	end);
end;
function v15.disableCameraToggleInput()
	if not u33 then
		return;
	end;
	u33 = false;
	if u34 then
		u34:Disconnect();
		u34 = nil;
	end;
	if u35 then
		u35:Disconnect();
		u35 = nil;
	end;
end;
return v15;
