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

// Token: 0x02000288 RID: 648
[Token(Token = "0x2000288")]
public class UIToggleHandler : UIHandlerBase
{
	// Token: 0x060018E9 RID: 6377 RVA: 0x0003C6D8 File Offset: 0x0003A8D8
	[Token(Token = "0x60018E9")]
	[Address(RVA = "0xBCA6A0", Offset = "0xBC94A0", VA = "0x180BCA6A0")]
	public bool GetToggle()
	{
		return this.isToggle;
	}

	// Token: 0x060018EA RID: 6378 RVA: 0x0003C6EC File Offset: 0x0003A8EC
	[Token(Token = "0x60018EA")]
	[Address(RVA = "0x18B3860", Offset = "0x18B2660", VA = "0x1818B3860")]
	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: 0x060018EB RID: 6379 RVA: 0x0003C730 File Offset: 0x0003A930
	[Token(Token = "0x60018EB")]
	[Address(RVA = "0xA90DA0", Offset = "0xA8FBA0", VA = "0x180A90DA0")]
	public void SetToggleTextArray(params string[] array)
	{
		/*
An exception occurred when decompiling this method (060018EB)

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: 0x060018EC RID: 6380 RVA: 0x0003C744 File Offset: 0x0003A944
	[Token(Token = "0x60018EC")]
	[Address(RVA = "0x18B39E0", Offset = "0x18B27E0", VA = "0x1818B39E0", 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: 0x060018ED RID: 6381 RVA: 0x0003C798 File Offset: 0x0003A998
	[Token(Token = "0x60018ED")]
	[Address(RVA = "0x18B3900", Offset = "0x18B2700", VA = "0x1818B3900", 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: 0x060018EE RID: 6382 RVA: 0x0003C7EC File Offset: 0x0003A9EC
	[Token(Token = "0x60018EE")]
	[Address(RVA = "0x18B3AC0", Offset = "0x18B28C0", VA = "0x1818B3AC0")]
	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: 0x060018EF RID: 6383 RVA: 0x0003C854 File Offset: 0x0003AA54
	[Token(Token = "0x60018EF")]
	[Address(RVA = "0x1018DF0", Offset = "0x1017BF0", VA = "0x181018DF0")]
	public void SetLabel(string value)
	{
		bool dtdValidation = ((IDtdParserAdapterWithValidation)this.label).DtdValidation;
	}

	// Token: 0x060018F0 RID: 6384 RVA: 0x0003C874 File Offset: 0x0003AA74
	[Token(Token = "0x60018F0")]
	[Address(RVA = "0x18B3B90", Offset = "0x18B2990", VA = "0x1818B3B90")]
	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: 0x040022CD RID: 8909
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x40022CD")]
	[SerializeField]
	private Text label;

	// Token: 0x040022CE RID: 8910
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x40022CE")]
	[SerializeField]
	private Text value;

	// Token: 0x040022CF RID: 8911
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x40022CF")]
	[SerializeField]
	private bool isToggle;

	// Token: 0x040022D0 RID: 8912
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x40022D0")]
	private Action<bool> valueChangedHandler;

	// Token: 0x040022D1 RID: 8913
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x40022D1")]
	private string[] toggleText;
}
