"use strict";var FLIPBOOK=FLIPBOOK||{};FLIPBOOK.version="4.10.4",function(e,t,i){"undefined"!=typeof jQuery&&(jQuery.fn.flipBook=function(e){return new FLIPBOOK.Main(e,this)},jQuery.fn.swipeBook=function(e){return e.viewMode="swipe",new FLIPBOOK.Main(e,this)}),e.FlipBook=function(e,t){return new FLIPBOOK.Main(t,e)}}(window,document),FLIPBOOK.Main=class{static defaultOptions={name:"",pages:[],tableOfContent:[],tableOfContentCloseOnClick:!0,thumbsCloseOnClick:!0,thumbsStyle:"overlay",deeplinkingEnabled:!1,deeplinkingPrefix:"",assets:{preloader:"assets/images/preloader.jpg",flipMp3:"assets/mp3/turnPage.mp3",spinner:"assets/images/spinner.gif",backgroundMp3:"assets/mp3/background.mp3"},pdfUrl:null,rangeChunkSize:256,disableRange:!1,disableStream:!0,disableAutoFetch:!0,pdfAutoLinks:!1,htmlLayer:!0,rightToLeft:!1,startPage:0,sound:!0,backgroundColor:"rgb(81, 85, 88)",backgroundImage:"",backgroundPattern:"",backgroundTransparent:!1,thumbSize:150,loadAllPages:!1,loadPagesF:2,loadPagesB:1,autoplayOnStart:!1,autoplayInterval:3e3,autoplayLoop:!0,skin:"",menuOverBook:!1,menuFloating:!1,menuBackground:"",menuShadow:"",menuMargin:0,menuPadding:0,menuTransparent:!1,menu2OverBook:!0,menu2Floating:!1,menu2Background:"",menu2Shadow:"",menu2Margin:0,menu2Padding:0,menu2Transparent:!0,accentColor:"#3b82f6",skinColor:"#222",skinColorHover:"#111",skinBackground:"#FFF",floatingBtnColor:"#FFF",floatingBtnBackground:"#00000055",btnColor:"",btnBackground:"none",btnSize:18,btnRadius:2,btnMargin:2,btnPaddingV:10,btnPaddingH:10,btnShadow:"",btnTextShadow:"",btnBorder:"",btnColorHover:"",btnBackgroundHover:"",arrowColor:"#FFF",arrowColorHover:"#FFF",arrowBackground:"rgba(0, 0, 0, 0)",arrowBackgroundHover:"rgba(0, 0, 0, .15)",arrowSize:40,arrowRadius:4,arrowMargin:4,arrowPadding:10,arrowTextShadow:"0px 0px 1px rgba(0, 0, 0, 1)",arrowBorder:"",floatingBtnColorHover:"",floatingBtnBackgroundHover:"",floatingBtnSize:null,floatingBtnRadius:null,floatingBtnMargin:null,floatingBtnPadding:null,floatingBtnShadow:"",floatingBtnTextShadow:"",floatingBtnBorder:"",btnOrder:["currentPage","progressBar","btnFirst","btnPrev","btnNext","btnLast","btnZoomOut","btnZoomIn","btnThumbs","btnToc","btnShare","btnPrint","btnDownloadPdf","btnSound","btnTools","btnSingle","btnExpand","btnClose"],currentPage:{enabled:!0,title:"Current page",vAlign:"top",hAlign:"left",marginH:0,marginV:0,color:"",background:""},progressBar:{enabled:!0,vAlign:"bottom",height:5,color:"",background:""},search:{enabled:!1},btnFirst:{enabled:!1,title:"First page",svg:"last",iconReverse:!0},btnPrev:{enabled:!0,title:"Previous page",svg:"next",iconReverse:!0},btnNext:{enabled:!0,title:"Next page"},btnLast:{enabled:!1,title:"Last page"},btnZoomIn:{enabled:!0,title:"Zoom in",svg:"plus"},btnZoomOut:{enabled:!0,title:"Zoom out",svg:"minus"},btnRotateLeft:{enabled:!1,title:"Rotate left"},btnRotateRight:{enabled:!1,title:"Rotate right"},btnAutoplay:{enabled:!0,title:"Auto flip",svg:"play",svgAlt:"pause"},btnSearch:{enabled:!1,title:"Search"},btnBookmark:{enabled:!0,title:"Bookmarks"},btnNotes:{enabled:!1,title:"Notes"},btnToc:{enabled:!0,title:"Table of Contents",svg:"list"},btnThumbs:{enabled:!0,title:"Pages"},btnShare:{enabled:!0,title:"Share"},btnPrint:{enabled:!0,title:"Print",toolsMenu:!0},btnDownloadPages:{enabled:!0,title:"Download",url:"",name:"",svg:"download",toolsMenu:!0},btnDownloadPdf:{enabled:!0,title:"Download PDF",url:null,svg:"pdf",toolsMenu:!0},btnSound:{enabled:!0,title:"Sound",svgAlt:"mute",toolsMenu:!0},btnTools:{enabled:!0,title:"More"},btnExpand:{enabled:!0,title:"Toggle fullscreen",svgAlt:"compress"},btnSingle:{enabled:!0,title:"Toggle single page",svgAlt:"double",toolsMenu:!0},btnClose:{title:"Close",hAlign:"right",vAlign:"top",size:20},sideNavigationButtons:!0,hideMenu:!1,shareUrl:null,shareTitle:null,shareImage:null,whatsapp:{enabled:!0,title:"WhatsApp"},twitter:{enabled:!0,title:"X (Twitter)"},facebook:{enabled:!0,title:"Facebook"},pinterest:{enabled:!0,title:"Pinterest"},email:{enabled:!0,title:"Email"},linkedin:{enabled:!0,title:"LinkedIn"},digg:{enabled:!1,title:"Digg"},reddit:{enabled:!1,title:"Reddit"},copyLink:{enabled:!0},pdf:{annotationLayer:!1},pageTextureSize:3e3,pageTextureSizeSmall:1500,thumbTextureSize:300,pageTextureSizeMobile:1500,pageTextureSizeMobileSmall:1e3,pagesInMemory:20,viewMode:"webgl",singlePageMode:!1,singlePageModeIfMobile:!1,bookMargin:20,bookVerticalPadding:200,zoomMin:.95,zoomMin2:.15,zoomMax2:null,zoomSize:null,zoomStep:1.5,zoomTime:300,zoomReset:!1,zoomResetTime:300,wheelDisabledNotFullscreen:!1,arrowsDisabledNotFullscreen:!1,arrowsAlwaysEnabledForNavigation:!0,responsiveView:!0,responsiveViewRatio:1,responsiveViewTreshold:768,minimalView:!0,responsiveViewRatio:1,minimalViewBreakpoint:600,responsiveContainer:!0,minPixelRatio:1,pageFlipDuration:1,contentOnStart:!1,thumbnailsOnStart:!1,searchOnStart:!1,sideMenuOverBook:!0,sideMenuOverMenu:!1,sideMenuOverMenu2:!0,sideMenuPosition:"left",lightBox:!1,lightBoxOpened:!1,lightBoxFullscreen:!1,lightboxResetOnOpen:!0,lightboxBackground:null,lightboxBackgroundColor:null,lightboxBackgroundPattern:null,lightboxBackgroundImage:null,lightboxStartPage:null,lightboxMarginV:"0",lightboxMarginH:"0",lightboxCSS:"",lightboxPreload:!1,lightboxShowMenu:!1,lightboxCloseOnBack:!0,lightboxFromStart:!0,disableImageResize:!0,pan:0,panMax:10,panMax2:2,panMin:-10,panMin2:-2,tilt:0,tiltMax:0,tiltMax2:0,tiltMin:0,tiltMin2:-5,rotateCameraOnMouseMove:!1,rotateCameraOnMouseDrag:!0,lights:!0,lightColor:16777215,lightPositionX:0,lightPositionY:150,lightPositionZ:1400,lightIntensity:.6,shadows:!0,shadowMapSize:1024,shadowOpacity:.3,pageRoughness:1,pageMetalness:0,pageHardness:2,coverHardness:2,pageSegmentsW:10,pageSegmentsH:1,pageMiddleShadowSize:4,pageMiddleShadowColorL:"#7E7E7E",pageMiddleShadowColorR:"#AAAAAA",antialias:!1,bitmapResizeHeight:null,bitmapResizeQuality:"medium",preloaderText:"",fillPreloader:{enabled:!1,imgEmpty:"images/logo_light.png",imgFull:"images/logo_dark.png"},logoImg:"",logoUrl:"",logoCSS:"position:absolute;",logoHideOnMobile:!1,printMenu:!0,downloadMenu:!0,cover:!0,backCover:!0,pdfTextLayer:!0,textSelect:!0,annotationLayer:!0,googleAnalyticsTrackingCode:null,linkColor:"rgba(0, 0, 0, 0)",linkColorHover:"rgba(255, 255, 0, 1)",linkOpacity:.4,linkTarget:"_blank",rightClickEnabled:!0,pageNumberOffset:0,flipSound:!0,backgroundMusic:!1,doubleClickZoomDisabled:!1,pageDragDisabled:!1,pageClickAreaWdith:"10%",noteTypes:[{id:1,title:"User",color:"green",enabled:!0},{id:2,title:"Group",color:"yellow",enabled:!0},{id:3,title:"Admin",color:"blue",enabled:!0}],pageRangeStart:null,pageRangeEnd:null,previewMode:{},strings:{print:"Print",printLeftPage:"Print left page",printRightPage:"Print right page",printCurrentPage:"Print current page",printAllPages:"Print all pages",download:"Download",downloadLeftPage:"Download left page",downloadRightPage:"Download right page",downloadCurrentPage:"Download current page",downloadAllPages:"Download all pages",bookmarks:"Bookmarks",bookmarkLeftPage:"Bookmark left page",bookmarkRightPage:"Bookmark right page",bookmarkCurrentPage:"Bookmark current page",search:"Search",findInDocument:"Find in document",pagesFoundContaining:"pages found containing",noMatches:"No matches",matchesFound:"matches found",page:"Page",matches:"matches",match:"match",thumbnails:"Thumbnails",tableOfContent:"Table of Contents",share:"Share",notes:"Notes",pressEscToClose:"Press ESC to close",password:"Password",addNote:"Add note",typeInYourNote:"Type in your note...",copyLink:"Copy link",copied:"Copied"},mobile:{shadows:!1,pageSegmentsW:5,btnAutoplay:{toolsMenu:!0},btnBookmark:{toolsMenu:!0},btnZoomIn:{enabled:!1},btnZoomOut:{enabled:!1},btnFirst:{enabled:!1},btnLast:{enabled:!1},currentPage:{enabled:!1},pagesInMemory:6,minimalViewBreakpoint:360}};static icons={fontawesome:{plus:[448,512,"M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"],minus:[448,512,"M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"],close:[384,512,"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"],next:[320,512,"M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"],expand:[448,512,"M32 32C14.3 32 0 46.3 0 64v96c0 17.7 14.3 32 32 32s32-14.3 32-32V96h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H32zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H64V352zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32h64v64c0 17.7 14.3 32 32 32s32-14.3 32-32V64c0-17.7-14.3-32-32-32H320zM448 352c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V352z"],compress:[448,512,"M160 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v64H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c17.7 0 32-14.3 32-32V64zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32H96v64c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32H32zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H352V64zM320 320c-17.7 0-32 14.3-32 32v96c0 17.7 14.3 32 32 32s32-14.3 32-32V384h64c17.7 0 32-14.3 32-32s-14.3-32-32-32H320z"],thumbs:[512,512,"M448 96V224H288V96H448zm0 192V416H288V288H448zM224 224H64V96H224V224zM64 288H224V416H64V288zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"],print:[512,512,"M128 0C92.7 0 64 28.7 64 64v96h64V64H354.7L384 93.3V160h64V93.3c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0H128zM384 352v32 64H128V384 368 352H384zm64 32h32c17.7 0 32-14.3 32-32V256c0-35.3-28.7-64-64-64H64c-35.3 0-64 28.7-64 64v96c0 17.7 14.3 32 32 32H64v64c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V384zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"],sound:[640,512,"M533.6 32.5C598.5 85.3 640 165.8 640 256s-41.5 170.8-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"],mute:[576,512,"M301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z"],share:[448,512,"M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"],facebook:[320,512,"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"],twitter:[512,512,"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"],list:[512,512,"M24 56c0-13.3 10.7-24 24-24H80c13.3 0 24 10.7 24 24V176h16c13.3 0 24 10.7 24 24s-10.7 24-24 24H40c-13.3 0-24-10.7-24-24s10.7-24 24-24H56V80H48C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432H120c13.3 0 24 10.7 24 24s-10.7 24-24 24H32c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32z"],pdf:[512,512,"M64 464l48 0 0 48-48 0c-35.3 0-64-28.7-64-64L0 64C0 28.7 28.7 0 64 0L229.5 0c17 0 33.3 6.7 45.3 18.7l90.5 90.5c12 12 18.7 28.3 18.7 45.3L384 304l-48 0 0-144-80 0c-17.7 0-32-14.3-32-32l0-80L64 48c-8.8 0-16 7.2-16 16l0 384c0 8.8 7.2 16 16 16zM176 352l32 0c30.9 0 56 25.1 56 56s-25.1 56-56 56l-16 0 0 32c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-48 0-80c0-8.8 7.2-16 16-16zm32 80c13.3 0 24-10.7 24-24s-10.7-24-24-24l-16 0 0 48 16 0zm96-80l32 0c26.5 0 48 21.5 48 48l0 64c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16l0-128c0-8.8 7.2-16 16-16zm32 128c8.8 0 16-7.2 16-16l0-64c0-8.8-7.2-16-16-16l-16 0 0 96 16 0zm80-112c0-8.8 7.2-16 16-16l48 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 32 32 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-32 0 0 48c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-64 0-64z"],tools:[128,512,"M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]},linkedin:[448,512,"M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"],whatsapp:[448,512,"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"],pinterest:[384,512,"M204 6.5C101.4 6.5 0 74.9 0 185.6 0 256 39.6 296 63.6 296c9.9 0 15.6-27.6 15.6-35.4 0-9.3-23.7-29.1-23.7-67.8 0-80.4 61.2-137.4 140.4-137.4 68.1 0 118.5 38.7 118.5 109.8 0 53.1-21.3 152.7-90.3 152.7-24.9 0-46.2-18-46.2-43.8 0-37.8 26.4-74.4 26.4-113.4 0-66.2-93.9-54.2-93.9 25.8 0 16.8 2.1 35.4 9.6 50.7-13.8 59.4-42 147.9-42 209.1 0 18.9 2.7 37.5 4.5 56.4 3.4 3.8 1.7 3.4 6.9 1.5 50.4-69 48.6-82.5 71.4-172.8 12.3 23.4 44.1 36 69.3 36 106.2 0 153.9-103.5 153.9-196.8C384 71.3 298.2 6.5 204 6.5z"],email:[512,512,"M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"],digg:[512,512,"M81.7 172.3H0v174.4h132.7V96h-51v76.3zm0 133.4H50.9v-92.3h30.8v92.3zm297.2-133.4v174.4h81.8v28.5h-81.8V416H512V172.3H378.9zm81.8 133.4h-30.8v-92.3h30.8v92.3zm-235.6 41h82.1v28.5h-82.1V416h133.3V172.3H225.1v174.4zm51.2-133.3h30.8v92.3h-30.8v-92.3zM153.3 96h51.3v51h-51.3V96zm0 76.3h51.3v174.4h-51.3V172.3z"],reddit:[512,512,"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z"],copyLink:[640,512,"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"]};constructor(e,t){t.length?(this.elem=t[0],this.elements=Array.from(t)):(this.elem=t,this.elements=[t]),void 0===FLIPBOOK.hasWebGl&&(FLIPBOOK.hasWebGl=function(){const e=document.createElement("canvas");return(e.getContext("webgl")||e.getContext("experimental-webgl"))instanceof WebGLRenderingContext}()),this.hasWebGl=FLIPBOOK.hasWebGl,this.thumbsShowing=!1,this.bookmarkShowing=!1,this.searchingString=!1,this.tocShowing=!1,this.menuShowing=!0,this.fullscreenActive=!1;const i={2:{menuTransparent:!0,currentPage:{vAlign:"bottom",hAlign:"center"},btnAutoplay:{hAlign:"right",vAlign:"top"},btnSound:{hAlign:"right",vAlign:"top"},btnSingle:{hAlign:"right",vAlign:"top"},btnExpand:{hAlign:"right",vAlign:"top"},btnSearch:{hAlign:"left",vAlign:"top"},btnBookmark:{hAlign:"left",vAlign:"top"},btnToc:{hAlign:"left",vAlign:"top"},btnThumbs:{hAlign:"left",vAlign:"top"},btnShare:{hAlign:"right",vAlign:"top"},btnPrint:{hAlign:"right",vAlign:"top"},btnDownloadPages:{hAlign:"right",vAlign:"top"},btnDownloadPdf:{hAlign:"right",vAlign:"top"},btnTools:{hAlign:"right",vAlign:"top"}},3:{menuTransparent:!0,menuPadding:5,menu2Transparent:!1,menu2OverBook:!1,menu2Padding:5,btnMargin:5,currentPage:{vAlign:"top",hAlign:"center"},btnPrint:{vAlign:"top",hAlign:"right"},btnDownloadPdf:{vAlign:"top",hAlign:"right"},btnDownloadPages:{vAlign:"top",hAlign:"right"},btnThumbs:{vAlign:"top",hAlign:"left"},btnToc:{vAlign:"top",hAlign:"left"},btnBookmark:{vAlign:"top",hAlign:"left"},btnSearch:{vAlign:"top",hAlign:"left"},btnShare:{vAlign:"top",hAlign:"right"},btnAutoplay:{vAlign:"top",hAlign:"right"},btnSingle:{vAlign:"top",hAlign:"right"},btnExpand:{vAlign:"top",hAlign:"right"},btnZoomIn:{hAlign:"right"},btnZoomOut:{hAlign:"right"},btnSound:{vAlign:"top",hAlign:"right"},btnTools:{vAlign:"top",hAlign:"right"}},4:{menu2Transparent:!1,menu2OverBook:!1,sideMenuOverMenu2:!1,currentPage:{vAlign:"top",hAlign:"center"},btnAutoplay:{vAlign:"top",hAlign:"left"},btnSound:{vAlign:"top",hAlign:"left"},btnSingle:{vAlign:"top",hAlign:"right"},btnExpand:{vAlign:"top",hAlign:"right"},btnZoomIn:{vAlign:"top"},btnZoomOut:{vAlign:"top"},btnSearch:{vAlign:"top",hAlign:"left"},btnBookmark:{vAlign:"top",hAlign:"left"},btnToc:{vAlign:"top",hAlign:"left"},btnThumbs:{vAlign:"top",hAlign:"left"},btnShare:{vAlign:"top",hAlign:"right"},btnPrint:{vAlign:"top",hAlign:"right"},btnDownloadPages:{vAlign:"top",hAlign:"right"},btnDownloadPdf:{vAlign:"top",hAlign:"right"},btnTools:{vAlign:"top",hAlign:"right"}}},o={dark:{skinColor:"#EEE",btnColorHover:"#FFF",skinBackground:"#313538"},gradient:{skinColor:"#EEE",btnColor:"#EEE",btnColorHover:"#FFF",skinBackground:"rgba(0,0,0,.7)",sideMenuOverMenu:!0,sideMenuOverMenu2:!0,menuBackground:"linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%)",menu2Background:"linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 100%)"}};e.skin&&o[e.skin]&&(e=FLIPBOOK.extend(!0,{},e,o[e.skin])),e.layout&&i[e.layout]&&(e=FLIPBOOK.extend(!0,{},e,i[e.layout])),this.options=FLIPBOOK.extend(!0,{},FLIPBOOK.Main.defaultOptions,e),FLIPBOOK.count=FLIPBOOK.count||0,FLIPBOOK.count++,this.uniqueID=FLIPBOOK.count,this.options.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform),this.options.isMobile&&FLIPBOOK.extend(!0,this.options,this.options.mobile),this.initOptions(this.options)}initOptions(e){const t=this;this.strings=e.strings,e.pageShininess=e.pageShininess/2,this.s=0,e.isMobile&&(e.singlePageMode=!!e.singlePageModeIfMobile||e.singlePageMode,e.viewModeMobile&&(e.viewMode=e.viewModeMobile),e.pageTextureSizeMobile&&(e.pageTextureSize=e.pageTextureSizeMobile),e.pageTextureSizeMobileSmall&&(e.pageTextureSizeSmall=e.pageTextureSizeMobileSmall));var i={a:5,b:7,c:2};if(e.pageTextureSize=Math.pow(i.a*i.b+i.c,i.c),e.pageTextureSizeSmall=Math.pow(i.a*i.b+i.c,i.c),e.zoomSize=Math.pow(i.b*i.a+i.c,i.c),"3dSinglePage"==e.viewMode&&(e.singlePageMode=!0),"2dSinglePage"==e.viewMode&&(e.singlePageMode=!0,e.viewMode="2d"),e.singlePageMode&&("2d"!=e.viewMode&&"swipe"!=e.viewMode&&(e.viewMode="3d"),e.rightToLeft&&(e.viewMode="swipe"),e.cover=!0),e.singlePageMode&&"3d"==e.viewMode&&(e.rightToLeft=!1),"simple"==e.viewMode&&(e.viewMode="3d",e.instantFlip=!0),e.cover||(e.responsiveView=!1),e.webgl){i={a:5,b:6,c:2};e.pageTextureSize=Math.pow(i.a*i.b-i.c,i.c),e.pageTextureSizeSmall=Math.pow(i.a*i.b-i.c,i.c),e.zoomSize=Math.pow(i.b*i.a+i.a,i.c)}Object.assign(e,{e:"toString",f:"padStart",g:"decodeURIComponent",h:97,i:16}),e.sideMenuPosition=e.rightToLeft?"right":"left","webgl"==e.viewMode&&(this.hasWebGl||(e.viewMode="3d")),("webgl"==e.viewMode||"scroll"==e.viewMode||"swipe"==e.viewMode||e.rightToLeft)&&(e.btnSingle.enabled=!1),this.webgl="webgl"==e.viewMode,e.menuFloating&&(e.sideMenuOverMenu=!0),e.menu2Floating&&(e.menu2OverBook=!0,e.sideMenuOverMenu2=!0),e.menuTransparent&&(e.sideMenuOverMenu=!0,e.menuBackground="none"),e.menu2Transparent?(e.menu2OverBook=!0,e.sideMenuOverMenu2=!0,e.menu2Background="none"):e.sideMenuOverMenu2=!1,e.menuOverBook&&(e.sideMenuOverMenu=!0),e.menu2OverBook&&(e.sideMenuOverMenu2=!0),e.pdfMode=Boolean(e.pdfUrl||e.pdfBase64),e.backgroundTransparent&&(e.backgroundColor="none"),this.options.containerRatio=function(e){if(void 0!==e){if("number"==typeof e)return e;if((e=String(e).trim().replace("/",":")).includes(":")){const t=e.split(":");return parseFloat(t[0])/parseFloat(t[1])}return parseFloat(e)}}(this.options.containerRatio),this.wrapper=document.createElement("div"),this.wrapper.classList.add("flipbook-main-wrapper");let o={};if(e.skinColor&&(o.color=e.skinColor),e.skinBackground&&(o.bg=e.skinBackground),e.skin&&Object.assign(o,{light:{color:"#222",bg:"#fff"},dark:{color:"rgba(255, 255, 255, 0.75)",bg:"rgb(49, 53, 56)"},gradient:{color:"#eee",bg:"rgba(30,30,30,.8)"},twilight:{color:"#feffd3",bg:"#141414"},darkGrey:{color:"#9e9e9e",bg:"#212121"},lightGrey:{color:"#757575",bg:"#e0e0e0"}}[e.skin]),this.wrapper.style.setProperty("--flipbook-bg",o.bg),this.wrapper.style.setProperty("--flipbook-color",o.color),this.wrapper.style.setProperty("--flipbook-accent-color",e.accentColor),this.tooltip2=new FLIPBOOK.Tooltip2(this.wrapper),""!==e.backgroundColor&&(this.wrapper.style.background=e.backgroundColor),""!==e.backgroundPattern&&(this.wrapper.style.background=`url(${e.backgroundPattern}) repeat`),""!==e.backgroundImage&&(this.wrapper.style.background=`url(${e.backgroundImage}) no-repeat`,this.wrapper.style.backgroundSize="cover",this.wrapper.style.backgroundPosition="center center"),this.bookLayer=document.createElement("div"),this.bookLayer.classList.add("flipbook-bookLayer"),this.wrapper.appendChild(this.bookLayer),e.pageDragDisabled&&(this.bookLayer.style.cursor="auto"),"spotlight"===e.linkTarget&&this.bookLayer.addEventListener("click",(e=>{"a"===e.target.tagName.toLowerCase()&&(e.preventDefault(),this.spotlight(e.target.href))})),e.rightClickEnabled||this.bookLayer.addEventListener("contextmenu",(function(e){e.preventDefault()})),e.hideMenu&&(this.bookLayer.style.bottom="0",e.menuOverBook=!0),e.pagesOriginal=JSON.parse(JSON.stringify(e.pages)),this.book=document.createElement("div"),this.book.classList.add("book"),this.bookLayer.appendChild(this.book),e.preloader&&"undefined"!=typeof jQuery)this.preloader=jQuery(e.preloader);else{this.preloader=document.createElement("div"),this.preloader.classList.add("flipbook-preloader","cssload-container");var s=document.createElement("div");s.classList.add("cssload-speeding-wheel"),this.preloader.appendChild(s);var n=document.createElement("div");n.classList.add("flipbook-loading-text"),n.textContent=e.preloaderText,this.preloader.appendChild(n);var a=document.createElement("div");a.classList.add("flipbook-loading-bg"),this.preloader.appendChild(a)}this.setLoadingProgress(0),this.dispose=function(){this.disposed=!0},e.main=this,this._events={},this.on=function(e,t){this._events[e]||(this._events[e]=[]),this._events[e].push(t)},this.off=function(e,t){if(this._events[e]){var i=this._events[e].indexOf(t);i>-1&&this._events[e].splice(i,1)}},this.trigger=function(e){if(this._events[e]){var t=0,i=this._events[e].length;if(i)for(;t<i;t++)this._events[e][t].apply(this,[].slice.call(arguments,1))}},this.on("textlayerrendered",(function(e){t.searchingString&&t.mark(t.searchingString)})),this.on("showpagehtml",(function(){this.deselectText(),t.searchingString&&t.mark(t.searchingString)})),this.addPageNotes=function(e){this.noteService&&this.noteService.initPageNotes(e)},this.on("pdfinit",(async function(){e.tableOfContent=t.pdfService.outline||e.tableOfContent,e.doublePage=t.pdfService.double,e.scaleCover&&(e.doublePage=!0,e.responsiveView=!1),e.backCover=t.pdfService.backCover,t.viewportOriginal=t.pdfService.viewports[0],e.firstPage={width:t.pdfService.viewports[0].width,height:t.pdfService.viewports[0].height,ratio:t.pdfService.viewports[0].width/t.pdfService.viewports[0].height},t.pdfService.numPages>1&&(e.secondPage={width:t.pdfService.viewports[1].width,height:t.pdfService.viewports[1].height,ratio:t.pdfService.viewports[1].width/t.pdfService.viewports[1].height}),e.numPages=t.pdfService.numPages,e.previewPages&&e.numPages>e.previewPages&&(e.numPages=e.previewPages,e.doublePage&&(e.backCover=!1,e.numPages=Math.ceil(e.numPages/2)));for(var i=[],o=e.pageTextureSize,s=0;s<e.numPages;s++){var n={canvas:{}};e.pages&&e.pages[s]&&FLIPBOOK.extend(n,e.pages[s]),i[s]=n}e.pages=i,e.pageWidth=parseInt(o*t.viewportOriginal.width/t.viewportOriginal.height),e.pageHeight=o,e.pw=e.pageWidth,e.ph=e.pageHeight;var a=e.tableOfContent;if(e.btnToc.enabled&&(!a||!a.length)){var r=await t.pdfService.loadOutline();r?e.tableOfContent=r:e.btnToc.enabled=!1}(e.doublePage||e.numPages%2==1)&&(e.cover=!0),t.start()})),FLIPBOOK.flipbookSrc=FLIPBOOK.flipbookSrc||this.options.flipbookSrc||function(){for(var e=document.getElementsByTagName("script"),t=0;t<e.length;t++){var i=String(e[t].src);if(i.match("flipbook\\.js")||i.match("flipbook\\.min\\.js"))return i;if(i.match("flipbook\\.lite\\.js")||i.match("flipbook\\.lite\\.min\\.js"))return i.replace(".lite","")}return""}();const r=FLIPBOOK.flipbookSrc.includes("flipbook.min.js"),l=r?"flipbook.min.js":"flipbook.js",h=r?".min":"";if([{key:"iscrollSrc",value:"libs/iscroll"},{key:"threejsSrc",value:"libs/three"},{key:"flipbookWebGlSrc",value:"flipbook.webgl"},{key:"flipbookBook3Src",value:"flipbook.book3"},{key:"flipBookSwipeSrc",value:"flipbook.swipe"},{key:"flipBookScrollSrc",value:"flipbook.scroll"},{key:"pdfjsSrc",value:"libs/pdf"},{key:"pdfServiceSrc",value:"flipbook.pdfservice"},{key:"pdfjsworkerSrc",value:"libs/pdf.worker"},{key:"markSrc",value:"libs/mark"}].forEach((e=>{FLIPBOOK[e.key]=FLIPBOOK.flipbookSrc.replace(l,e.value+h+".js")})),!e.deeplinkingPrefix&&e.deeplinking&&e.deeplinking.prefix&&(e.deeplinkingPrefix=e.deeplinking.prefix),e.deeplinkingEnabled=e.deeplinkingPrefix||e.deeplinkingEnabled||e.deeplinking&&e.deeplinking.enabled,e.deeplinkingEnabled&&(this.checkHash(),window.addEventListener("hashchange",this.checkHash.bind(this))),e.l=["load","front","rgb","length"],e.lightBox)e.btnClose.enabled=!0,this.canFullscreen()||(this.options.btnExpand.enabled=!1),this.lightbox=new FLIPBOOK.Lightbox(this,this.wrapper,e),this.lightboxStartedTimes=0,this.wrapper.style.background="none",this.bookLayer.style.background="none",this.book.style.background="none",this.lightbox.overlay.appendChild(this.preloader),this.preloader.style.position="fixed",this.elements.forEach((function(i){i.style.cursor="pointer",i.addEventListener("click",(async function(i){t.disposed||(i.preventDefault(),t.lightboxStartPage=this.dataset.page,t.started?(await t.lightboxStart(),e.lightBoxFullscreen&&setTimeout((async function(){t.toggleExpand ()}),0),t.lightbox.openLightbox()):(t.init(),t.lightbox.openLightbox(),e.lightBoxFullscreen&&setTimeout((async function(){t.toggleExpand ()}),100)))}))})),e.lightBoxOpened?(this.init(),"undefined"!=typeof jQuery&&jQuery(window).trigger("r3d-lightboxloadingstarted")):e.lightboxPreload&&async function(){e.pdfMode&&(await t.loadScript(FLIPBOOK.pdfjsSrc,"pdfjsLib"),await t.loadScript(FLIPBOOK.pdfServiceSrc,"FLIPBOOK.PdfService"),(e.btnSearch.enabled||e.btnNotes.enabled||e.search.enabled)&&await t.loadScript(FLIPBOOK.markSrc,"Mark")),"webgl"==e.viewMode?await t.loadScript(FLIPBOOK.threejsSrc,"THREE"):await t.loadScript(FLIPBOOK.iscrollSrc,"IScroll")}(),this.fullscreenElement=document.body;else{e.btnClose.enabled=!1,this.wrapper.appendChild(this.preloader),this.elem.appendChild(this.wrapper),this.elem.style.background=this.wrapper.style.background,this.fullscreenElement=this.elem;new IntersectionObserver((e=>{e[0].isIntersecting?t.Book?t.Book.enable():t.init():t.Book&&t.Book.disable()})).observe(this.wrapper)}}async start(){var e=this.options;if(1==e.pages.length&&(e.numPages=1,e.doublePage=!1,e.btnNext.enabled=!1,e.btnPrev.enabled=!1,e.btnFirst.enabled=!1,e.btnLast.enabled=!1,e.sideNavigationButtons=!1,e.btnAutoplay.enabled=!1,e.singlePageMode=!0,e.viewMode="3d",e.rightToLeft=!1,e.btnThumbs.enabled=!1,e.btnToc.enabled=!1,e.btnBookmark.enabled=!1),e.dp&&(e.doublePage=!0),this.started)return;const t=this.options.pageWidth/this.options.pageHeight;t>1&&(this.options.pageTextureSize/=t,this.options.pageTextureSizeSmall/=t,this.options.pageWidth/=t,this.options.pageHeight/=t),this.options.zoomSize=this.options.zoomSize||this.options.pageTextureSize,this.pageW=this.options.pageWidth,this.bookW=2*this.options.pageWidth,this.options.singlePageMode&&(this.bookW/=2),this.pageH=this.options.pageHeight,this.bookH=this.options.pageHeight,this.options.numPages%2==0?this.options.numSheets=(this.options.numPages+2)/2:this.options.numSheets=(this.options.numPages+1)/2,this.started=!0,this.options.lightBox&&(this.lightbox.openLightbox(),await this.lightboxStart());const i=this.options.pageClickAreaWdith,o=this.options.pages.length,s=this.options.doublePage,n=this.options.singlePageMode,a="scroll"==this.options.viewMode,r=1e3*this.options.pageWidth/this.options.pageHeight,l=r-50,h=2*r-50;this.options.pages.hasHtmlContent=!!this.options.pages&&this.options.pages.some((e=>!!e.htmlContent));var d=this.options.rightToLeft,c=this;function p(e){e.htmlContent+='<a href="#" draggable="false" class="internalLink pageClickArea pageClickAreaLeft" data-page="prev"></a>'}function u(e,t){const i=t?h:l;e.htmlContent+='<a href="#" draggable="false" class="internalLink pageClickArea pageClickAreaRight" data-page="next" style="left:'+i+'px;"></a>'}i&&!a&&this.options.pages.forEach((function(e,t){e.htmlContent=e.htmlContent||"",n?(t>0&&(d?p(e):u(e)),t<o-1&&(d?u(e):p(e))):s?c.options.cover&&0==t||c.options.backCover&&t==c.options.pages.length-1?d?p(e):u(e):(p(e),u(e,!0)):t%2==0?d?p(e):u(e):d?u(e):p(e)})),await this.createBook(),this.createTooltip(),this.options.btnNotes.enabled&&this.initNotes()}async checkHash(){if(this.disposed)return;const e=this.options;var t=window.location.hash,i=this.getPageFromHash();e.cover||i++;var o=i;i<1?i=1:this.numPages&&i>this.numPages&&(i=this.numPages),i&&(this.started?this.Book&&(this.lightbox&&!this.lightbox.lightboxOpened&&(this.lightbox.openLightbox(),await this.lightboxStart()),this.goToPage(i,-1==t.indexOf("flip"))):(e.startPage=o,e.lightBox&&(this.init(),e.lightBoxFullscreen&&setTimeout((()=>{this.toggleExpand ()}),100))))}async init(){if(this.initStarted)return;this.initStarted=!0;const e=this.options,t=e=>new Promise(((t,i)=>{const o=new Image;o.src=e,o.onload=()=>t(o),o.onerror=i}));if(e.fillPreloader.enabled){const i=document.createElement("div");i.classList.add("flipbook-fillPreloader");try{const o=await t(e.fillPreloader.imgEmpty),s=await t(e.fillPreloader.imgFull);i.appendChild(o),i.appendChild(s),this.$fillPreloader=i,this.$fillPreloaderImg=s,this.wrapper.appendChild(i)}catch(e){console.error("Error loading preloader images",e)}}this.initialized||(this.define=window.define,window.define=null,this.id=this.uniqueID,this.addPageItems(),e.pageCaptions&&this.addPageCaptions(),e.pdfMode?this.initPdf():this.initJpg(),this.setLoadingProgress(.1),this.initialized=!0)}bodyHasVerticalScrollbar(){return document.body.scrollHeight>window.innerHeight}isIframe(){try{return window.self!==window.top}catch(e){return!0}}isZoomed(){return this.zoom>1}async lightboxStart(){var e,t=this;this.options;(this.started||await this.start(),void 0!==this.Book)?(this.Book.enable(),this.playBgMusic(),this.lightboxStartedTimes++,this.sendGAEvent({event:"flipbook_lightbox_open",book_name:this.options.name,nonInteraction:!0}),this.updateCurrentPage(),this.lightbox.openLightbox(),this.resize(),window.location.hash||(e=this.lightboxStartPage||this.options.lightboxStartPage),e&&this.goToPage(e,!0)):setTimeout((function(){t.lightboxStart()}),100)}setHash(e){e<1&&(e=1),"#"+this.options.deeplinkingPrefix+e!=window.location.hash&&this.options.deeplinkingEnabled&&this.Book.enabled&&this.hash!=e&&(window.location.hash="#"+this.options.deeplinkingPrefix+String(e),this.historyStateChange(),this.hash=e)}historyStateChange(e){this.historyStateChanges=this.historyStateChanges||0,void 0!==e?this.historyStateChanges=e:this.historyStateChanges++}clearHash(){}getPageFromHash(){}async sendGAEvent(e){}lightboxEnd(){document.fullscreenElement&&(this.toggleExpand (),this.toggleIcon(this.btnExpand,!0)),this.Book&&(this.options.lightboxStartPage&&this.Book.goToPage(this.options.lightboxStartPage,!0),this.Book.zoomTo(this.options.zoomMin),this.Book.disable()),this.closeMenus(),this.setLoadingProgress(1),this.pauseMediaPlayback(),this.backgroundMusic&&this.backgroundMusic.pause(),window.location.hash&&this.clearHash(),this.historyStateChanges&&this.historyStateChange(0)}pauseMediaPlayback(){this.mediaElements&&this.mediaElements.forEach((e=>{if("video"===e.tagName.toLowerCase()||"audio"===e.tagName.toLowerCase())e.pause();else if("iframe"===e.tagName.toLowerCase()){const t=e.src||e.getAttribute("src")||"";if((t.includes("youtube.com/embed")||t.includes("youtube-nocookie.com/embed"))&&e.contentWindow)try{e.contentWindow.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:[]}),"*")}catch(e){}}})),this.pageAudioPlayer&&this.pageAudioPlayer.pause(),this.youtubes&&this.youtubes.forEach((e=>{const t=e.player;t&&"function"==typeof t.getCurrentTime&&(e.dataset.ytCurrentTime=t.getCurrentTime(),e.dataset.ytMuted=t.isMuted(),t.pauseVideo())}))}turnPageStart(){this.pauseMediaPlayback(),this.resumeGlobalSound(),this.playFlipSound(),this.zoom<=1&&this.showWrapperOverflow()}showWrapperOverflow(){this.overflowVisible||(this.wrapper.style.overflow="visible",this.overflowVisible=!0)}hideWrapperOverflow(){this.overflowVisible&&(this.wrapper.style.overflow="hidden",this.overflowVisible=!1)}turnPageComplete(){this.animating=!1,this.updateCurrentPage();var e=this.Book.rightIndex||0;this.options.rightToLeft&&(e=this.options.pages.length-e),this.trigger("turnpagecomplete",{rightIndex:e}),this.options.zoomReset&&this.Book.zoomTo(this.options.zoomMin),this.hideWrapperOverflow()}dragPage(){this.zoom<=1&&this.showWrapperOverflow()}updateCurrentPage(){var e,t=this.options.rightToLeft,i=this.options.numPages,o=i-this.options.pageNumberOffset,s=this.Book.rightIndex||0;s%2==1&&s++,t&&(s=2*this.Book.numSheets-s);let n=this.options.cover?s:s-1;if(this.options.singlePageMode||this.Book.singlePage||1==this.Book.view?(this.Book.getCurrentPageNumber?e=this.Book.getCurrentPageNumber():(t&&s--,e=s+1),this.setHash(e),this.cPage=[e-1]):(n>i||n==i&&i%2==0?(e=i,this.cPage=[i-1]):n<1?(e=1,this.cPage=[0]):(e=String(n)+"-"+String(n+1),this.cPage=[n-1,n]),this.setHash(n)),this.enableNext(this.Book.canFlipNext()),this.enablePrev(this.Book.canFlipPrev()),2===this.cPage.length?(this.wrapper.querySelectorAll(".c-l-p").forEach((function(e){e.classList.remove("flipbook-hidden")})),this.wrapper.querySelectorAll(".c-r-p").forEach((function(e){e.classList.remove("flipbook-hidden")})),this.wrapper.querySelectorAll(".c-p").forEach((function(e){e.classList.add("flipbook-hidden")}))):(this.wrapper.querySelectorAll(".c-l-p").forEach((function(e){e.classList.add("flipbook-hidden")})),this.wrapper.querySelectorAll(".c-r-p").forEach((function(e){e.classList.add("flipbook-hidden")})),this.wrapper.querySelectorAll(".c-p").forEach((function(e){e.classList.remove("flipbook-hidden")}))),void 0!==this.currentPage&&(this.s&&this.options.pdfPageScale>0&&this.goToPage(0),e!=this.currentPageValue)){this.currentPageValue=String(e);var a=Number(String(e).split("-")[0]),r=Number(String(e).split("-")[1]);a&&this.options.pages[Number(a-1)]&&this.options.pages[Number(a-1)].name&&(a=this.options.pages[Number(a-1)].name),r&&this.options.pages[Number(r-1)]&&this.options.pages[Number(r-1)].name&&(r=this.options.pages[Number(r-1)].name),e=a&&r?a+"-"+r:a||(r||1),this.currentPageString=e,this.currentPageInput.dispatchEvent(new Event("blur",{bubbles:!0,cancelable:!0})),this.currentPage.textContent=" / "+String(o);const t=document.createElement("span");if(t.style.visibility="hidden",t.style.position="absolute",t.style.whiteSpace="pre",t.className="flipbook-currentPageInput",document.body.appendChild(t),t.textContent=e,this.currentPageInput.style.width=`${t.offsetWidth+2}px`,document.body.removeChild(t),this.resize(),"undefined"!=typeof jQuery)jQuery(this).trigger({type:"pagechange",page:this.currentPageValue,name:this.options.name}),jQuery(window).trigger({type:"r3d-pagechange",page:this.currentPageValue,name:this.options.name});else{var l=new CustomEvent("r3d-pagechange",{detail:{page:this.currentPageValue,name:this.options.name}});window.dispatchEvent(l)}this.trigger("pagechange"),this.sendGAEvent({event:"flipbook_page_view",book_name:this.options.name,page_number:this.currentPageValue,nonInteraction:!0}),this.flippingPage=!1}}async initJpg(){const e=this.options;let t=e.pages||[];if(e.previewPages&&(t=t.slice(0,e.previewPages)),e.pageRangeStart||e.pageRangeEnd){const i=Math.max((e.pageRangeStart||1)-1,0),o=Math.min(e.pageRangeEnd||t.length,t.length);t=t.slice(i,o)}e.pages=t;const i=t.length,o=t=>new Promise((i=>this.loadPage(t,e.pageTextureSize,i)));e.hasHtmlContent||t.some((e=>e.json))||(e.btnSearch.enabled=!1),e.tableOfContent.length||t.some((e=>e.title))||(e.btnToc.enabled=!1);const s=({width:e,height:t,img:i})=>[e||i.width,t||i.height];this.setLoadingProgress(.5),await o(0);const[n,a]=s(t[0]);if(Object.assign(e,{pw:n,ph:a,pageWidth:n,pageHeight:a,zoomSize:e.zoomSize||a}),1===i)return this.start();await o(1);const[r,l]=s(t[1]);Object.assign(e,{pageWidth2:r,pageHeight2:l});const h=n/a;if(e.doublePage=e.scaleCover||r/l/h>1.5,e.doublePage||(e.backCover=i%2==0),i>2&&e.doublePage){await o(i-1);const[n,a]=s(t[i-1]);e.backCover=r/l/(n/a)>1.5}(e.doublePage||i%2==1)&&(e.cover=!0),this.start()}async initPdf(){this.started||(this.setLoadingProgress(.2),await this.loadScript(FLIPBOOK.pdfjsSrc,"pdfjsLib"),await this.loadScript(FLIPBOOK.pdfServiceSrc,"FLIPBOOK.PdfService"),window.CanvasPixelArray&&(window.CanvasPixelArray.prototype.set=function(e){for(var t=this.length,i=0;i<t;i++)this[i]=e[i]}),pdfjsLib.GlobalWorkerOptions.workerSrc=this.options.pdfjsworkerSrc||FLIPBOOK.pdfjsworkerSrc,this.pdfService=new FLIPBOOK.PdfService(this,this.options))}initPageHTML(e){const t=this.options.pages[e];t.htmlInitialized||(this.addPageLinks(t),this.addPageNotes(t),this.addMediaListeners(t),t.htmlInitialized=!0)}addMediaListeners(e){if(e.htmlContent&&e.htmlContent instanceof Element){const t=e.htmlContent.querySelectorAll("video, audio, iframe");this.mediaElements=this.mediaElements||[],this.mediaElements.push(...t)}}addPageLinks(e){}pauseGlobalSound(){this.toggleSound(!1),this.soundPaused=!0}resumeGlobalSound(){this.soundPaused&&this.toggleSound(!0)}addPageNames(){const e=this.options.pageNumberOffset;this.options.pages.forEach((function(t,i){void 0===t.name&&(t.name=i-e+1,t.name<1&&(t.name=function(e){let t="";return[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}].forEach((function(i){for(;e>=i.value;)t+=i.numeral,e-=i.value})),t}(i+1)))}))}async loadPageHTML(e,t){var i=this.options;e<0?t.call(this,{}):i.pdfMode?i.pages[e]?(this.initPageHTML(e),t.call(this,i.pages[e].htmlContent,e)):t.call(this,{}):(this.initPageHTML(e),t.call(this,i.pages[e].htmlContent,e))}async fetchAndCacheImage(e){this.imageCache??=new Map;let t=this.imageCache.get(e);if(t)return t;try{const t=(async()=>{const t=await fetch(e,{cache:"force-cache"});if(!t.ok)throw new Error(`Fetch failed: ${t.status}`);const i=await t.blob(),{bitmapResizeHeight:o,bitmapResizeQuality:s}=this.options??{},n={};return o&&(n.resizeHeight=o),s&&(n.resizeQuality=s),createImageBitmap(i,Object.keys(n).length?n:void 0)})();return this.imageCache.set(e,t),await t}catch(t){throw this.imageCache.delete(e),t}}loadPage(e,t,i){var o=this,s=this.options.pages&&this.options.pages[e]&&this.options.pages[e].src,n=this.options.pages[e];if(n)if(this.options.pdfMode&&!s)this.loadPageFromPdf(e,t,i);else if(t==this.options.thumbTextureSize&&n.thumb)if(!n.thumbImg&&n.thumb){if(n.thumbImg=new Image,n.thumbImg.decoding="async",n.thumbImg.setAttribute("data-id",e),n.thumbImg.onload=function(){n.thumbLoaded=!0,o.pageLoaded({index:e,size:t,image:n.thumbImg},i)},"webgl"==this.options.viewMode&&(n.thumbImg.crossOrigin="Anonymous"),!1!==o.options.matchProtocol){const e=location.protocol;n.thumb.startsWith(e)||(n.thumb=n.thumb.replace(/^https?:/,e))}n.thumbImg.src=n.thumb}else n.thumbLoaded?o.pageLoaded({index:e,size:t,image:n.thumb},i):setTimeout((function(){o.loadPage(e,t,i)}),300);else if(!n.img&&n.src){if(!1!==o.options.matchProtocol){const e=location.protocol;n.src.startsWith(e)||(n.src=n.src.replace(/^https?:/,e))}"webgl"==o.options.viewMode?o.fetchAndCacheImage(n.src).then((s=>{n.imgLoaded=!0,n.width=s.width,n.height=s.height,o.pageLoaded({index:e,size:t,imageBitmap:s},i)})):(n.img=new Image,n.img.decoding="async",n.img.setAttribute("data-id",e),n.img.onload=function(){n.imgLoaded=!0,o.pageLoaded({index:e,size:t,image:n.img},i)},n.img.src=n.src)}else n.imgLoaded?o.pageLoaded({index:e,size:t,image:n.img},i):setTimeout((function(){o.loadPage(e,t,i)}),300);else i.call(this)}pageLoaded(e,t){t.call(this,e,t),this.options.loadAllPages&&e.index<this.options.numPages-1&&this.loadPage(e.index+1,e.size,(function(){})),this.searchingString&&this.mark(this.searchingString,!0)}loadPageFromPdf(e,t,i){t=t||this.options.pageTextureSize,this.pdfService.renderBookPage(e,t,i)}getString(e){return this.options.strings[e]}async mark(e){await this.loadScript(FLIPBOOK.markSrc,"Mark"),this.markedStr=e;var t=this.wrapper.querySelectorAll(".textLayer"),i=Array.from(t).filter((function(t){var i=t.getAttribute("data-marked");return!(i&&i.split(",").includes(e))}));if(i.length){var o=new Mark(i);o.nodes=i,this.markInstances=this.markInstances||[],this.markInstances.push(o),o.unmark({className:"mark-search",done:function(){o.mark(e,{acrossElements:!0,separateWordSearch:!1,className:"mark-blue mark-search",done:function(){i.forEach((function(t){var i=t.getAttribute("data-marked")||"",o=i?i.split(","):[];o.includes(e)||(o.push(e),t.setAttribute("data-marked",o.join(",")))}))}})}})}}unmark(){this.searchingString=null,this.markedStr=null,this.markInstances=this.markInstances||[],this.markInstances.length&&(this.markInstances.forEach((function(e){e.unmark({className:"mark-search",done:function(){e.nodes.forEach((function(e){e.removeAttribute("data-marked")}))}})})),this.markInstances=[])}toggleSound(e){var t=this.options;t.sound=void 0!==e?e:!t.sound,this.backgroundMusic&&(t.sound?this.backgroundMusic.play():this.backgroundMusic.pause()),this.toggleIcon(this.btnSound,t.sound)}toggleIcon(e,t){if(e)if(e.$iconAlt)t?(e.$iconAlt.classList.add("flipbook-hidden"),e.$icon.classList.remove("flipbook-hidden")):(e.$iconAlt.classList.remove("flipbook-hidden"),e.$icon.classList.add("flipbook-hidden"));else{var i=t?e.iconAlt:e.icon,o=t?e.icon:e.iconAlt;e.find("."+i).removeClass(i).addClass(o)}}scrollPageIntoView(e){let t=e.pageNumber;this.options.doublePage&&(t=2*t-1),this.goToPage(t)}loadScript(e,t){-1===e.indexOf("?ver")&&(e+=`?ver=${FLIPBOOK.version}`),FLIPBOOK.scripts=FLIPBOOK.scripts||{};return new Promise(((i,o)=>{if(t&&void 0!==t.split(".").reduce(((e,t)=>e&&e[t]),window))return i();const s=FLIPBOOK.scripts[e];if(s)return s.loaded?i():void s.promises.push({resolve:i,reject:o});FLIPBOOK.scripts[e]={loaded:!1,promises:[{resolve:i,reject:o}]};let n=document.createElement("script");n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(t,i){i||n.readyState&&!/loaded|complete/.test(n.readyState)||(n.onload=n.onreadystatechange=null,FLIPBOOK.scripts[e].loaded=!0,FLIPBOOK.scripts[e].promises.forEach((e=>e.resolve())))},n.onerror=t=>{FLIPBOOK.scripts[e].promises.forEach((e=>e.reject(t))),FLIPBOOK.scripts[e]=void 0},document.head.appendChild(n)}))}async initGoogleAnalytics(){return document.querySelector(`script[src="https://www.googletagmanager.com/gtag/js?id=${this.gaCode}"]`)?Promise.resolve():new Promise(((e,t)=>{var i=document.createElement("script");i.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this.gaCode);const o=this;i.async=1,i.onload=function(){function t(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],t("js",new Date),t("config",o.gaCode),e()},i.onerror=function(){t(new Error("Google Analytics script failed to load"))},document.body.appendChild(i)}))}async createBook(){var e=this.options;if(this.options.searchOnStart&&(this.options.btnSearch.enabled=!0),this.setLoadingProgress(.9),"webgl"===this.options.viewMode?(await this.loadScript(FLIPBOOK.threejsSrc,"THREE"),await this.loadScript(FLIPBOOK.flipbookWebGlSrc,"FLIPBOOK.BookWebGL")):"swipe"===this.options.viewMode?(await this.loadScript(FLIPBOOK.iscrollSrc,"IScroll"),await this.loadScript(FLIPBOOK.flipBookSwipeSrc,"FLIPBOOK.BookSwipe")):"scroll"===this.options.viewMode?(await this.loadScript(FLIPBOOK.iscrollSrc,"IScroll"),await this.loadScript(FLIPBOOK.flipBookScrollSrc,"FLIPBOOK.BookScroll")):(await this.loadScript(FLIPBOOK.iscrollSrc,"IScroll"),await this.loadScript(FLIPBOOK.flipbookBook3Src,"FLIPBOOK.Book3")),window.define=this.define,this.setLoadingProgress(1),this.options.pagesOriginal=this.options.pages,this.options.doublePage&&this.options.pages.length>2){var t,i,o=this.options.pages[0];o.title=1;for(var s=[o],n=this.options.pages.length,a=1;a<=n-2;a++)t={src:(o=this.options.pages[a]).src,thumb:o.thumb,title:2*a,htmlContent:o.htmlContent,json:o.json,side:"left"},i={src:o.src,thumb:o.thumb,title:2*a+1,htmlContent:o.htmlContent,json:o.json,side:"right"},s.push(t),s.push(i);(o=this.options.pages[this.options.pages.length-1]).title=this.options.pages.length,this.options.backCover?s.push(o):(t={src:o.src,thumb:o.thumb,title:2*a,htmlContent:o.htmlContent,json:o.json,side:"left"},i={src:o.src,thumb:o.thumb,title:2*a+1,htmlContent:o.htmlContent,json:o.json,side:"right"},s.push(t),s.push(i)),this.options.pages=s}if(this.addPageNames(),this.options.numPages=this.options.pages.length,this.options.numPages%2==0||this.options.singlePageMode||(this.options.backCover=!1),this.options.cover||(this.options.backCover=!this.options.backCover),this.options.pages.forEach((e=>{const t=e.htmlContent||"",i=document.createElement("div");i.className="flipbook-page-html";const o=document.createElement("div");o.className="htmlContent",o.innerHTML=t,i.appendChild(o),e.htmlContent=i})),"webgl"==this.options.viewMode){var r=this.options;r.scroll=this.scroll,r.parent=this,this.Book=new FLIPBOOK.BookWebGL(this.book,this,r),this.webglMode=!0,this.initSound()}else"swipe"==this.options.viewMode?this.Book=new FLIPBOOK.BookSwipe(this.book,this.bookLayer,this,e):"scroll"==this.options.viewMode?(this.options.singlePageMode=!0,this.Book=new FLIPBOOK.BookScroll(this.book,this.bookLayer,this,e)):("2d"!=this.options.viewMode&&(this.options.viewMode="3d"),this.Book=new FLIPBOOK.Book3(this.book,this,e),this.webglMode=!1,this.initSound());this.initSwipe(),this.initListeners(),this.resize(),this.Book.enable(),this.book.classList.remove("flipbook-hidden"),!e.cover&&e.startPage<2&&(e.startPage=2),this.tocCreated=!1,this.options.pdfMode,this.createMenu(),this.options.sound||this.toggleSound(!1),this.onZoom(this.options.zoomMin),1==this.options.pages.length&&(this.rightToLeft=!1),FLIPBOOK.books=FLIPBOOK.books||{},FLIPBOOK.books[this.id]=this.Book,this.createLogo(),this.onBookCreated()}async destroy(){this.pdfService&&(this.pdfService.pages&&this.pdfService.pages.forEach((function(e){e.renderingTasks&&e.renderingTasks.forEach((function(e){e.cancel()}))})),this.pdfService.pdfDocument&&(this.pdfService.pdfDocument.cleanup(),await this.pdfService.pdfDocument.destroy(),this.pdfService.pdfDocument=null,this.pdfService=null)),this.bookCreated?(this.Book.destroy(),this.autoplayTimer&&clearInterval(this.autoplayTimer),this.setBookmarkedPages([]),delete FLIPBOOK.books[this.id],this.Book=null,this.initPdf=null,this.createMenu=null,this.createBook=null,this.options=null,this.resizeObserver.disconnect(),this.resizeObserver.disconnect(),this.removeEventListeners()):setTimeout(this.destroy.bind(this),100)}initNotes(){this.noteService=new FLIPBOOK.Notes(this);const e=this;window.addEventListener("r3d-update-note-visibility",(function(t){e.options.noteTypes.forEach((function(e){t.detail.id==e.id&&(e.enabled=t.detail.enabled)})),e.noteService.updateNoteVisibility()}))}createTooltip(){this.tooltip=new FLIPBOOK.Tooltip,this.wrapper.appendChild(this.tooltip.domElement)}showTooltip(e){this.tooltip.show(e)}hideTooltip(){this.tooltip.hide()}addPageItems(){}addPageCaptions(){const e=this.options.pages;for(let t in e){let i=e[t];if(i.htmlContent=i.htmlContent||"","string"==typeof i.caption&&""!=i.caption){const e=this.createSVGIcon("camera");i.htmlContent+='<div class="flipbook-page-caption-btn">',i.htmlContent+=e.outerHTML,i.htmlContent+="</div>";const t='<div class="flipbook-page-caption">'+i.caption+"</div>";i.htmlContent+=t}}}spotlight(e,t,i){}showMenu(){this.menuTop.classList.remove("flipbook-hidden"),this.menuBottom.classList.remove("flipbook-hidden")}hideMenu(){this.menuTop.classList.add("flipbook-hidden"),this.menuBottom.classList.add("flipbook-hidden")}showCenterExpandButton(){if(!this.centerButtonExpand){const e=document.createElement("div");e.className="flipbook-center-btn-expand";const t=this.createSVGIcon("expand");e.appendChild(t),e.addEventListener("click",(()=>{this.toggleExpand ()})),this.wrapper.appendChild(e),this.centerButtonExpand=e}this.centerButtonExpand.classList.remove("flipbook-hidden")}hideCenterExpandButton(){this.centerButtonExpand&&this.centerButtonExpand.classList.add("flipbook-hidden")}toggleMinimalView(){this.wrapperW<this.options.minimalViewBreakpoint&&!this.lightbox&&!this.fullscreenActive?this.minimalViewActive||(this.hideMenu(),this.showCenterExpandButton(),this.minimalViewActive=!0,this.goToPage(1,!0)):this.minimalViewActive&&(this.showMenu(),this.hideCenterExpandButton(),this.minimalViewActive=!1)}resizeContainer(){if(this.options.minimalView&&this.toggleMinimalView(),!this.lightbox&&!this.options.fullscreen&&!this.elemStatic){var e=this.pageW/this.pageH,t=2*e;let o,s=this.elem.getBoundingClientRect().width;o=this.options.isMobile&&s<this.options.responsiveViewTreshold?e:t;var i=s/(this.options.containerRatio||o);this.elemH!=i&&(this.elemH=i,this.elem.style.height=i+"px")}this.resize()}addEventListeners(){this.handleResize=()=>this.resizeContainer(),this.handleKeydown=e=>{if(this.Book.enabled&&(this.options.lightBox||!document.body.classList.contains("flipbook-overflow-hidden"))&&(this.fullscreenActive||!document.body.classList.contains("flipbook-fullscreen"))&&(this.options.arrowsAlwaysEnabledForNavigation&&(37==e.keyCode||39==e.keyCode)||!this.options.lightBox&&!this.fullscreenActive&&(this.options.arrowsDisabledNotFullscreen||this.bodyHasVerticalScrollbar()))){switch(e.keyCode){case 37:this.zoom>1?this.moveBook("left"):this.prevPage();break;case 38:this.zoom>1?this.moveBook("up"):this.nextPage();break;case 39:this.zoom>1?this.moveBook("right"):this.nextPage();break;case 33:this.prevPage();break;case 34:this.nextPage();break;case 36:this.firstPage();break;case 35:this.lastPage();break;case 40:this.zoom>1?this.moveBook("down"):this.prevPage()}return!1}},this.handleFs=()=>this.handleFsChange(),window.addEventListener("resize",this.handleResize),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("MSFullscreenChange",this.handleFs),document.addEventListener("mozfullscreenchange",this.handleFs),document.addEventListener("webkitfullscreenchange",this.handleFs),document.addEventListener("fullscreenchange",this.handleFs)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("MSFullscreenChange",this.handleFs),document.removeEventListener("mozfullscreenchange",this.handleFs),document.removeEventListener("webkitfullscreenchange",this.handleFs),document.removeEventListener("fullscreenchange",this.handleFs)}onBookCreated(){var e=this.options,t=this,i=document.documentElement;if(i.style.setProperty("--flipbook-link-color",this.options.linkColor),i.style.setProperty("--flipbook-link-color-hover",this.options.linkColorHover),i.style.setProperty("--flipbook-link-opacity",this.options.linkOpacity),this.elemStatic="static"==getComputedStyle(this.elem).position,this.resizeContainer(),this.addEventListeners(),this.resizeObserver=new ResizeObserver((e=>{t.resizeContainer()})),this.resizeObserver.observe(this.elem),this.resizeObserver2=new ResizeObserver((()=>{t.resize()})),this.resizeObserver2.observe(this.bookLayer),this.playBgMusic(),e.lightboxCloseOnBack&&(window.onpopstate=function(){t.Book.enabled&&t.lightbox&&t.lightbox.lightboxOpened&&(window.location.hash||t.lightbox.closeLightbox(!0))}),"scroll"!=this.options.viewMode&&this.bookLayer.addEventListener("wheel",function(e){if(e.ctrlKey&&e.preventDefault(),!this.Book.enabled)return;if(!this.options.lightBox&&!this.fullscreenActive&&!e.ctrlKey&&(this.options.wheelDisabledNotFullscreen||this.bodyHasVerticalScrollbar()||this.isIframe()))return;const t=e.deltaX||-e.wheelDeltaX||-e.detail,i=e.deltaY||-e.wheelDeltaY||-e.detail;return Math.abs(i)>0&&Math.abs(i)>Math.abs(t)?(i>0?this.zoomOut(e):this.zoomIn(e),!1):void 0}.bind(this),{passive:!1}),t.options.contentOnStart)this.toggleToc(!0);else if(t.options.thumbnailsOnStart)this.options.thumbsStyle="side",this.toggleThumbs(!0);else if(t.options.searchOnStart&&(this.toggleSearch(!0),"string"==typeof this.options.searchOnStart)){const e=this.thumbs.findInput;e.value=this.options.searchOnStart;const t=new KeyboardEvent("keyup",{bubbles:!0});e.dispatchEvent(t)}e.autoplayOnStart&&this.toggleAutoplay(!0),this.resize(),this.Book.zoomTo(e.zoomMin),this.updateCurrentPage(),this.goToPage(Number(e.startPage),!0),e.onbookcreated&&e.onbookcreated.call(this),this.bookCreated=!0}initSound(){if(this.options.flipSound){this.flipSound=document.createElement("audio"),this.flipSound.preload="auto";var e=document.createElement("source");e.src=this.options.assets.flipMp3,e.type="audio/mpeg",this.flipSound.appendChild(e)}if(this.options.backgroundMusic){let e=null;if("string"==typeof this.options.backgroundMusic?e=this.options.backgroundMusic:this.options.assets&&this.options.assets.backgroundMp3&&(e=this.options.assets.backgroundMp3),e){this.backgroundMusic=document.createElement("audio"),this.backgroundMusic.preload="auto",this.backgroundMusic.autoplay=!0,this.backgroundMusic.loop=!0;var t=document.createElement("source");t.src=e,t.type="audio/mpeg",this.backgroundMusic.appendChild(t),document.body.appendChild(this.backgroundMusic)}}}touchSwipe(e,t){let i,o,s,n,a,r,l=!1,h=!1,d=0,c=!1;function p(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+i*i)}function u(e,t){return{distanceX:e-i,distanceY:t-o}}function g(e){return e.type.includes("mouse")?e:e.touches[0]}var m=this;function b(n){if("touchstart"===n.type)c=!0;else{if("mousedown"===n.type&&c)return;if("A"===n.target.tagName||"SPAN"===n.target.tagName||"MARK"===n.target.tagName)return void m.trigger("disableIScroll")}m.trigger("enableIScroll");let a=g(n);i=a.clientX,o=a.clientY,s=(new Date).getTime(),l=!0,d=n.touches?n.touches.length:1,t(n,"start",null,0,0,d),e.addEventListener("mousemove",f),e.addEventListener("touchmove",f,{passive:!1})}function f(e){let i=g(e),{distanceX:o,distanceY:s}=u(i.clientX,i.clientY);if(n=i.clientX,a=i.clientY,l&&"mousemove"===e.type)e.preventDefault(),t(e,"move",o,s,0,1);else if(e.touches&&2===e.touches.length){let i;if(e.preventDefault(),"number"==typeof e.scale)i=e.scale;else{let t=p(e.touches);h?i=t/r:(h=!0,r=t,i=1)}h?t(e,"pinch",i,null,0,2):(h=!0,r=p(e.touches),t(e,"pinchstart",i,null,0,2))}else e.touches&&1===e.touches.length&&(m.zoom>1&&e.preventDefault(),t(e,"move",o,s,0,1))}function v(e){m.trigger("enableIScroll"),"touchend"!==e.type&&"mouseup"!==e.type||setTimeout((function(){c=!1}),300);let i=e.changedTouches?e.changedTouches[0]:e,{distanceX:o,distanceY:n}=u(i.clientX,i.clientY),a=(new Date).getTime()-s;l&&(l=!1,t(e,"end",o,n,a,e.changedTouches?e.changedTouches.length:1)),h&&(h=!1,t(e,"pinchend",null,0,0,2)),w()}function k(e){setTimeout((function(){c=!1}),300);let i=(new Date).getTime()-s,{distanceX:o,distanceY:r}=u(n,a);l&&(l=!1,t(e,"cancel",o,r,i,1)),h&&(h=!1,t(e,"pinchcancel",o,r,i,2)),w()}function w(){e.removeEventListener("mousemove",f),e.removeEventListener("touchmove",f)}e.addEventListener("mousedown",b),e.addEventListener("touchstart",b),e.addEventListener("mouseup",v),e.addEventListener("touchend",v),e.addEventListener("mouseleave",k),e.addEventListener("touchcancel",k)}initListeners(){this.wrapper.addEventListener("pointerdown",(e=>{this.deselectText()}))}initSwipe(){var e=this;let t=!1,i=!1,o=!1;this.touchSwipe(this.book,(function(s,n,a,r,l,h){if(o="toolSelect"==e.tool||e.options.pageDragDisabled,"start"==n){e.zoomStart=e.zoom;try{e.currentPageInput.dispatchEvent(new Event("blur",{bubbles:!0,cancelable:!0}))}catch(s){}const t=s.target.closest(".flipbook-page-html");t&&t.classList.add("mousedown")}if(h>1&&"pinch"==n){let t=a;s.scale&&(t=s.scale),e.zoomTo(e.zoomStart*t,0,s),i=!0}if("end"==n){if(!e.options.doubleClickZoomDisabled)if(!e.clickTimer&&s.touches)e.clickTimer=setTimeout((function(){delete e.clickTimer}),300);else{clearTimeout(e.clickTimer),delete e.clickTimer;const t=s.target.closest(".flipbook-page-html");if(t&&t.classList.remove("mousedown"),t&&!a&&!r){var d=e.options.zoomTime;e.zoom>=e.options.zoomMax?(e.zoomTo(e.options.zoomMin,d,s),t.classList.remove("zoomed")):(e.zoomTo(e.options.zoomMax,d,s),t.classList.add("zoomed"))}}Math.abs(a)<5&&l<200&&(t=!0)}t||i||o||e.Book.onSwipe(s,n,a,r,l,h),t=!1,"pinchend"==n&&(i=!1)})),this.swipeEnabled=!0}createSVGIcon(e,t=!1){const i=FLIPBOOK?.Main?.icons?.fontawesome?.[e]??FLIPBOOK?.Main?.icons?.[e];if(!i)return null;const[o,s,n]=i,a="http://www.w3.org/2000/svg",r=document.createElementNS(a,"svg");r.setAttribute("viewBox",`0 0 ${o} ${s}`),r.setAttribute("height","1em"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("stroke-width","1"),r.classList.add("flipbook-icon"),t&&r.classList.add("flipbook-icon-reverse");const l=document.createElementNS(a,"path");return l.setAttribute("d",n),r.appendChild(l),r}createButton(e){var t=this.options,i=e.toolsMenu&&t.btnTools.enabled,o=!i&&("top"===e.vAlign&&t.menu2Transparent||"top"!==e.vAlign&&t.menuTransparent),s=e.background||(o?t.floatingBtnBackground:t.btnBackground),n=e.backgroundHover||(o?t.floatingBtnBackgroundHover:t.btnBackgroundHover),a=e.color||(o?t.floatingBtnColor:t.btnColor),r=e.colorHover||(o?t.floatingBtnColorHover:t.btnColorHover),l=o?t.floatingBtnTextShadow:t.btnTextShadow,h=e.radius||(o?t.floatingBtnRadius:t.btnRadius),d=e.border||(o?t.floatingBtnBorder:t.btnBorder),c=o?t.floatingBtnMargin:t.btnMargin,p=t.btnPaddingV+4,u=t.btnPaddingH+4,g=document.createElement("span"),m=e.size||t.btnSize;i&&(s="none",n="none");const b=e.svg||e.name.replace("btn","").toLowerCase();var f;if(g.$icon=this.createSVGIcon(b,e.iconReverse),g.appendChild(g.$icon),e.svgAlt&&(g.$iconAlt=this.createSVGIcon(e.svgAlt,e.iconReverse),g.appendChild(g.$iconAlt),g.$iconAlt.classList.add("flipbook-hidden")),function(e){e.style.margin=`${c}px`,e.style.padding=`${p}px ${u}px`,e.style.borderRadius=`${h}px`,e.style.boxShadow=t.btnShadow,e.style.border=d,e.style.color=a,e.$icon.style.fill=a,e.$iconAlt&&(e.$iconAlt.style.fill=a),e.style.background=s,e.style.textShadow=l,e.style.width=`${m}px`,e.style.height=`${m}px`,a&&e.classList.remove("skin-color"),s&&e.classList.remove("skin-color-bg")}(g),e.onclick&&g.addEventListener("click",(function(){e.onclick()})),(r||n)&&(g.addEventListener("mouseenter",(function(){this.classList.contains("disabled")||(g.$icon.style.fill=r,g.$icon.style.background=n,g.$iconAlt&&(g.$iconAlt.style.fill=r,g.$iconAlt.style.background=n))})),g.addEventListener("mouseleave",(function(){g.$icon.style.fill=a,g.$icon.style.background=s,g.$iconAlt&&(g.$iconAlt.style.fill=a,g.$iconAlt.style.background=s)}))),i){f=this.toolsMenu;var v=document.createElement("span");v.textContent=e.title,v.classList.add("skin-color"),g.appendChild(v)}else f="top"===e.vAlign?t.menu2Floating?this.menuTC:"left"===e.hAlign?this.menuTL:"right"===e.hAlign?this.menuTR:this.menuTC:t.menuFloating?this.menuBC:"left"===e.hAlign?this.menuBL:"right"===e.hAlign?this.menuBR:this.menuBC;return g.setAttribute("data-name",e.name),g.classList.add("flipbook-menu-btn-wrapper","flipbook-menu-btn","skin-color"),g.style.order=e.order,f.appendChild(g),i||(g.setAttribute("data-tooltip",e.title),g.classList.add("flipbook-has-tooltip")),g}createAndAppendMenu(e,t){const i=document.createElement("div");return i.className=e,t.appendChild(i),i}initArrowButton(e,t){const i=this.options;e.addEventListener("click",(i=>{if(e.disabled)return!1;e.disabled=!0,setTimeout((()=>{e.disabled=!1}),300),i.stopPropagation(),i.preventDefault(),t()})),Object.assign(e.style,{width:`${i.arrowSize}px`,borderRadius:`${i.arrowRadius}px`,padding:`${i.arrowPadding}px`,filter:`drop-shadow(${i.arrowTextShadow})`,border:i.arrowBorder,color:i.arrowColor,fill:i.arrowColor,background:i.arrowBackground,boxSizing:"initial"}),i.arrowBackgroundHover&&(e.addEventListener("mouseenter",(function(){this.classList.contains("disabled")||(e.style.background=i.arrowBackgroundHover)})),e.addEventListener("mouseleave",(function(){e.style.background=i.arrowBackground}))),i.arrowColor&&e.classList.remove("skin-color"),i.arrowBackground&&e.classList.remove("skin-color-bg")}createMenu(){if(this.menuBottom)return;var e=this.options,t=e.menuFloating?"flipbook-menu-floating":"flipbook-menu-fixed",i=e.menu2Floating?"flipbook-menu-floating":"flipbook-menu-fixed",o=this;function s(e,t){const i=document.createElement("div");return i.className=e,t.appendChild(i),i}this.menuBottom=document.createElement("div"),this.menuBottom.classList.add("flipbook-menuBottom",t),e.menuTransparent||"gradient"===e.skin||this.menuBottom.classList.add("flipbook-border"),this.menuBottom.style.background=e.menuBackground,this.menuBottom.style.boxShadow=e.menuShadow,this.menuBottom.style.margin=e.menuMargin+"px",this.menuBottom.style.padding=e.menuPadding+"px",this.wrapper.appendChild(this.menuBottom),e.menuTransparent||e.menuBackground||this.menuBottom.classList.add("skin-color-bg"),e.hideMenu&&this.menuBottom.classList.add("flipbook-hidden"),this.menuTop=document.createElement("div"),this.menuTop.classList.add("flipbook-menuTop",i),e.menu2Transparent||"gradient"===e.skin||this.menuTop.classList.add("flipbook-border"),this.menuTop.style.background=e.menu2Background,this.menuTop.style.boxShadow=e.menu2Shadow,this.menuTop.style.margin=e.menu2Margin+"px",this.menuTop.style.padding=e.menu2Padding+"px",this.wrapper.appendChild(this.menuTop),e.menu2Transparent||e.menu2Background||this.menuTop.classList.add("skin-color-bg"),"swipe"===e.viewMode&&(e.btnSound.enabled=!1),e.progressBar.enabled&&e.progressBar.vAlign,this.menuBL=s("flipbook-menu flipbook-menu-left",this.menuBottom),this.menuBC=s("flipbook-menu flipbook-menu-center",this.menuBottom),this.menuBR=s("flipbook-menu flipbook-menu-right",this.menuBottom),this.menuTL=s("flipbook-menu flipbook-menu-left",this.menuTop),this.menuTC=s("flipbook-menu flipbook-menu-center",this.menuTop),this.menuTR=s("flipbook-menu flipbook-menu-right",this.menuTop),this.options.btnTools.enabled&&(this.toolsMenu=document.createElement("div"),this.toolsMenu.className="flipbook-tools flipbook-submenu skin-color skin-color-bg flipbook-font flipbook-border"),this.options.btnShare.enabled&&(this.shareMenu=document.createElement("div"),this.shareMenu.className="flipbook-share flipbook-submenu skin-color skin-color-bg flipbook-font flipbook-border"),e.sideNavigationButtons&&(this.$arrowWrapper=document.createElement("div"),this.$arrowWrapper.className="flipbook-nav",this.bookLayer.appendChild(this.$arrowWrapper),this.btnNext=this.createSVGIcon("next"),this.$arrowWrapper.appendChild(this.btnNext),this.btnNext.style.height=e.arrowSize+"px",this.btnNext.style.fontSize=e.arrowSize+"px",this.btnNext.style.marginTop=String(-e.arrowSize/2)+"px",this.btnNext.style.marginRight=e.arrowMargin+"px",this.btnNext.classList.add("flipbook-right-arrow"),this.initArrowButton(this.btnNext,this.nextPage.bind(this)),this.btnPrev=this.createSVGIcon("next",!0),this.$arrowWrapper.appendChild(this.btnPrev),this.btnPrev.style.height=e.arrowSize+"px",this.btnPrev.style.fontSize=e.arrowSize+"px",this.btnPrev.style.marginTop=String(-e.arrowSize/2)+"px",this.btnPrev.style.marginLeft=e.arrowMargin+"px",this.btnPrev.classList.add("flipbook-left-arrow"),this.initArrowButton(this.btnPrev,this.prevPage.bind(this)),e.btnFirst.enabled&&(this.btnFirst=this.createSVGIcon("last",!0),this.$arrowWrapper.appendChild(this.btnFirst),this.btnFirst.style.height=.5*e.arrowSize+"px",this.btnFirst.style.fontSize=.5*e.arrowSize+"px",this.btnFirst.style.marginTop=String(e.arrowSize/2+e.arrowMargin+2*e.arrowPadding)+"px",this.btnFirst.style.marginLeft=e.arrowMargin+"px",this.btnFirst.classList.add("flipbook-first-arrow"),this.initArrowButton(this.btnFirst,this.firstPage.bind(this))),e.btnLast.enabled&&(this.btnLast=this.createSVGIcon("last"),this.$arrowWrapper.appendChild(this.btnLast),this.btnLast.style.height=.5*e.arrowSize+"px",this.btnLast.style.fontSize=.5*e.arrowSize+"px",this.btnLast.style.marginTop=String(e.arrowSize/2+e.arrowMargin+2*e.arrowPadding)+"px",this.btnLast.style.marginRight=e.arrowMargin+"px",this.btnLast.classList.add("flipbook-last-arrow"),this.initArrowButton(this.btnLast,this.lastPage.bind(this))),e.menuNavigationButtons||(e.btnOrder.indexOf("btnFirst")>=0&&e.btnOrder.splice(e.btnOrder.indexOf("btnFirst"),1),e.btnOrder.indexOf("btnPrev")>=0&&e.btnOrder.splice(e.btnOrder.indexOf("btnPrev"),1),e.btnOrder.indexOf("btnNext")>=0&&e.btnOrder.splice(e.btnOrder.indexOf("btnNext"),1),e.btnOrder.indexOf("btnLast")>=0&&e.btnOrder.splice(e.btnOrder.indexOf("btnLast"),1))),e.pdfMode&&!e.btnDownloadPdf.url&&(e.btnDownloadPdf.url=e.pdfUrl),e.btnDownloadPdf.url||(e.btnDownloadPdf.enabled=!1),!e.pdfTextLayer&&e.btnSearch&&(e.btnSearch.enabled=!1);window.self!==window.top&&(e.btnDownloadPages.enabled=!1),e.btnOrder=["currentPage","progressBar","btnZoomOut","btnZoomIn","btnThumbs","btnToc","btnShare","btnPrint","btnDownloadPdf","btnSound","btnTools","btnExpand","btnClose"];for(var n=[],a=0;a<e.btnOrder.length;a++){var r=e.btnOrder[a],l=e[r];e.isMobile&&l.hideOnMobile&&(l.enabled=!1),l.toolsMenu&&l.enabled&&n.push(l)}n.length<=1&&(e.btnTools.enabled=!1);for(a=0;a<e.btnOrder.length;a++){r=e.btnOrder[a];(l=e[r]).enabled&&(l.name=r,"currentPage"===l.name?this.createCurrentPage():"progressBar"===l.name||"search"===l.name||(this[r]=this.createButton(l),this[r].addEventListener("click",(function(t){if("btnDownloadPdf"==this.dataset.name){if(window.self!==window.top)parent.postMessage({type:"download",url:e.btnDownloadPdf.url},"*");else{var i=e.btnDownloadPdf.url,s=document.createElement("a");s.href=i;var n=s.href.split("/").pop().split("#")[0].split("?")[0];s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s)}o.sendGAEvent({event:"flipbook_pdf_download",book_name:o.options.name,url:e.btnDownloadPdf.url||e.pdfUrl,nonInteraction:!0})}else t.stopPropagation(),t.preventDefault(),o.onButtonClick(this,t)}))))}e.buttons&&e.buttons.forEach((e=>{o.createButton(e).index(1)})),this.btnSingle&&this.toggleIcon(this.btnSingle,this.options.singlePageMode)}onButtonClick(e,t){var i=e.dataset.name,o=this.options;switch(i){case"btnFirst":this.firstPage();break;case"btnPrev":this.prevPage();break;case"btnNext":this.nextPage();break;case"btnLast":this.lastPage();break;case"btnZoomIn":this.zoomIn();break;case"btnZoomOut":this.zoomOut();break;case"btnAutoplay":this.autoplay||this.nextPage(),this.toggleAutoplay();break;case"btnSearch":this.toggleSearch();break;case"btnBookmark":this.toggleBookmark();break;case"btnRotateLeft":this.Book.rotateLeft&&this.Book.rotateLeft();break;case"btnRotateRight":this.Book.rotateRight&&this.Book.rotateRight();break;case"btnToc":this.toggleToc();break;case"btnThumbs":this.toggleThumbs();break;case"btnShare":this.toggleShareMenu();break;case"btnTools":this.toggleToolsMenu();break;case"btnNotes":this.toggleNotesMenu();break;case"btnDownloadPages":if(o.downloadMenu)this.toggleDownloadMenu();else{var s=document.createElement("a");s.href=o.pdfUrl||o.btnDownloadPages.url,s.dispatchEvent(new MouseEvent("click"))}break;case"btnPrint":o.printMenu?this.togglePrintMenu():this.togglePrintWindow();break;case"btnSound":this.toggleSound();break;case"btnExpand":this.toggleExpand ();break;case"btnSingle":this.toggleSinglePage();break;case"btnClose":this.lightbox.closeLightbox()}}handleFsChange(){this.Book&&this.Book.enabled&&((document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)===this.fullscreenElement||this.isFullscreen?(this.fullscreenActive=!0,this.options.onfullscreenenter&&this.options.onfullscreenenter.call(this),document.body.classList.add("flipbook-fullscreen")):(this.fullscreenActive=!1,this.options.onfullscreenexit&&this.options.onfullscreenexit.call(this),document.body.classList.remove("flipbook-fullscreen")),this.toggleIcon(this.btnExpand,!this.fullscreenActive))}createLogo(){const{options:e,wrapper:t}=this,{logoImg:i,logoCSS:o,logoAlignH:s,logoAlignV:n,logoUrl:a,logoUrlTarget:r,isMobile:l,logoHideOnMobile:h}=e;if(!i||l&&h)return;const d=`${o}`+["position:absolute","right"===s?"right:0":"left"===s?"left:0":"","bottom"===n?"bottom:0":"top"===n?"top:0":""].filter(Boolean).join(";")+";",c=(({zIndex:e="",opacity:t=""}={})=>{const o=document.createElement("img");return o.src=i,o.style.cssText=d+(e?`z-index:${e};`:"")+(t?`opacity:${t};`:""),a&&(o.style.cursor="pointer",o.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),window.open(a,r||"_blank")}))),o})();t.appendChild(c)}setLoadingProgress(e){this.disposed||(this.$fillPreloader?this.setFillPreloaderProgress(e):e>0&&e<1?this.preloader.classList.remove("flipbook-hidden"):this.preloader.classList.add("flipbook-hidden"))}setFillPreloaderProgress(e){if(this.$fillPreloader)if(e>0&&e<1){if(this.fillPreloaderProgress=this.fillPreloaderProgress||0,e<this.fillPreloaderProgress)return;this.fillPreloaderProgress=e;var t=this.$fillPreloaderImg[0];t.style.clip="rect(0px,"+t.width*e+"px,"+t.height+"px,0px)",this.$fillPreloader.show()}else this.$fillPreloader.hide()}playFlipSound(){if(this.options.sound&&this.Book.enabled&&void 0!==this.flipSound.play){this.flipSound.currentTime=0;var e=this;setTimeout((function(){e.flipSound.play().then((function(){}),(function(){}))}),150)}}playBgMusic(e=!0){if(!this.options.sound||!this.backgroundMusic)return;const t=()=>{const i=this.backgroundMusic.play();i&&"function"==typeof i.catch&&i.catch((i=>{e&&i&&("NotAllowedError"===i.name||i.message?.includes("user"))&&setTimeout(t,200)}))};t()}onMouseWheel(e){if("wheelDeltaX"in e)wheelDeltaX=e.wheelDeltaX/12,wheelDeltaY=e.wheelDeltaY/12;else if("wheelDelta"in e)wheelDeltaX=wheelDeltaY=e.wheelDelta/12;else{if(!("detail"in e))return;wheelDeltaX=wheelDeltaY=3*-e.detail}wheelDeltaX>0?this.zoomIn(e):this.zoomOut(e)}zoomTo(e,t,i){if(e==this.zoom)return;var o,s;if(this.zoom=e,void 0===i)o=this.wrapperW/2,s=this.wrapperH/2;else{i.touches&&i.touches[0]?(o=i.touches[0].pageX,s=i.touches[0].pageY):i.changedTouches&&i.changedTouches[0]?(o=i.changedTouches[0].pageX,s=i.changedTouches[0].pageY):(o=i.pageX,s=i.pageY);let e=this.wrapper.getBoundingClientRect();o=o-e.left-window.scrollX,s=s-e.top-window.scrollY,s+=this.bookVerticalPadding}const n=this.getZoomMin();this.zoom<n&&(this.zoom=n),this.zoom>this.options.zoomMax&&(this.zoom=this.options.zoomMax),this.options.zoomMax2&&this.zoom>this.options.zoomMax2&&(this.zoom=this.options.zoomMax2),this.autoplay&&(this.zoom=this.zoom=n),this.Book.zoomTo(this.zoom,t,o,s),this.onZoom(this.zoom)}zoomOut(e){var t=this.zoom/this.options.zoomStep;const i=this.getZoomMin();t=t<i?i:t,this.zoomTo(t,this.options.zoomTime,e)}zoomIn(e){var t=this.zoom*this.options.zoomStep;t>this.options.zoomMax&&(t=this.options.zoomMax),this.zoomTo(t,this.options.zoomTime,e)}getZoomMin(){return"scroll"==this.options.viewMode?this.options.zoomMin2:this.options.zoomMin}deselectText(){window.getSelection().removeAllRanges()}nextPage(){this.Book&&(this.flippingPage=!0,this.Book.canFlipNext()&&(this.Book.nextPage(),this.deselectText()))}prevPage(){this.Book&&(this.flippingPage=!0,this.Book.canFlipPrev()&&(this.Book.prevPage(),this.deselectText()))}firstPage(){const e=this.options.pages.length;this.goToPage(this.options.rightToLeft?e:1)}lastPage(){const e=this.options.pages.length;this.goToPage(this.options.rightToLeft?1:e)}goToPage(e,t){if(this.Book){var i=this.options;e=i.rightToLeft&&i.pages&&i.pages.length?i.pages.length-e+1:e,e=i.rightToLeft&&!i.backCover?e+1:e,t||(this.flippingPage=!0),this.options.cover||e++,e<1?e=1:e>this.options.numPages&&!this.options.rightToLeft&&(e=this.options.numPages),this.Book.goToPage(e,t),this.deselectText()}}moveBook(e){this.Book&&this.Book.move&&this.Book.move(e)}updateBookLayerSize(){const e=this.options,t=this.menuShowing&&!e.menu2OverBook&&this.menuTop?this.menuTop.offsetHeight:0,i=this.menuShowing&&!e.menuOverBook&&this.menuBottom?this.menuBottom.offsetHeight:0,o=("3d"==e.viewMode||e.viewMode,this.zoom,"webgl"==e.viewMode?this.options.lightBox||this.fullscreenActive?Math.max(t,i):e.bookVerticalPadding:0);this.bookVerticalPadding=o;const s=(!e.menuOverBook&&this.menuBottom?-o+i:-o)+"px",n=(!e.menu2OverBook&&this.menuTop?-o+t:-o)+"px",a=this.bookLayer.style;a.bottom!==s&&(a.bottom=s),a.top!==n&&(a.top=n)}onZoom(e){this.zoom=e;const t=this.getZoomMin();this.enableButton(this.btnZoomIn,e<this.options.zoomMax),this.enableButton(this.btnZoomOut,e>t),this.enableSwipe(e<=1),this.zoom>1&&this.hideWrapperOverflow(),this.sendGAEvent({event:"flipbook_zoom",book_name:this.options.name,page_number:this.currentPageValue,zoom:e,nonInteraction:!0})}enableSwipe(e){this.swipeEnabled=e}createCurrentPage(){var e,t=this,i=this.options,o="flipbook-currentPageHolder ";e="top"==i.currentPage.vAlign?"left"==i.currentPage.hAlign?this.menuTL:"right"==i.currentPage.hAlign?this.menuTR:this.menuTC:"left"==i.currentPage.hAlign?this.menuBL:"right"==i.currentPage.hAlign?this.menuBR:this.menuBC;var s="top"==i.currentPage.vAlign&&i.menu2Transparent||"top"!=i.currentPage.vAlign&&i.menuTransparent,n=s?i.floatingBtnBackground:"",a=s?i.floatingBtnColor:i.btnColor,r=s?i.floatingBtnTextShadow:"",l=s?i.floatingBtnRadius:i.btnRadius,h=document.createElement("div");e.appendChild(h),h.style.margin=i.currentPage.marginV+"px "+i.currentPage.marginH+"px",h.style.height=i.btnSize+"px",h.style.padding=i.btnPaddingV+"px",s||(o+=" skin-color"),h.className=o,h.style.color=a,h.style.background=n,h.style.textShadow=r,h.style.borderRadius=l+"px",i.currentPage.order&&(h.style.order=i.currentPage.order),this.currentPageHolder=h;var d=document.createElement("form");h.appendChild(d),d.addEventListener("submit",(function(e){e.preventDefault();var o=parseInt(t.currentPageInput.value,10);return o=Math.min(o,i.pages.length),o+=t.options.pageNumberOffset,t.goToPage(o),!1})),this.currentPageInput=document.createElement("input"),this.currentPageInput.type="text",this.currentPageInput.className="flipbook-currentPageInput",this.currentPageInput.style.margin=i.currentPage.marginV+"px "+i.currentPage.marginH+"px",this.currentPageInput.style.color=a,this.currentPageInput.addEventListener("focus",(function(){t.currentPageInput.value=""})),this.currentPageInput.addEventListener("blur",(function(){t.currentPageInput.value=t.currentPageString})),d.appendChild(this.currentPageInput);var c=String(i.numPages).length;this.currentPageInput.classList.add("digits-"+c),this.currentPageInput.setAttribute("maxlength",c),this.currentPage=document.createElement("div"),this.currentPage.className="flipbook-currentPageNumber",h.appendChild(this.currentPage),s||this.currentPageInput.classList.add("skin-color")}createMenuHeader(e,t,i){var o=document.createElement("div");o.className="flipbook-menu-header skin-clor flipbook-font",e.appendChild(o);var s=document.createElement("span");s.textContent=t,s.className="flipbook-menu-title skin-color",o.appendChild(s);var n=document.createElement("span");n.className="flipbook-btn-close skin-color",o.appendChild(n),n.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this.closeMenus()}));var a=this.createSVGIcon("close");n.appendChild(a)}createToc(){var e=this.options.tableOfContent;this.tocHolder=document.createElement("div"),this.tocHolder.className="flipbook-tocHolder flipbook-side-menu skin-color-bg flipbook-border",this.wrapper.appendChild(this.tocHolder),this.tocHolder.style[this.options.sideMenuPosition]="0",this.tocHolder.classList.add("flipbook-hidden"),this.createMenuHeader(this.tocHolder,this.strings.tableOfContent,this.toggleToc),this.toc=document.createElement("div"),this.toc.className="flipbook-toc",this.tocHolder.appendChild(this.toc);var t=this.options.pages;if(!e||!e.length){e=[];for(var i=0;i<t.length;i++)t[i].title&&e.push({title:t[i].title,page:String(i+1),pageNumberDisplay:t[i].name})}for(i=0;i<e.length;i++)t[i]&&t[i].name&&e[i].page&&(e[i].pageNumberDisplay=t[e[i].page-1].name);this.tocScroller=this.buildTOC(e),this.tocScroller.className="flipbook-toc-scroller",this.toc.appendChild(this.tocScroller),this.tocCreated=!0,this.toggleToc()}buildTOC(e){const t=this,i=document.createElement("ul"),o=this.createSVGIcon("next");return e.forEach((e=>{const s=document.createElement("li"),n=document.createElement("div");n.classList.add("toc-item","skin-color");const a=document.createElement("div");if(a.classList.add("title-container"),e.items&&e.items.length>0){const e=document.createElement("span");e.classList.add("expand-icon"),e.innerHTML=o.outerHTML,e.addEventListener("click",(function(t){t.stopPropagation();const i=s.querySelector("ul");"none"===i.style.display?(i.style.display="block",i.dataset.expanded="true",e.classList.add("expanded")):(i.style.display="none",i.dataset.expanded="false",e.classList.remove("expanded"))})),a.appendChild(e)}else{const e=document.createElement("span");e.classList.add("spacer"),e.innerHTML="&nbsp;",a.appendChild(e)}const r=document.createElement("span");r.textContent=e.title,r.classList.add("title"),a.appendChild(r),n.appendChild(a);const l=document.createElement("span");if(l.textContent=e.pageNumberDisplay||e.page,l.classList.add("page-number"),n.appendChild(l),n.addEventListener("click",(function(i){if(i.stopPropagation(),i.preventDefault(),t.options.tableOfContentCloseOnClick&&t.toggleToc(!1),!e.page&&e.dest)"string"==typeof e.dest?t.pdfService.pdfDocument.getDestination(e.dest).then((function(e){t.goToDest(e)})):t.goToDest(e.dest);else{var o=Number(e.page);setTimeout((function(){t.goToPage(o)}),200)}})),s.appendChild(n),e.items&&e.items.length>0){const t=this.buildTOC(e.items);t.style.display="none",s.appendChild(t)}i.appendChild(s)})),i}goToDest(e){}enablePrev(e){this.prevEnabled!=e&&this.btnPrev&&(this.enableButton(this.btnPrev,e),this.enableButton(this.btnFirst,e),this.prevEnabled=e,this.Book.enablePrev(e))}enableNext(e){this.nextEnabled!=e&&this.btnNext&&(this.enableButton(this.btnNext,e),this.enableButton(this.btnLast,e),this.nextEnabled=e,this.Book.enableNext(e))}enableButton(e,t){void 0!==e&&(t?e.classList.remove("disabled"):e.classList.add("disabled"),e.enabled=t)}resize(e){if(!this.Book||!this.Book.enabled)return;const t=this.tocShowing||this.thumbsShowing||this.searchShowing||this.bookmarkShowing;let i=this.bookLayer.getBoundingClientRect();if(this.wrapperW!==i.width||this.wrapperH!==i.height||this.sidebarVisible!==t){if(this.wrapperW=i.width,this.wrapperH=i.height,this.sidebarVisible=t,this.updateBookLayerSize(),t){var o=this.tocShowing?this.tocHolder.getBoundingClientRect().width:this.thumbsShowing&&"overlay"===this.options.thumbsStyle?0:this.thumbs.thumbHolder.getBoundingClientRect().width;this.bookLayer.style[this.options.sideMenuPosition]=`${o}px`;let e={bottom:"0px",top:"0px"};this.options.sideMenuOverMenu||(e.bottom=this.menuBottom.offsetHeight+"px"),this.options.sideMenuOverMenu2||(e.top=this.menuTop.offsetHeight+"px"),this.wrapper.querySelectorAll(".flipbook-side-menu").forEach((function(t){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}))}else this.bookLayer.style[this.options.sideMenuPosition]="0px";this.adjustZoomLimits(),this.Book.onResize(e),this.Book.zoomTo(this.options.zoomMin)}}adjustZoomLimits(){var e=this.options,t=this.wrapperW/this.wrapperH,i=this.pageW/this.pageH,o=2*i,s=this.menuTop.offsetHeight,n=this.menuBottom.offsetHeight,a=Math.max(s,n),r=e.bookMargin||20;e.menuOverBook&&e.menu2OverBook&&(e.zoomMin=(this.wrapperH-2*a-r)/this.wrapperH),"scroll"==e.viewMode?e.zoomMax=e.zoomSize*e.pageWidth/e.pageHeight*2/this.wrapperW:e.responsiveView&&this.wrapperW<=e.responsiveViewTreshold&&t<o&&t<e.responsiveViewRatio?e.zoomMax=e.zoomSize/this.wrapperH*(t>i?1:i/t):e.zoomMax=e.zoomSize/this.wrapperH*(t>o?1:o/t),e.zoomMax=Math.max(e.zoomMax,e.zoomMin)}pdfResize(){this.Book.onZoom()}createThumbs(){this.thumbs=new FLIPBOOK.Thumbnails(this)}toggleThumbs(e){this.thumbs||this.createThumbs(),void 0!==e&&(this.thumbsShowing=!e),this.thumbsShowing?(this.thumbs.hide(),this.thumbsShowing=!1):(this.closeMenus(),this.thumbs.show(),this.thumbsShowing=!0),this.resize()}toggleToc(e){this.tocCreated?(!this.tocShowing||e?(this.closeMenus(),this.tocShowing=!0,this.tocHolder.classList.remove("flipbook-hidden")):(this.tocHolder.classList.add("flipbook-hidden"),this.tocShowing=!1,this.tocHolder.querySelectorAll(".expanded").forEach((e=>{e.classList.remove("expanded")})),this.tocHolder.querySelectorAll('[data-expanded="true"]').forEach((e=>{e.dataset.expanded="false",e.style.display="none"}))),this.resize()):this.createToc()}toggleSearch(e){}toggleBookmark(e){}closeMenus(){this.thumbsShowing&&this.toggleThumbs(),this.tocShowing&&this.toggleToc(),this.searchShowing&&this.toggleSearch(),this.bookmarkShowing&&this.toggleBookmark(),this.printMenuShowing&&this.togglePrintMenu(),this.dlMenuShowing&&this.toggleDownloadMenu(),this.shareMenuShowing&&this.toggleShareMenu(),this.toolsMenuShowing&&this.toggleToolsMenu(),this.notesMenuShowing&&this.toggleNotesMenu(),this.passwordMenuShowing&&this.togglePasswordMenu(),this.tooltip2.hideTooltip()}toggleToolsMenu(){var e=this;this.toolsMenu.parentNode||(this.btnTools.appendChild(this.toolsMenu),this.toolsMenu.addEventListener("click",(function(e){e.stopPropagation()})),document.addEventListener("click",(function(t){e.toolsMenuShowing&&e.toggleToolsMenu(),e.shareMenuShowing&&e.toggleShareMenu()}))),this.toolsMenuShowing?(this.toolsMenu.classList.add("flipbook-hidden"),this.toolsMenuShowing=!1,this.btnTools.classList.remove("flipbook-btn-active"),this.btnTools.classList.add("flipbook-has-tooltip")):(this.closeMenus(),this.toolsMenu.classList.remove("flipbook-hidden"),this.toolsMenuShowing=!0,this.btnTools.classList.add("flipbook-btn-active"),this.btnTools.classList.remove("flipbook-has-tooltip"))}togglePrintMenu(){var e=this;if(this.printMenu)this.printMenuShowing?(this.printMenu.style.display="none",this.printMenuShowing=!1):(this.closeMenus(),this.printMenu.style.display="block",this.printMenuShowing=!0,this.updateCurrentPage());else{this.printMenu=document.createElement("div"),this.printMenu.className="flipbook-sub-menu flipbook-font flipbook-border",this.wrapper.appendChild(this.printMenu);var t=document.createElement("div");t.className="flipbook-sub-menu-center",this.printMenu.appendChild(t);var i=document.createElement("div");i.className="flipbook-sub-menu-content skin-color-bg",t.appendChild(i),this.createMenuHeader(i,this.strings.print,this.togglePrintMenu.bind(this));var o=document.createElement("a");o.innerHTML='<div class="c-p skin-color flipbook-btn">'+this.strings.printCurrentPage+"</div>",i.appendChild(o),o.addEventListener("click",(function(){e.printPage(e.cPage[0],this)}));var s=document.createElement("a");s.innerHTML='<div class="c-l-p skin-color flipbook-btn">'+this.strings.printLeftPage+"</div>",i.appendChild(s),s.addEventListener("click",(function(){e.printPage(e.cPage[0],this)}));var n=document.createElement("a");n.innerHTML='<div class="c-r-p skin-color flipbook-btn">'+this.strings.printRightPage+"</div>",i.appendChild(n),n.addEventListener("click",(function(){e.printPage(e.cPage[1],this)}));var a=document.createElement("a");a.innerHTML='<div class="skin-color flipbook-btn">'+this.strings.printAllPages+"</div>",i.appendChild(a),a.addEventListener("click",(function(){e.togglePrintWindow()})),this.closeMenus(),this.printMenuShowing=!0,this.updateCurrentPage()}}toggleDownloadMenu(){}toggleShareMenu(){var e=this;if(!this.shareMenu.parentNode){this.btnShare.appendChild(this.shareMenu),this.shareMenu.addEventListener("click",(function(e){e.stopPropagation()})),document.addEventListener("click",(function(t){e.toolsMenuShowing&&e.toggleToolsMenu(),e.shareMenuShowing&&e.toggleShareMenu()}));var t=this.options,i=window.screen.width/2-300,o=window.screen.height/2-300;["facebook","twitter","pinterest","linkedin","whatsapp","digg","reddit","email","copyLink"].forEach((function(s){if(t[s].enabled){var n=document.createElement("span");n.className="flipbook-menu-btn-wrapper flipbook-has-tooltip",n.setAttribute("data-network",s),n.setAttribute("data-tooltip",t[s].title||t.strings[s]),n.style.width=`${t.btnSize}px`,n.style.height=`${t.btnSize}px`;let a=e.createSVGIcon(s);n.appendChild(a),e.shareMenu.appendChild(n),n.addEventListener("click",(function(s){s.preventDefault(),s.stopPropagation();var a=this.dataset.network;if("copyLink"==a){var r=t.shareUrl||window.location.href;try{r=decodeURIComponent(r)}catch(s){}function c(e){const i=document.createElement("textarea");i.value=e,i.style.position="fixed",document.body.appendChild(i),i.focus({preventScroll:!0}),i.select();try{document.execCommand ("copy"),n.setAttribute("data-tooltip",t.strings.copied),setTimeout((()=>{n.setAttribute("data-tooltip",t.strings.copyLink)}),2e3)}catch(e){console.error("Fallback: Unable to copy text",e)}document.body.removeChild(i)}navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(r).then((()=>{n.setAttribute("data-tooltip",t.strings.copied),setTimeout((()=>{n.setAttribute("data-tooltip",t.strings.copyLink)}),2e3)})).catch((e=>{console.error("Failed to copy the link: ",e)})):c(r),e.sendGAEvent({event:"flipbook_share",book_name:e.options.name,url:r,nonInteraction:!0})}else{var l,h=encodeURIComponent(t.shareTitle||t[a].description||"Check out this flipbook"),d=encodeURIComponent(t.shareUrl||window.location.href);encodeURIComponent(t.shareImage||"");switch(a){case"facebook":l="https://www.facebook.com/sharer.php?u="+d+"&t="+h;break;case"twitter":l="https://twitter.com/intent/tweet?text="+h+"&url="+d}window.open(l,"Share","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=600, top="+o+", left="+i),e.sendGAEvent({event:"flipbook_share",book_name:e.options.name,url:l,nonInteraction:!0})}}))}}))}this.shareMenuShowing?(this.shareMenu.classList.add("flipbook-hidden"),this.shareMenuShowing=!1,this.btnShare.classList.remove("flipbook-btn-active"),this.btnShare.classList.add("flipbook-has-tooltip")):(this.closeMenus(),this.shareMenu.classList.remove("flipbook-hidden"),this.shareMenuShowing=!0,this.btnShare.classList.add("flipbook-btn-active"),this.btnShare.classList.remove("flipbook-has-tooltip"),setTimeout((function(){e.shareMenu.style.right="0";const t=e.wrapper.getBoundingClientRect(),i=e.shareMenu.getBoundingClientRect();i.left<t.left&&(e.shareMenu.style.right=i.left-t.left-(t.width-i.width)/2+"px")}),0))}toggleNotesMenu(){}updateNoteSettings(e){this.options.noteTypes.forEach((function(t){t.id==e.id&&(t.enabled=e.enabled)})),this.noteService.updateNoteVisibility()}bookmarkPage(e){}removeBookmark(e){}isBookmarked(e){return this.getBookmarkedPages().indexOf(String(e))>0}getBookmarkedPages(){var e=localStorage.getItem(this.options.name+"_flipbook_bookmarks");return e?e.split(";"):[]}setBookmarkedPages(e){localStorage.setItem(this.options.name+"_flipbook_bookmarks",e.join(";"))}async bitmapToBlobUrl(e){if("undefined"!=typeof OffscreenCanvas){const t=new OffscreenCanvas(e.width,e.height);t.getContext("2d").drawImage(e,0,0);const i=await t.convertToBlob({type:"image/png"});if(e.close)try{e.close()}catch(e){}return URL.createObjectURL(i)}const t=document.createElement("canvas");t.width=e.width,t.height=e.height;t.getContext("2d").drawImage(e,0,0);const i=await new Promise((e=>t.toBlob(e,"image/png")));if(e.close)try{e.close()}catch(e){}return t.width=t.height=1,URL.createObjectURL(i)}async urlToBlobUrl(e){const t=await fetch(e,{mode:"cors"}),i=await t.blob();return URL.createObjectURL(i)}async printPage(e,t){const i=this.options.pages[e],o=this.options.pageTextureSize;if(!i)return;let s=null;const n=[];if(i.print)s=i.print;else if(i.src)s=i.src;else if(i.images&&i.images[o]){const e=i.images[o],t=e.currentSrc||e.src;t&&(s=t)}else if(i.imageBitmap&&i.imageBitmap[o]){const e=i.imageBitmap[o],t=await this.bitmapToBlobUrl(e);n.push(t),s=t}if(s)return this._printTempUrls||(this._printTempUrls=[]),this._printTempUrls.push(...n),void this.togglePrintWindow(s);const a=this.options.cover?e:e+1;this.loadPage(a,o,(()=>{this.printPage(e)}))}downloadPage(e){}printFile(e){if(window.self!==window.top)parent.postMessage({type:"print",url:e},"*");else try{var t=document.createElement("iframe");t.classList.add("flipbook-hidden"),t.src=e,document.body.appendChild(t),t.contentWindow.onload=function(){var e=this;setTimeout((function(){e.print()}),100)}}catch(e){}}togglePrintWindow(e){if(window.self!==window.top&&e)parent.postMessage({type:"print",url:e},"*");else{var t=this,i="";if(e)i=e;else{if(t.options.printPdfUrl)return void t.printFile(t.options.printPdfUrl);if(t.options.pdfUrl)return void t.printFile(t.options.pdfUrl)}!function(){var o=window.open("about:blank","_new");if(o.document.open(),e)i='<img src="'+e+'"/>\n';else for(var s=0;s<t.options.pages.length;s++)t.options.pages[s].src&&(i+='<img src="'+t.options.pages[s].src.toString()+'"/>\n');var n=function(e){return"<html>\n<head>\n<script>\nfunction step1(){\n  setTimeout('step2()', 10);\n}\nfunction step2(){\n  window.addEventListener('afterprint', function(){\n       debugger;\n       window.close();\n  });\n  window.print();\n}\n<\/script>\n<style>img {display:block;max-width:100%;page-break-after: always;}@media print header{display: none;}</style>\n</head>\n<body onLoad='step1()'>\n"+e+"</body>\n</html>\n"}(i);o.document.write(n),o.document.close()}()}}thumbsVertical(){this.thumbsCreated}isIOS(){return/iP(ad|hone|od)/.test(navigator.userAgent)}fakeScrollToHideToolbar(){if(!this.isIOS())return;const e=window.scrollX||window.pageXOffset,t=window.scrollY||window.pageYOffset;window.scrollTo(e,t+1),setTimeout((()=>{window.scrollTo(e,t)}),10)}fakeScrollToShowToolbar(){if(!this.isIOS())return;const e=window.scrollX||window.pageXOffset,t=window.scrollY||window.pageYOffset;window.scrollTo(e,t-1),setTimeout((()=>{window.scrollTo(e,t)}),10)}canFullscreen(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}requestFullscreen(e){const t=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];for(const i of t)if(e[i])try{return void e[i]()}catch(e){return void this.handleFullscreenError(e)}this.handleFullscreenError(new Error("Fullscreen API is not supported on this element."))}exitFullscreen(){const e=["exitFullscreen","mozCancelFullScreen","webkitExitFullscreen","msExitFullscreen"];for(const t of e)if(document[t])try{return void document[t]()}catch(e){return void this.handleFullscreenError(e)}this.handleFullscreenError(new Error("Exiting fullscreen API is not supported in this document."))}toggleExpand (){const e=this.fullscreenElement;try{document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?this.exitFullscreen():this.requestFullscreen(e)}catch(e){this.handleFullscreenError(e)}this.toolsMenuShowing&&this.toggleToolsMenu()}handleFullscreenError(e){const t=this.fullscreenElement;this.fullscreenActive=!this.fullscreenActive;window.self!==window.top?parent.postMessage({type:"toggleExpand",fullscreenActive:this.fullscreenActive},"*"):this.fullscreenActive?t!==document.body&&(this.saveScrollPosition(),document.body.classList.add("flipbook-overflow-hidden"),t.classList.add("flipbook-browser-fullscreen"),this.elemParent=t.parentNode,document.body.appendChild(t)):this.elemParent&&(this.elemParent.appendChild(t),this.elemParent=null,document.body.classList.remove("flipbook-overflow-hidden"),t.classList.remove("flipbook-browser-fullscreen"),this.restoreScrollPosition()),this.toggleIcon(this.btnExpand,!this.fullscreenActive)}saveScrollPosition(){document.body.dataset.flipbookScrollX=window.scrollX||window.pageXOffset,document.body.dataset.flipbookScrollY=window.scrollY||window.pageYOffset}restoreScrollPosition(){const e=parseInt(document.body.dataset.flipbookScrollX||0,10),t=parseInt(document.body.dataset.flipbookScrollY||0,10);isNaN(e)||isNaN(t)||(window.scrollTo(e,t),delete document.body.dataset.flipbookScrollX,delete document.body.dataset.flipbookScrollY)}expand (){}toggleSinglePage(){}toggleAutoplay(e){}},FLIPBOOK.Book=class{constructor(e,t){this.rightIndex=0,this.options=t,this.main=e,this.pageWidth=t.pageWidth,this.pageHeight=t.pageHeight,this.singlePage=t.singlePageMode;const i=t.pages;let o=Math.ceil(i.length/2);t.singlePageMode?o=i.length:t.cover||i.length%2!=0||(o+=1),this.numSheets=o}goToPage(){}getRightIndex(){}getPageHeight(){this.bookWidth;return 10}canFlipNext(){return this.flippedright>0&&((!this.singlePage||1!=this.flippedright)&&(!(1!=this.view||!this.isFocusedLeft||!this.isFocusedLeft())||!(1==this.flippedright&&!this.options.rightToLeft&&!this.options.backCover)&&!(1==this.flippedright&&this.options.rightToLeft&&!this.options.cover)))}canFlipPrev(){const e=this.options.cover?0:1;return this.flippedleft>e&&(!(1!=this.view||!this.isFocusedRight||!this.isFocusedRight())||!(1==this.flippedleft&&this.options.rightToLeft&&!this.options.backCover))}getCurrentPageNumber(){var e=this.rightIndex%2==1?this.rightIndex+1:this.rightIndex;return this.options.rightToLeft?(e=this.options.pages.length-e,this.isFocusedRight()?e:e+1):this.isFocusedLeft()?e:e+1}async startPageItems(e){if(!e)return;const t=e.querySelectorAll(".flipbook-page-item"),i=e.querySelectorAll(".flipbook-page-item-youtube");e.dataset.pageItemsStarted?t.forEach((e=>{if("VIDEO"!==e.nodeName&&"AUDIO"!==e.nodeName||e.autoplay&&(e.dataset.autoplayResume||(e.currentTime=0),e.play().catch((()=>{}))),e.player&&"true"===e.dataset.autoplayResume){const t=()=>{try{const t=parseFloat(e.dataset.ytCurrentTime)||0;e.player.seekTo(t,!0),e.player.playVideo(),"false"===e.dataset.ytMuted&&e.player.unMute()}catch(e){console.error("Error resuming video:",e)}};try{e.player.addEventListener("onReady",t)}catch{}const i=setInterval((()=>{try{"function"==typeof e.player.getPlayerState&&-1!==e.player.getPlayerState()&&(clearInterval(i),t())}catch(e){}}),200);setTimeout((()=>clearInterval(i)),1e4)}})):(t.forEach((function(e){if("VIDEO"===e.nodeName||"AUDIO"===e.nodeName){const t=e.getAttribute("data-url");if(!t)return;const i=e.querySelector("source")||document.createElement("source");if(i.setAttribute("src",t),i.parentNode||e.appendChild(i),e.load(),"AUDIO"!==e.nodeName||e.controls||(e.style.visibility="hidden"),e.autoplay||e.controls){const t=()=>{e.currentTime>=e.duration&&e.duration>0&&e.load(),e.autoplay&&e.play().catch((()=>{}))};e.readyState<4?e.oncanplay=t:t()}}})),await this.waitForYouTubeAPI(),this.initYouTubePlayers(i),e.dataset.pageItemsStarted="true")}waitForYouTubeAPI(){return new Promise((e=>{if(window.YT&&YT.Player)e();else{const t=setInterval((()=>{window.YT&&YT.Player&&(clearInterval(t),e())}),100);"function"!=typeof window.onYouTubeIframeAPIReady&&(window.onYouTubeIframeAPIReady=()=>{clearInterval(t),e()})}}))}initYouTubePlayers(e){e.forEach((e=>{const t=e.dataset.videoId,i="true"===e.dataset.autoplay,o=(e.dataset.autoplayResume,"true"===e.dataset.controls),s="true"===e.dataset.loop,n="true"===e.dataset.muted,a=e.playerIframe||document.createElement("div");a.id="yt-"+Math.random(),a.className="r3d-yt-iframe",this.main.youtubes=this.main.youtubes||[],this.main.youtubes.push(e),e.playerIframe=a,e.appendChild(a),e.player&&"function"==typeof e.player.getPlayerState&&i&&e.player.playVideo();const r={enablejsapi:1,origin:window.location.origin,controls:o?1:0,rel:0,playsinline:1,fs:1};s&&(r.loop=1,r.playlist=t);const l=new YT.Player(a.id,{videoId:t,playerVars:r,events:{onReady:t=>{const o=t.target;e.player=o,(i||n)&&o.mute(),this.options.backgroundMusic&&(o.playVideo(),1===o.getPlayerState()&&this.pauseGlobalSound()),i&&o.playVideo()},onStateChange:e=>{e.data===YT.PlayerState.PLAYING&&this.options.backgroundMusic&&this.pauseGlobalSound()}}});e.player=l}))}loadPageAsync(e,t){if(!e)return Promise.resolve();e._sidePromises||(e._sidePromises={}),e._sidePromises[t]||(e._sidePromises[t]={});const i=this.options,{pageTextureSize:o,pageTextureSizeSmall:s,pdfMode:n}=i,{wrapperW:a,wrapperH:r,pageW:l,pageH:h,zoom:d}=this.main,c=(this.view,this.bookWidth||2),p=[...i.l];let u=n?(l*c/h<a/r?r*d:a*d*h/(l*c))<.9*s?s:o:2e3;l>h&&(u*=l/h),this.currentPageTextureSize=u;const{s:g,d:m}=i,b=m?m[p[0][p[3]]*p[2][[p[3]]]]%p[1][p[3]]:0;return e._sidePromises[t][u]||(e._sidePromises[t][u]=new Promise(((i,o)=>{!t||g||b?i():e[p[0]](t,u,(()=>{i()}))}))),e._sidePromises[t][u]}loadHTMLAsync(e,t){return e?(e._sideHTMLPromises||(e._sideHTMLPromises={}),e._sideHTMLPromises[t]||(e._sideHTMLPromises[t]=new Promise((i=>{t?e.loadHTML(t,(()=>{i()})):i()}))),e._sideHTMLPromises[t]):Promise.resolve()}pageLoaded(e,t){e&&e.loaded(t)}destroy(){}},FLIPBOOK.Notes=class{constructor(e){const t=this;this.main=e,this.notes=Object.values(e.options.notes||[]),this.textSelectionRect=document.createElement("span"),this.textSelectionRect.className="flipbook-add-note-rect hover";const i=document.createElement("span");i.className="add-note-btn",i.innerText=e.options.strings.addNote,i.onclick=function(){t.hideButton(),t.createNote()},i.onmousedown=function(){},this.noteButton=i,this.textSelectionRect.appendChild(i),this.hideButton(),this.notePopup=document.createElement("div"),this.notePopup.className="flipbook-note-display",this.notePopup.innerHTML='<div class="note-content"><textarea role="textbox" maxlength="500" placeholder="'+e.options.strings.typeInYourNote+'" tabindex="0" class="note-article"></textarea></div> <div  aria-hidden="true" class="note-footer"> <span title="Delete Note" class="icon icon-trash-can note-button note-delete-button"><svg version="1.1" viewBox="0 0 24 24" class="svg-icon svg-fill" focusable="false"><path pid="0" d="M15.976 17.862c0 .607-.414 1.138-.885 1.138H8.893c-.47 0-.869-.513-.869-1.12L8.002 8H16l-.023 9.862zM20 6h-5V4.466C15 3.66 14.853 3 14.013 3h-3.858C9.315 3 9 3.659 9 4.466V6H4v2h2v10c0 1.843 1.153 3 2.893 3h6.198C16.84 21 18 19.852 18 18V8h2V6z"></path><path pid="1" d="M13 18h1V9h-1zM10 18h1V9h-1z"></path></svg></span></div>',this.notePopup.onmouseup=function(e){e.stopPropagation()},this.noteDelete=this.notePopup.getElementsByClassName("note-delete-button")[0],this.noteDelete.onclick=function(){t.deleteNote()},this.noteInput=this.notePopup.querySelectorAll("textarea")[0],this.noteInput.onchange=function(){const e=this.dataset.note,i=this.value;t.getNoteById(e).text=i,t.main.trigger("r3d-update-note",{note:t.getNoteById(e)})},this.updateNoteVisibility()}initPageNotes(e){const t=this;this.notes.forEach((function(i){i.page==e.index+1&&t.addPageNote(i,e)})),this.addPageNoteListeners(e)}getNodeColor(e){let t="green";return this.main.options.noteTypes.forEach((function(i){i.id==e.type&&(t=i.color)})),t}updateNoteVisibility(){let e=document.documentElement;this.main.options.noteTypes.forEach((function(t){e.style.setProperty(`--note-${t.id}-opacity`,t.enabled?"1":"0"),e.style.setProperty(`--note-${t.id}-pointer-events`,t.enabled?"auto":"none")}))}addPageNote(e){}showButton(){this.noteButton.classList.remove("flipbook-hidden")}hideButton(){this.noteButton.classList.add("flipbook-hidden")}showNote(e,t,i){const o=t.htmlContent.getBoundingClientRect(),s=e.getBoundingClientRect(),n=this.getNoteById(i);jQuery(t.htmlContent)[0].appendChild(this.notePopup);const a=this.main,r=a.Book.sc*a.wrapperH/1e3,l=(s.y/a.zoom-o.y/a.zoom)/r;this.notePopup.style.top=l<150?l+40+"px":l-140+"px",this.notePopup.style.left=(s.x/a.zoom+.5*s.width/a.zoom-o.x/a.zoom)/r+"px",this.noteInput.value=n.text||"",this.noteInput.dataset.note=n.id,this.activeNote=n,n.readonly?this.disableNoteEdit():this.enableNoteEdit()}enableNoteEdit(){this.noteDelete.classList.remove("flipbook-hidden"),this.noteInput.readOnly=!1}disableNoteEdit(){this.noteDelete.classList.add("flipbook-hidden"),this.noteInput.readOnly=!0}hideNote(){this.notePopup.parentNode&&this.notePopup.parentNode.removeChild(this.notePopup),this.activeNote=null}createNote(){this.textSelectionRect.appendChild(this.notePopup),this.notePopup.style.left="50%",this.textSelectionRect.offsetTop<150?this.notePopup.style.top="40px":this.notePopup.style.top="-140px",this.noteInput.value="",this.noteInput.focus();const e={selectedText:this.selectedTextString,page:this.selectedTextPageNumber,type:1};this.notes.push(e),this.addPageNote(e),this.noteInput.dataset.note=e.id,this.addPageNoteListeners(this.main.options.pages[e.page-1]),this.activeNote=e,this.enableNoteEdit(),this.main.trigger("r3d-update-note",{note:e})}deleteNote(){const e=this.main.options.pages[this.activeNote.page-1];jQuery(e.htmlContent).find(".textLayer").unmark({className:`flipbook-note-${this.activeNote.id}`});const t=this.notes.indexOf(this.activeNote);t>-1&&this.notes.splice(t,1),this.hideNote(),this.main.trigger("r3d-delete-note",{note:this.activeNote})}getNoteById(e){let t=null;return this.notes.forEach((function(i){Number(i.id)==Number(e)&&(t=i)})),t}removeTextRect(){this.textSelectionRect.parentNode&&this.textSelectionRect.parentNode.removeChild(this.textSelectionRect)}addPageNoteListeners(e){const t=this;e.textLayerDiv&&!e.notesInitialized&&(e.textLayerDiv.addEventListener("mouseup",(function(e){if(!e.target.classList.contains("add-note-btn"))if(t.hideNote(),t.showButton(),t.selectedText=window.getSelection(),t.selectedText.toString()){t.selectedTextString=t.selectedText.toString(),t.selectedTextPageNumber=Number(this.dataset.pageNumber),t.selectedTextRange=t.selectedText.getRangeAt(0);const e=t.selectedTextRange.getBoundingClientRect(),i=this.getBoundingClientRect(),o=t.main;let s=o.Book.sc*o.wrapperH/1e3;t.textSelectionRect.style.top=(e.y/o.zoom-i.y/o.zoom)/s+"px",t.textSelectionRect.style.left=(e.x/o.zoom-i.x/o.zoom)/s+"px",t.textSelectionRect.style.width=e.width/o.zoom/s+"px",t.textSelectionRect.style.height=e.height/o.zoom/s+"px",this.appendChild(t.textSelectionRect)}else t.removeTextRect()})),e.textLayerDiv.addEventListener("mousemove",(function(e){if(t.selectedTextRange&&t.selectedText.toString()){const i=t.textSelectionRect.getBoundingClientRect(),o=t.textSelectionRect.firstChild.getBoundingClientRect();e.clientX>=i.left&&e.clientX<=i.right&&e.clientY>=o.top&&e.clientY<=i.bottom?t.showButton():t.hideButton()}})),e.notesInitialized=!0)}},FLIPBOOK.Tooltip=class{constructor(){this.domElement=document.createElement("div"),this.domElement.className="flipbook-tooltip flipbook-noselect",this.domElement.classList.add("flipbook-hidden");const e=this;this.currentPosition={x:0,y:0},document.addEventListener("scroll",(function(){e.position()}))}show(e){this.showing||(this.domElement.classList.remove("flipbook-hidden"),this.showing=!0,e.text&&(this.domElement.innerText=e.text),e.parent&&e.parent.appendChild(this.domElement),e.onClick?(this.domElement.style.cursor="pointer",this.domElement.onclick=e.onClick):(this.domElement.style.cursor="auto",this.domElement.removeAttribute("onclick")),this.currentPosition=e.position,this.position())}hide(){this.showing&&(this.domElement.classList.add("flipbook-hidden"),this.showing=!1)}position(){const e=this.domElement.parentNode.getBoundingClientRect();this.domElement.style.top=this.currentPosition.y-e.top-scrollY+"px",this.domElement.style.left=this.currentPosition.x-e.left-scrollX+"px"}},FLIPBOOK.ProgressBar=class{constructor(e={}){this.value=e.value||0,this.min=e.min||0,this.max=e.max||100,this.onChange=e.onChange||function(e){},this.colors=e.colors||{},this.wrapper=e.wrapper||document.body,this.el=null,this._dragging=!1,this._render(),this.setValue(this.value),this._bindEvents()}_render(){const e=document.createElement("div");e.className="flipbook-progress-bar",e.tabIndex=0,this.colors.bg&&e.style.setProperty("--progress-bg",this.colors.bg),this.colors.fill&&e.style.setProperty("--progress-fill",this.colors.fill),this.colors.thumb&&e.style.setProperty("--progress-thumb",this.colors.thumb),this.colors.thumbBorder&&e.style.setProperty("--progress-thumb-border",this.colors.thumbBorder),e.innerHTML=`\n      <div class="progress-track"></div>\n      <div class="progress-filled"></div>\n      <div class="progress-thumb" tabindex="0" role="slider" aria-valuenow="0" aria-valuemin="${this.min}" aria-valuemax="${this.max}"></div>\n    `,this.wrapper.appendChild(e),this.el=e,this.track=e.querySelector(".progress-track"),this.filled=e.querySelector(".progress-filled"),this.thumb=e.querySelector(".progress-thumb")}_bindEvents(){this.thumb.addEventListener("mousedown",this._startDrag.bind(this)),this.el.addEventListener("mousedown",this._startDrag.bind(this)),window.addEventListener("mousemove",this._onDrag.bind(this)),window.addEventListener("mouseup",this._endDrag.bind(this)),this.thumb.addEventListener("touchstart",this._startDrag.bind(this),{passive:!1}),this.el.addEventListener("touchstart",this._startDrag.bind(this),{passive:!1}),window.addEventListener("touchmove",this._onDrag.bind(this),{passive:!1}),window.addEventListener("touchend",this._endDrag.bind(this)),this.thumb.addEventListener("keydown",(e=>{let t=(this.max-this.min)/100||1;"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(this.setValue(this.value+t),e.preventDefault()),"ArrowLeft"!==e.key&&"ArrowDown"!==e.key||(this.setValue(this.value-t),e.preventDefault())}))}_startDrag(e){"mousedown"===e.type&&0!==e.button||(this._dragging=!0,document.body.style.userSelect="none",this._onDrag(e))}_onDrag(e){if(!this._dragging)return;let t;t=e.touches?e.touches[0].clientX:e.clientX;const i=this.el.getBoundingClientRect();let o=(t-i.left)/i.width*100,s=this.min+(this.max-this.min)*(o/100);this.setValue(s)}_endDrag(){this._dragging&&(this._dragging=!1,document.body.style.userSelect="")}setValue(e){e=Math.max(this.min,Math.min(this.max,e)),this.value=e;let t=(e-this.min)/(this.max-this.min)*100;this.filled.style.width=t+"%",this.thumb.style.left=t+"%",this.thumb.setAttribute("aria-valuenow",Math.round(e)),this.onChange(e)}getValue(){return this.value}},FLIPBOOK.Thumbnails=class{constructor(e){const t=e.options,i=e.wrapper;this.main=e,this.options=t,this.wrapper=i,this.active=null,this.thumbHolder=document.createElement("div"),this.thumbHolder.className="flipbook-thumbHolder flipbook-side-menu skin-color-bg flipbook-border",i.appendChild(this.thumbHolder),this.thumbHolder.style[t.sideMenuPosition]="0",this.thumbHolder.classList.add("flipbook-hidden"),e.createMenuHeader(this.thumbHolder,e.strings.thumbnails,e.toggleThumbs),this.bookmark=document.createElement("div"),this.bookmark.className="flipbook-font",this.thumbHolder.appendChild(this.bookmark),this.bookmark.classList.add("flipbook-hidden");const o=document.createElement("a");o.innerHTML='<div class="c-p skin-color flipbook-btn">'+t.strings.bookmarkCurrentPage+"</div>",this.bookmark.appendChild(o),o.addEventListener("click",(function(t){e.bookmarkPage(e.cPage[0],this),t.preventDefault(),t.stopPropagation()}));const s=document.createElement("a");s.innerHTML='<div class="c-l-p skin-color flipbook-btn">'+t.strings.bookmarkLeftPage+"</div>",this.bookmark.appendChild(s),s.addEventListener("click",(function(t){e.bookmarkPage(e.cPage[0],this),t.preventDefault(),t.stopPropagation()}));const n=document.createElement("a");n.innerHTML='<div class="c-r-p skin-color flipbook-btn">'+t.strings.bookmarkRightPage+"</div>",this.bookmark.appendChild(n),n.addEventListener("click",(function(t){e.bookmarkPage(e.cPage[1],this),t.preventDefault(),t.stopPropagation()})),this.search=document.createElement("div"),this.search.className="flipbook-search",this.thumbHolder.appendChild(this.search),this.search.classList.add("flipbook-hidden"),this.searchBar=document.createElement("div"),this.searchBar.className="flipbook-findbar",this.search.appendChild(this.searchBar),this.findInputCotainer=document.createElement("div"),this.findInputCotainer.id="findbarInputContainer",this.searchBar.appendChild(this.findInputCotainer),this.findInput=document.createElement("input"),this.findInput.className="toolbarField skin-color skin-color-bg",this.findInput.title="Find",this.findInput.autocapitalize="none",this.findInput.placeholder=`${t.strings.findInDocument}...`,this.findInputCotainer.appendChild(this.findInput),this.clearInput=document.createElement("span"),this.clearInput.className="flipbook-search-clear flipbook-hidden skin-color skin-color-bg",this.clearInput.appendChild(e.createSVGIcon("close")),this.clearInput.addEventListener("click",(()=>{this.findInput.value="",this.hideAllThumbs(),this.clearSearchResults(),e.unmark(),e.searchingString="",this.clearInput.classList.add("flipbook-hidden"),this.findInput.focus({preventScroll:!0})})),this.findInputCotainer.appendChild(this.clearInput),this.thumbsWrapper=document.createElement("div"),this.thumbsWrapper.className="flipbook-thumbsWrapper",this.thumbHolder.appendChild(this.thumbsWrapper),this.closeGrid=document.createElement("div"),this.closeGrid.className="flipbook-thumbs-grid-close skin-color flipbook-menu-btn",this.thumbsWrapper.appendChild(this.closeGrid),this.closeGrid.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault(),this.main.closeMenus()})),this.closeGrid.appendChild(this.main.createSVGIcon("close")),this.thumbsScroller=document.createElement("div"),this.thumbsScroller.className="flipbook-thumbsScroller skin-color",this.thumbsWrapper.appendChild(this.thumbsScroller),this.findInput.addEventListener("keyup",(e=>{const t=e.currentTarget.value;this.searchString(t)})),this.thumbs=[],this.isOverlayMode="overlay"===t.thumbsStyle;const a=t.thumbSize,r=a*t.pageWidth/t.pageHeight;this.main.wrapper.style.setProperty("--flipbook-thumbs-spread-width",2*r+"px");const l=new IntersectionObserver((e=>{e.forEach((e=>{if(!e.isIntersecting)return;const t=e.target;"function"==typeof t.instance.load&&t.instance.load(),l.unobserve(t)}))}),{root:this.thumbHolder,rootMargin:"200px 0px",threshold:.01});for(let i=0;i<t.pages.length;i++){const o=new FLIPBOOK.Thumbnail(i,r,a,e,t,this);o.el.instance=o,l.observe(o.el)}this.coverSpacer=document.createElement("div"),this.coverSpacer.style.width=r+"px",this.coverSpacer.style.height=a+"px",this.coverSpacer.style.display="inline-block",this.backCoverSpacer=document.createElement("div"),this.backCoverSpacer.style.width=r+"px",this.backCoverSpacer.style.height=a+"px",this.backCoverSpacer.style.display="inline-block",this.isOverlayMode&&(this.createSpreads(),this.showSpreads()),this.main.on("pagechange",(()=>{this.updateCurrentPages()}))}createSpreads(){let e;const{pages:t,cover:i,backCover:o}=this.options;this.spreads=[];const s=t.length-(i?1:0)-(o?1:0);e=(i?1:0)+(o?1:0)+Math.ceil(Math.max(0,s)/2);const n=document.createDocumentFragment();for(let t=0;t<e;t++){const s=document.createElement("div");this.spreads.push(s),s.classList.add("flipbook-thumb-spread"),i&&0===t&&s.classList.add("flipbook-thumb-spread-cover"),o&&t===e-1&&s.classList.add("flipbook-thumb-spread-back-cover");const a=2*t,r=2*t+1;s.dataset.pages=String(a)+","+String(r),n.appendChild(s)}this.thumbsScroller.appendChild(n)}showSpreads(){for(let e=0;e<this.spreads.length;e++){const t=this.spreads[e];t.style.display="";const i=2*e,o=2*e+1;this.thumbs[i-1]?t.appendChild(this.thumbs[i-1]):t.appendChild(this.coverSpacer),this.thumbs[o-1]?t.appendChild(this.thumbs[o-1]):t.appendChild(this.backCoverSpacer)}this.spreadsShowing=!0}showSingles(){for(let e=0;e<this.thumbs.length;e++)this.thumbsScroller.appendChild(this.thumbs[e]);this.hideSpreads()}hideSpreads(){if(this.spreads){for(let e=0;e<this.spreads.length;e++)this.spreads[e].style.display="none";this.spreadsShowing=!1}}findInPageAsync(e,t,i){return new Promise((o=>{e.findInPage(t,i,((e,t,i,s)=>{o({matches:e,htmlContent:t,index:i,pageText:s})}))}))}searchString(e){e?this.clearInput.classList.remove("flipbook-hidden"):this.clearInput.classList.add("flipbook-hidden"),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((async()=>{const t=this.main,i=t.pdfService;if(""!==e){const o=t.options;let s=0;if(this.hideAllThumbs(),this.clearSearchResults(),this.pagesFound=0,t.unmark(),t.searchingString=e,i){let s=0;for(let n=0;n<i.info.numPages&&e===t.searchingString;n++){const{matches:a,index:r,pageText:l}=await this.findInPageAsync(i,e,n);if(a&&a.length>0){const i=0===this.pagesFound;this.pagesFound++,s+=a.length,t.mark(e),o.searchResultsThumbs?this.showThumb(r):this.showSearchResults(a.length,r,l,i)}}}else o.pagesOriginal.forEach(((i,n)=>{const a=n;o.cover||n++;let r=n;o.doublePage&&(r*=2),o.doublePage&&r===2*o.pagesOriginal.length-2&&r--,t.loadPageHTML(r,(i=>{const o=new RegExp(t.searchingString.toUpperCase().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),n=(i.innerText.toUpperCase().match(o)||[]).length;if(n>0){s+=n;const o=0==this.pagesFound;this.showSearchResults(n,a,i.innerText.substring(0,60)+"...",o),this.pagesFound++,t.mark(e)}}))}))}else this.hideAllThumbs(),this.clearSearchResults(),this.main.unmark(),this.main.searchingString=e,this.clearInput.classList.add("flipbook-hidden")}))}getThumbIndexForPage(e){return e}loadVisibleThumbs(){}getThumbFromPdf(e,t,i){const o=document.createElement("canvas");return this.main.pdfService.pdfDocument.getPage(e).then((e=>{const s=e.getViewport({scale:1}),n=this.options.thumbSize/s.height;let a=0,r=n*s.width;this.options.doublePage&&(t||i)&&(r=n*s.width/2,i&&(a=-r));const l=e.getViewport({scale:n,offsetX:a}),h=o.getContext("2d");o.height=l.height,o.width=r;const d={canvasContext:h,viewport:l};e.cleanupAfterRender=!0;e.render(d).promise.then((function(){e.cleanup()}))})),o}showAllThumbs(){for(let e=0;e<this.thumbs.length;e++)this.thumbs[e].classList.remove("flipbook-hidden");this.isOverlayMode&&this.showSpreads(),this.clearSearchResults()}hideAllThumbs(){for(let e=0;e<this.thumbs.length;e++)this.thumbs[e].classList.add("flipbook-hidden")}clearSearchResults(){const e=this.thumbsScroller.querySelectorAll(".flipbook-search-match");for(let t=0;t<e.length;t++)e[t].remove()}showSearchResults(e,t,i,o){const{main:s,options:n,findInput:a}=this,{doublePage:r,strings:l}=s.options;let h,d=t;const c=n.pages.length;if(r&&t>0){d=2*t-1;const e=d+1;h=e<c?`${d+1}-${e+1}`:String(d+1)}else h=String(t+1);const p=document.createElement("div");p.className="flipbook-search-match",p.dataset.page=d+1,p.style.order=d;const u=1===e?l.match:l.matches;p.innerHTML=`\n        <div class="flipbook-search-match-title">\n            <span style="float:left"><strong>${l.page} ${h}</strong></span>\n            <span style="float:right">${e} ${u}</span>\n        </div>\n        <div class="flipbook-search-match-text">${i}</div>\n    `,p.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault();const t=Number(p.dataset.page);s.goToPage(t)})),o&&(s.goToPage(d+1,!0),setTimeout((()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),50),a.focus()),this.thumbsScroller.appendChild(p),this.hideSpreads()}showThumb(e){const t=this.thumbs[e];t&&t.classList.remove("flipbook-hidden")}hideThumb(e){const t=this.thumbs[e];t&&t.classList.add("flipbook-hidden")}showeCloseButtons(e=!0){const t=e?"remove":"add";for(let e=0;e<this.thumbs.length;e++){const i=this.thumbs[e].querySelector(".thumb-btn-close");i&&i.classList[t]("flipbook-hidden")}}showBookmarks(){this.showeCloseButtons(!0),this.showBookmarkedThumbs(),this.clearSearchResults(),this.bookmark.classList.remove("flipbook-hidden"),this.setTitle(this.options.strings.bookmarks),this.main.updateCurrentPage(),this.active="bookmarks",this.thumbHolder.classList.remove("flipbook-thumbs-grid")}showSearch(){this.clearSearchResults(),this.hideAllThumbs(),this.search.classList.remove("flipbook-hidden"),this.showeCloseButtons(!1),this.setTitle(this.options.strings.search),this.findInput.value="",this.clearInput.classList.add("flipbook-hidden"),this.findInput.focus({preventScroll:!0}),this.active="search",this.thumbHolder.classList.remove("flipbook-thumbs-grid")}showBookmarkedThumbs(){const e=this.main.getBookmarkedPages();this.hideAllThumbs(),this.showSingles();for(let t=0;t<e.length;t++){const i=e[t];if(i){const e=this.getThumbIndexForPage(i);this.showThumb(e)}}}show(){this.setTitle(this.options.strings.thumbnails),this.bookmark.classList.add("flipbook-hidden"),this.search.classList.add("flipbook-hidden"),this.thumbHolder.classList.remove("flipbook-hidden"),this.main.thumbsVertical(),this.showAllThumbs(),this.showeCloseButtons(!1),this.loadVisibleThumbs(),this.main.resize(),this.active="thumbs","overlay"===this.main.options.thumbsStyle&&(this.thumbHolder.classList.add("flipbook-thumbs-grid"),this.options.rightToLeft&&(this.thumbsScroller.style.direction="rtl")),this.updateCurrentPages()}hide(){this.thumbHolder.classList.add("flipbook-hidden"),this.main.resize(),this.active=null}setTitle(e){const t=this.thumbHolder.querySelector(".flipbook-menu-title");t&&(t.textContent=e)}updateCurrentPages(){if(!this.active)return;if(!this.thumbsByPage){this.thumbsByPage=new Map;for(let e=0;e<this.thumbs.length;e++){const t=this.thumbs[e],i=t.getAttribute("data-pages");if(!i)continue;const o=i.split(",");for(let e=0;e<o.length;e++){const i=Number(o[e]);Number.isFinite(i)&&this.thumbsByPage.set(i,t)}}}const e=this.prevActive||new Set,t=(this.main?.currentPageValue??"").toString().trim();if(!t)return;const i=new Set(t.split("-").map((e=>Number(e))).filter(Number.isFinite)),o=new Set([...e,...i]);for(const e of o){const t=this.thumbsByPage.get(e);t&&t.classList.toggle("flipbook-thumb-active",i.has(e))}const s=this.thumbsScroller.querySelector(".flipbook-thumb-active");if(s){const e=this.thumbsWrapper,t=e.getBoundingClientRect(),i=s.getBoundingClientRect(),o=100,n=i.top-t.top-o,a=i.left-t.left-o;e.scrollTo({top:e.scrollTop+n,left:e.scrollLeft+a,behavior:"smooth"})}this.prevActive=i}},FLIPBOOK.Thumbnail=class{constructor(e,t,i,o,s,n){this.thumbs=n;const a=document.createElement("div");this.el=a;const r=e%2==1?"left":"right";a.className="flipbook-thumb flipbook-thumb-"+r;const l=s.pages[e];a.setAttribute("data-thumb-index",e),a.style.height=i+"px",a.style.width=t+"px";const h=document.createElement("span");h.className="thumb-btn-close skin-color skin-color-bg",a.appendChild(h),h.addEventListener("click",(function(e){e.stopPropagation(),e.preventDefault(),o.removeBookmark(a.getAttribute("data-thumb-index"))})),h.appendChild(o.createSVGIcon("close")),n.thumbs.push(a);let d=s.pages.length%2==0;const c=0===e;let p=d&&e===s.pages.length-1,u=!1;s.doublePage&&(d=s.backCover,p=d&&e===s.pages.length-1,u=!c&&!p);let g=!1,m=!1,b=e+1;s.doublePage&&(b=Math.ceil(e/2)+1),g=!c&&e%2==1&&!p,m=!c&&e%2==0&&!p,this.isLeft=g,this.isRight=m,this.pdfPageIndex=b,this.isDouble=u,this.pdfMode=s.pdfMode,this.thumbSrc=l.thumb,this.height=i;const f=e+1;a.setAttribute("data-page",f);let v=f.toString();s.pages[e]&&s.pages[e].name&&(v=s.pages[e].name);const k=v,w=document.createElement("span");w.textContent=v,w.className="skin-color flipbook-thumb-num",a.appendChild(w),a.setAttribute("data-pages",k),"overlay"===s.thumbsStyle&&(s.thumbsCloseOnClick=!0),a.addEventListener("click",(e=>{let t;e.stopPropagation(),e.preventDefault();const i=e.currentTarget.getAttribute("data-pages");if(i&&-1!==i.indexOf(",")){const e=i.split(","),o=Number(e[0]),n=Number(e[1]);t=s.rightToLeft?n:o}else t=Number(i||e.currentTarget.getAttribute("data-page"));(!Number.isFinite(t)||t<1)&&(t=1),o.goToPage(t),"search"!==n.active&&s.thumbsCloseOnClick&&o.toggleThumbs(!1)}))}load(){if(this.loaded)return;this.loaded=!0;let e=document.createElement("img");if(this.pdfMode)e=this.thumbs.getThumbFromPdf(this.pdfPageIndex,this.isLeft,this.isRight);else{if(!this.thumbSrc)return;e.src=this.thumbSrc,this.isRight&&this.isDouble&&(e.style.marginLeft="-100%")}this.el.appendChild(e),e.style.height=this.height+"px"}},FLIPBOOK.Lightbox=class{constructor(e,t,i){this.context=e,this.options=i,this.$document=document,this.$body=document.body,this.$html=document.documentElement,this.$window=window,this.overlay=document.createElement("div"),this.overlay.className="flipbook-overlay",this.overlay.classList.add("flipbook-hidden"),this.overlay.style.top=this.options.lightboxMarginV,this.overlay.style.bottom=this.options.lightboxMarginV,this.overlay.style.left=this.options.lightboxMarginH,this.overlay.style.right=this.options.lightboxMarginH,Object.assign(this.overlay.style,i.lightboxCSS),document.body.appendChild(this.overlay),i.lightboxBackground&&(this.overlay.style.background=i.lightboxBackground),i.lightboxBackgroundColor&&(this.overlay.style.background=i.lightboxBackgroundColor),i.lightboxBackgroundPattern&&(this.overlay.style.background="url("+i.lightboxBackgroundPattern+") repeat"),i.lightboxBackgroundImage&&(this.overlay.style.background="url("+i.lightboxBackgroundImage+") no-repeat",this.overlay.style.backgroundSize="cover",this.overlay.style.backgroundPosition="center center"),document.addEventListener("keydown",(e=>{"Escape"===e.key&&this.closeLightbox()})),this.wrapper=document.createElement("div"),this.wrapper.style.height="auto",this.wrapper.className="flipbook-wrapper-transparent",this.wrapper.style.margin="0px auto",this.wrapper.style.padding="0px",this.wrapper.style.height="100%",this.wrapper.style.width="100%",this.overlay.appendChild(this.wrapper),this.wrapper.appendChild(t);var o=document.createElement("div");o.className="flipbook-lightbox-toolbar",this.wrapper.appendChild(o)}openLightbox(){if(this.lightboxOpened)return;this.lightboxOpened=!0,this.showOverlay();const e=new Event("r3d-lightboxopen");window.dispatchEvent(e),this.options.deeplinkingEnabled||(window.history.pushState(null,"",window.location.href),this.context.historyStateChange()),this.context.options.password&&!this.context.pdfinitStarted&&this.context.initialized&&this.context.initPdf()}showOverlay(){if(!this.overlay||!this.$html)return;const e=this.overlay;e.classList.remove("flipbook-hidden"),e.classList.add("flipbook-overlay-visible"),this.context.saveScrollPosition(),document.body.classList.add("flipbook-overflow-hidden"),this.$html.classList.add("flipbook-overflow-hidden")}hideOverlay(){if(!this.overlay||!this.$html)return;const e=this.overlay;e.classList.remove("flipbook-overlay-visible"),e.addEventListener("transitionend",(()=>{e.classList.add("flipbook-hidden")}),{once:!0}),document.body.classList.remove("flipbook-overflow-hidden"),this.$html.classList.remove("flipbook-overflow-hidden"),this.context.restoreScrollPosition()}closeLightbox(e){if(!this.lightboxOpened)return;this.lightboxOpened=!1,this.hideOverlay();const t=new Event("r3d-lightboxclose");window.dispatchEvent(t),this.context.trigger("lightboxclose"),this.context.fullscreenElement.classList.remove("flipbook-browser-fullscreen"),this.context.lightboxEnd(),e||this.options.deeplinkingEnabled||history.back()}disposeLightbox(){this.lightboxOpened=!1,this.hideOverlay();const e=new Event("r3d-lightboxclose");window.dispatchEvent(e),this.context.trigger("lightboxclose"),this.context.fullscreenElement.classList.remove("flipbook-browser-fullscreen"),this.context.lightboxEnd(),this.context.disposed=!0}},FLIPBOOK.onPageLinkClick=function(e){var t=e.dataset.bookid,i=e.dataset.page;i&&FLIPBOOK.books[t].goToPage(Number(i));var o=e.dataset.url;o&&window.open(o,"_blank")},FLIPBOOK.easings={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},easeInSine:function(e){return 1-Math.cos(e*Math.PI/2)},easeOutSine:function(e){return Math.sin(e*Math.PI/2)},easeInOutSine:function(e){return.5*(1-Math.cos(Math.PI*e))}},FLIPBOOK.animate=function(e){let t=performance.now(),i=e.from,o=e.to,s=e.duration,n=o-i,a=FLIPBOOK.easings[e.easing]||FLIPBOOK.easings.linear,r=null,l=null,h=e.repeat||1,d=e.yoyo||!1,c=0,p=!1,u=e.delay||0;function g(){let m=performance.now(),b=null!==l?l-t:m-t;if(b<u)return void(r=requestAnimationFrame(g));b-=u;let f,v=Math.min(b/s,1);f=p?i+n*a(1-v):i+n*a(v),e.step&&e.step(f),v<1?r=requestAnimationFrame(g):(c++,c<h?(d&&(p=!p),t=performance.now(),r=requestAnimationFrame(g)):(e.step&&e.step(o),e.complete&&e.complete()))}return u>0?setTimeout((()=>{t=performance.now(),r=requestAnimationFrame(g)}),u):r=requestAnimationFrame(g),{pause:function(){r&&(cancelAnimationFrame(r),l=performance.now())},resume:function(){l&&(t+=performance.now()-l,l=null,r=requestAnimationFrame(g))},stop:function(){r&&cancelAnimationFrame(r)}}},FLIPBOOK.extend=function(){function e(e){return"[object Object]"===Object.prototype.toString.call(e)}var t,i,o,s,n,a,r=arguments[0]||{},l=1,h=arguments.length,d=!1;for("boolean"==typeof r&&(d=r,r=arguments[1]||{},l=2),"object"!=typeof r&&"function"!=typeof r&&(r={}),h===l&&(r=this,--l);l<h;l++)if(null!=(t=arguments[l]))for(i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(o=r[i],r===(s=t[i]))continue;d&&s&&(e(s)||(n=Array.isArray(s)))?(n?(n=!1,a=o&&Array.isArray(o)?o:[]):a=o&&e(o)?o:{},r[i]=FLIPBOOK.extend(d,a,s)):void 0!==s&&(r[i]=s)}return r},FLIPBOOK.Tooltip2=class{constructor(e){this.wrapper=e,this.tooltipEl=null,this.activeTarget=null,this.tooltipObserver=null,this.init()}init(){this.tooltipEl=document.createElement("span"),this.tooltipEl.className="flipbook-tooltip-element skin-color skin-color-bg",this.tooltipEl.setAttribute("role","tooltip"),this.tooltipEl.id="flipbook-tooltip",this.wrapper.appendChild(this.tooltipEl),this.wrapper.addEventListener("mouseover",this.handleMouseOver.bind(this)),this.wrapper.addEventListener("mouseout",this.handleMouseOut.bind(this)),this.wrapper.addEventListener("focusin",this.handleFocusIn.bind(this)),this.wrapper.addEventListener("focusout",this.handleMouseOut.bind(this)),this.wrapper.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0})}handleMouseOver(e){const t=e.target.closest(".flipbook-has-tooltip");t&&!t.classList.contains("disabled")&&this.showTooltip(t)}handleFocusIn(e){const t=e.target.closest(".flipbook-has-tooltip");t&&!t.classList.contains("disabled")&&(t.setAttribute("aria-describedby","flipbook-tooltip"),this.showTooltip(t))}handleTouchStart(e){const t=e.target.closest(".flipbook-has-tooltip");t&&!t.classList.contains("disabled")&&(this.showTooltip(t),setTimeout((()=>this.hideTooltip()),2e3))}handleMouseOut(){this.hideTooltip()}showTooltip(e){this.activeTarget=e,e.setAttribute("aria-describedby","flipbook-tooltip"),this.observeTooltipChanges(e),this.updateTooltipText(),this.tooltipEl.style.opacity=0,this.tooltipEl.style.display="block";const t=e.getBoundingClientRect(),i=this.tooltipEl.getBoundingClientRect(),o=this.wrapper.getBoundingClientRect();let s=t.top-o.top-i.height-10,n=t.left-o.left+(t.width-i.width)/2,a=!1,r=t.left-o.left+t.width/2-n;r=Math.max(6,Math.min(i.width-6,r)),s<0&&(s=t.bottom-o.top+10,a=!0),s+i.height>o.height&&(s=o.height-i.height-5),n<0&&(n=5,r=t.left-o.left+t.width/2-n,r=Math.max(6,Math.min(i.width-6,r))),n+i.width>o.width&&(n=o.width-i.width-5,r=t.left-o.left+t.width/2-n,r=Math.max(6,Math.min(i.width-6,r))),s+=this.wrapper.scrollTop,n+=this.wrapper.scrollLeft,this.tooltipEl.style.top=`${s}px`,this.tooltipEl.style.left=`${n}px`,this.tooltipEl.style.setProperty("--arrow-left",`${r}px`),this.tooltipEl.classList.toggle("below",a),this.tooltipEl.style.opacity=1}updateTooltipText(){this.activeTarget&&(this.tooltipEl.innerText=this.activeTarget.dataset.tooltip||"")}observeTooltipChanges(e){this.tooltipObserver&&(this.tooltipObserver.disconnect(),this.tooltipObserver=null),this.tooltipObserver=new MutationObserver((t=>{if(this.activeTarget&&this.activeTarget===e)for(const e of t)if("attributes"===e.type&&"data-tooltip"===e.attributeName){this.updateTooltipText();break}})),this.tooltipObserver.observe(e,{attributes:!0,attributeFilter:["data-tooltip"]})}hideTooltip(){this.tooltipEl.style.opacity=0,this.tooltipEl.style.display="none",this.activeTarget&&this.activeTarget.removeAttribute("aria-describedby"),this.activeTarget=null,this.tooltipObserver&&(this.tooltipObserver.disconnect(),this.tooltipObserver=null)}};