using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Paroxe.PdfRenderer.Internal;
using Paroxe.PdfRenderer.Internal.Viewer;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using Paroxe.PdfRenderer.WebGL;
using System.IO;
namespace Paroxe.PdfRenderer
{
///
/// PDFViewer is an Unity UI component that allow you to visualize PDF Document.
///
public class PDFViewer : UIBehaviour, IPDFDevice, IPDFColoredRectListProvider
{
[SerializeField]
public PDFViewerInternal m_Internal;
private IPDFDeviceActionHandler m_BookmarksActionHandler;
private IPDFDeviceActionHandler m_LinksActionHandler;
private PDFPageRange m_CurrentPageRange;
private PDFSearchResult m_CurrentSearchResult;
private PDFDocument m_Document;
#pragma warning disable 414
private PDFDocument m_SuppliedDocument;
#pragma warning restore 414
private PDFPageTextureHolder[] m_PageTextureHolders;
private int m_CurrentSearchResultIndex;
private int m_CurrentSearchResultIndexWithinCurrentPage;
private bool m_DelayedOnEnable;
private float m_InvalidPasswordMessageDelay;
#if !UNITY_WEBGL || UNITY_EDITOR
private float m_InvalidPasswordMessageDelayBeforeFade = 0.5f;
private bool m_DownloadCanceled = false;
#endif
private bool m_InvalidPasswordMessageVisisble;
private bool m_IsLoaded;
private int m_LoadAtPageIndex;
private float OverlayAlpha = 0.50f;
private bool OverlayVisible;
private int m_PageCount;
private float[] m_PageOffsets;
private Vector2[] m_PageSizes;
private Vector2[] m_NormalPageSizes;
private byte[] m_PendingDocumentBuffer;
private int m_PreviousMostVisiblePage = -1;
private PageFittingType m_PreviousPageFitting;
private float m_PreviousZoom;
private float m_PreviousZoomToGo;
private IList[] m_SearchResults;
private float m_StartZoom;
private float m_UpdateChangeDelay;
private Vector2 m_ZoomPosition = Vector2.zero;
private PDFRenderer m_Renderer;
private int m_PreviousTouchCount;
private float m_PinchZoomStartZoomFactor;
private float m_PinchZoomStartDeltaMag;
private Canvas m_Canvas;
private GraphicRaycaster m_GraphicRaycaster;
private List