using System;
using Cpp2IlInjected;
using DG.Tweening;
using DG.Tweening.Core;
using DG.Tweening.Plugins.Options;
using MarsSDK;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x020002D3 RID: 723
[Token(Token = "0x20002D3")]
public class UIToggleHandler : UIHandlerBase
{
	// Token: 0x06001B15 RID: 6933 RVA: 0x0004207C File Offset: 0x0004027C
	[Token(Token = "0x6001B15")]
	[Address(RVA = "0xC35360", Offset = "0xC34360", VA = "0x180C35360")]
	public bool GetToggle()
	{
		return this.isToggle;
	}

	// Token: 0x06001B16 RID: 6934 RVA: 0x00042090 File Offset: 0x00040290
	[Token(Token = "0x6001B16")]
	[Address(RVA = "0xCB4D80", Offset = "0xCB3D80", VA = "0x180CB4D80")]
	public void Init(bool isToggle, Action<bool> valueChangedHandler)
	{
		this.isToggle = isToggle;
		Text text = this.value;
		string[] array = this.toggleText;
		if (isToggle)
		{
		}
		string text2 = array[0];
		text.text = text2;
		this.valueChangedHandler = valueChangedHandler;
		throw new NullReferenceException();
	}

	// Token: 0x06001B17 RID: 6935 RVA: 0x000420D4 File Offset: 0x000402D4
	[Token(Token = "0x6001B17")]
	[Address(RVA = "0x672E50", Offset = "0x671E50", VA = "0x180672E50")]
	public void SetToggleTextArray(params string[] array)
	{
		/*
An exception occurred when decompiling this method (06001B17)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void UIToggleHandler::SetToggleTextArray(System.String[])

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:string[](UIToggleHandler::toggleText, ldloc:UIToggleHandler(this), ldloc:string[](array)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x06001B18 RID: 6936 RVA: 0x000420E8 File Offset: 0x000402E8
	[Token(Token = "0x6001B18")]
	[Address(RVA = "0xCB4F00", Offset = "0xCB3F00", VA = "0x180CB4F00", Slot = "8")]
	public override void OnSelect()
	{
		TweenerCore<Vector3, Vector3, VectorOptions> tweenerCore = ShortcutExtensions.DOScale(this.value.rectTransform, 1.25f, 0.2f).SetEase((Ease)((uint)3)).SetUpdate(true)
			.Play<TweenerCore<Vector3, Vector3, VectorOptions>>();
		Action<UIHandlerBase> onSelectedHandler = this.onSelectedHandler;
		if (onSelectedHandler != 0)
		{
			onSelectedHandler(this);
			return;
		}
	}

	// Token: 0x06001B19 RID: 6937 RVA: 0x0004213C File Offset: 0x0004033C
	[Token(Token = "0x6001B19")]
	[Address(RVA = "0xCB4E20", Offset = "0xCB3E20", VA = "0x180CB4E20", Slot = "9")]
	public override void OnDeselect()
	{
		TweenerCore<Vector3, Vector3, VectorOptions> tweenerCore = ShortcutExtensions.DOScale(this.value.rectTransform, 1f, 0.2f).SetEase((Ease)((uint)3)).SetUpdate(true)
			.Play<TweenerCore<Vector3, Vector3, VectorOptions>>();
		Action<UIHandlerBase> onDeselectedHandler = this.onDeselectedHandler;
		if (onDeselectedHandler != 0)
		{
			onDeselectedHandler(this);
			return;
		}
	}

	// Token: 0x06001B1A RID: 6938 RVA: 0x00042190 File Offset: 0x00040390
	[Token(Token = "0x6001B1A")]
	[Address(RVA = "0xCB5010", Offset = "0xCB4010", VA = "0x180CB5010")]
	public void Submit()
	{
		bool flag = this.isToggle;
		Text text = this.value;
		bool flag2 = !flag;
		this.isToggle = flag2;
		string[] array = this.toggleText;
		if (!flag)
		{
		}
		string text2 = array[0];
		text.text = text2;
		Action<bool> action = this.valueChangedHandler;
		if (action != 0)
		{
			bool flag3 = this.isToggle;
			action(flag3);
			return;
		}
	}

	// Token: 0x06001B1B RID: 6939 RVA: 0x000421F8 File Offset: 0x000403F8
	[Token(Token = "0x6001B1B")]
	[Address(RVA = "0xCB4FE0", Offset = "0xCB3FE0", VA = "0x180CB4FE0")]
	public void SetLabel(string value)
	{
		((ICanvasElement)this.label).GraphicUpdateComplete();
	}

	// Token: 0x06001B1C RID: 6940 RVA: 0x00042218 File Offset: 0x00040418
	[Token(Token = "0x6001B1C")]
	[Address(RVA = "0xCB50E0", Offset = "0xCB40E0", VA = "0x180CB50E0")]
	public UIToggleHandler()
	{
		string[] array;
		for (;;)
		{
			array = new string[2];
			if ("Off" == 0 || "Off" != 0)
			{
				array[0] = "Off";
				if ("ON" == 0 || "ON" != 0)
				{
					break;
				}
			}
		}
		array[1] = "ON";
		this.toggleText = array;
		base..ctor();
	}

	// Token: 0x04002520 RID: 9504
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002520")]
	[SerializeField]
	private Text label;

	// Token: 0x04002521 RID: 9505
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002521")]
	[SerializeField]
	private Text value;

	// Token: 0x04002522 RID: 9506
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002522")]
	[SerializeField]
	private bool isToggle;

	// Token: 0x04002523 RID: 9507
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4002523")]
	private Action<bool> valueChangedHandler;

	// Token: 0x04002524 RID: 9508
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002524")]
	private string[] toggleText;
}
