-
Notifications
You must be signed in to change notification settings - Fork 0
/
dflip.min.js
4 lines (4 loc) · 105 KB
/
dflip.min.js
1
2
3
4
"use strict";var DFLIP=DFLIP||{};var PRESENTATION=DFLIP;(function e(t,i){t.version="1.2.7";t.PAGE_MODE={SINGLE:1,DOUBLE:2,AUTO:void 0};t.SINGLE_PAGE_MODE={ZOOM:1,BOOKLET:2,AUTO:void 0};t.DIRECTION={LTR:1,RTL:2};t.CORNERS={TL:"tl",TR:"tr",BL:"bl",BR:"br",L:"l",R:"r",NONE:void 0};t.SOURCE_TYPE={IMAGE:"image",PDF:"pdf",HTML:"html"};t.DISPLAY_TYPE={WEBGL:"3D",HTML:"2D"};t.PAGE_SIZE={AUTO:0,SINGLE:1,DOUBLEINTERNAL:2};var n=t.defaults={webgl:true,webglShadow:true,soundEnable:true,height:"100%",autoEnableOutline:false,autoEnableThumbnail:false,overwritePDFOutline:false,enableDownload:true,duration:800,direction:t.DIRECTION.LTR,pageMode:t.PAGE_MODE.AUTO,singlePageMode:t.SINGLE_PAGE_MODE.AUTO,backgroundColor:"#fff",forceFit:true,transparent:false,hard:"none",annotationClass:"",maxTextureSize:1600,minTextureSize:256,icons:{altnext:"ti-angle-right",altprev:"ti-angle-left",next:"ti-angle-right",prev:"ti-angle-left",end:"ti-angle-double-right",start:"ti-angle-double-left",share:"ti-sharethis",help:"ti-help-alt",more:"ti-more-alt",download:"ti-download",zoomin:"ti-zoom-in",zoomout:"ti-zoom-out",fullscreen:"ti-fullscreen",fitscreen:"ti-arrows-corner",thumbnail:"ti-layout-grid2",outline:"ti-menu-alt",close:"ti-close",doublepage:"ti-book",singlepage:"ti-file",sound:"ti-volume",facebook:"ti-facebook",google:"ti-google",twitter:"ti-twitter-alt",mail:"ti-email"},text:{toggleSound:"Encender/apagar sonido",toggleThumbnails:"Miniaturas",toggleOutline:"Esquema y marcadores",previousPage:"Página anterior",nextPage:"Página siguiente",toggleFullscreen:"Pantalla completa",zoomIn:"Agrandar",zoomOut:"Reducir",toggleHelp:"Ayuda",singlePageMode:"Modo de página sencilla",doublePageMode:"Modo de doble página",downloadPDFFile:"Descargar PDF",gotoFirstPage:"Ir a la primera página",gotoLastPage:"Ir a la última página",share:"Compartir"},allControls:"altPrev,pageNumber,altNext,outline,thumbnail,zoomIn,zoomOut,fullScreen,share,more,download,pageMode,startPage,endPage,sound",mainControls:"altPrev,pageNumber,altNext,outline,thumbnail,zoomIn,zoomOut,fullScreen,share,more",hideControls:"",scrollWheel:true,onCreate:function(){},onCreateUI:function(){},onFlip:function(){},beforeFlip:function(){},onReady:function(){},zoomRatio:1.5,pageSize:t.PAGE_SIZE.AUTO,pdfjsSrc:"js/libs/pdf.min.js",pdfjsCompatibilitySrc:"js/libs/compatibility.js",pdfjsWorkerSrc:"js/libs/pdf.worker.min.js",threejsSrc:"js/libs/three.min.js",mockupjsSrc:"js/libs/mockup.min.js",soundFile:"sound/turn2.mp3",enableDebugLog:false,canvasToBlob:true,enableAnnotation:true,textureLoadFallback:"blank",stiffness:3,minTopOffset:30,backgroundImage:"",pageRatio:void 0,defaultPageRatio:210/297,pixelRatio:window.devicePixelRatio||1};var o="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,a="onmousedown"in window,r="ontouchstart"in window;var s=t.utils={drag:{left:0,right:1,none:-1},mouseEvents:a?{type:"mouse",start:"mousedown",move:"mousemove",end:"mouseup"}:{type:"touch",start:"touchstart",move:"touchmove",end:"touchend"},html:{div:"<div/>",img:"<img/>",a:"<a>",input:"<input type='text'/>"},toRad:function(e){return e*Math.PI/180},toDeg:function(e){return e*180/Math.PI},transition:function(e,t){return e?t/1e3+"s ease-out":"0s none"},display:function(e){return e?"block":"none"},resetTranslate:function(){return v(0,0)},translateStr:function(e,t){return o?" translate3d("+e+"px,"+t+"px, 0px) ":" translate("+e+"px, "+t+"px) "},resetBoxShadow:function(){return"rgba(0, 0, 0, 0) 0px 0px 20px"},rotateStr:function(e){return" rotateZ("+e+"deg) "},bg:function(e){return"#fff"+P(e)},bgImage:function(e){return e==void 0||e=="blank"?"":" url("+e+")"},src:function(e){return e!==void 0?""+e+"":""},limitAt:function(e,t,i){return e<t?t:e>i?i:e},distOrigin:function(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))},distPoints:function(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))},getVectorAvg:function(e){return{x:e.map(function(e){return e.x}).reduce(s.sum)/e.length,y:e.map(function(e){return e.y}).reduce(s.sum)/e.length}},sum:function(e,t){return e+t},getTouches:function(e,t){t=t||{left:0,top:0};return Array.prototype.slice.call(e.touches).map(function(e){return{x:e.pageX-t.left,y:e.pageY-t.top}})},angleByDistance:function(e,t){var i=t/2;var n=C(e,0,t);return n<i?p(Math.asin(n/i)):90+p(Math.asin((n-i)/i))},log:function(e){if(n.enableDebugLog==true&&window.console)console.log(e)},lowerPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},nearestPowerOfTwo:function(e,t){return Math.min(t||2048,Math.pow(2,Math.ceil(Math.log(e)/Math.LN2)))},zoomStops:function(e,t,i,n,o){if(n==void 0)n=256;if(o==void 0)o=2048;var a=Math.log(e/n)/Math.log(t);return n*Math.pow(t,i==void 0?Math.round(a):i==true?Math.ceil(a):Math.floor(a))},extendOptions:function(e,t){return i.extend(true,{},e,t)},getBasePage:function(e){return Math.floor(e/2)*2},loadResources:function e(t,i,n){var o=document,a=o.createElement(t),r=o.getElementsByTagName(t)[0];a.async=true;if(n){a.addEventListener("load",function(e){n(null,e)},false)}a.src=i;r.parentNode.insertBefore(a,r)},getScript:function(e,t,i){var n=document.createElement("script");var o=document.body.getElementsByTagName("script")[0];n.async=1;n.setAttribute("data-cfasync",false);if(o!=void 0){o.parentNode.insertBefore(n,o);o=null}else{document.body.appendChild(n)}function a(e,i){if(n!=void 0){if(i||!n.readyState||/loaded|complete/.test(n.readyState)){n.onload=n.onreadystatechange=null;n=void 0;n=null;if(!i){if(t)t();t=null}}}}n.addEventListener("load",a,false);n.addEventListener("readystatechange",a,false);n.addEventListener("complete",a,false);if(i){n.addEventListener("error",i,false)}n.src=e+(M.dom=="MS"?"?"+Math.random(1):"")},isHardPage:function(e,t,i,n){if(e!==void 0){if(e=="cover"){return t==0||n&&t==1||t==Math.floor(i/(n?1:2))-(n?0:1)}else if(e=="all"){return true}else{var o=(","+e+",").indexOf(","+(t*2+1)+",")>-1;var a=(","+e+",").indexOf(","+(t*2+2)+",")>-1;return o||a}}return false},fixMouseEvent:function(e){if(e){var t=e.originalEvent||e;if(t.changedTouches&&t.changedTouches.length>0){var n=i.event.fix(e);var o=t.changedTouches[0];n.clientX=o.clientX;n.clientY=o.clientY;n.pageX=o.pageX;n.pageY=o.pageY;n.movementX=o.movementX;n.movementY=o.movementY;return n}else{return e}}else{return e}},hasWebgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch(e){return false}}(),isBookletMode:function(e){return e.pageMode==t.PAGE_MODE.SINGLE&&e.singlePageMode==t.SINGLE_PAGE_MODE.BOOKLET},isMobile:function(){var e=false;(function(t){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))e=true})(navigator.userAgent||navigator.vendor||window.opera);return e}(),prefix:function(){var e=window.getComputedStyle(document.documentElement,""),t=Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)[1],i="WebKit|Moz|MS".match(new RegExp("("+t+")","i"))[1];return{dom:i,lowercase:t,css:"-"+t+"-",js:t[0].toUpperCase()+t.substr(1)}}(),__extends:window&&window.__extends||function(e,t){for(var i in t)if(t.hasOwnProperty(i))e[i]=t[i];function n(){this.constructor=e}n.prototype=t.prototype;e.prototype=new n;e.__super=t.prototype;return e}};var l=t.SOURCE_TYPE,d=t.DISPLAY_TYPE,c=s.drag,f=s.mouseEvents,u=s.html,h=s.toRad,p=s.toDeg,g=s.transition,v=s.translateStr,m=s.resetBoxShadow,b=s.rotateStr,w=s.bg,P=s.bgImage,x=s.src,C=s.limitAt,y=s.distOrigin,E=s.distPoints,k=s.angleByDistance,S=s.log,L=s.nearestPowerOfTwo,I=s.extendOptions,T=s.getBasePage,O=s.getScript,R=s.fixMouseEvent,M=s.prefix,D=s.isBookletMode,F=s.isMobile,N=s.hasWebgl,B=s.__extends;var z=function(e){return i.extend(true,{},n,e)};var A=function(e,n){var o="df-ui";var a="df-ui-wrapper";var r=o+"-"+"btn";var s=n.ui=i(u.div,{class:o});var l=n.options;s.dispose=function(){e.find("."+r).each(function(){i(this).off()});b.off();c.off();f.off();h.off();p.off();g.off();v.off();w.off();P.off();L.off();I.off();R.off();M.off();D.off();F.off();N.off();B.off();z.off();A.off();T.remove();m.remove();f.remove();c.remove();h.remove();if(s.shareBox){if(s.shareBox.dispose)s.shareBox.dispose();s.shareBox=null}document.removeEventListener("keyup",le,false);window.removeEventListener("click",x,false);s.update=null;n=null};var d=function(e){if(isNaN(e))e=n.target._activePage;else if(e<1)e=1;else if(e>n.target.pageCount)e=n.target.pageCount;return e};var c=s.next=i(u.div,{class:r+" "+o+"-next "+l.icons["next"],title:l.text.nextPage,html:"<span>"+l.text.nextPage+"</span>"}).on("click",function(){n.next()});var f=s.prev=i(u.div,{class:r+" "+o+"-prev "+l.icons["prev"],title:l.text.previousPage,html:"<span>"+l.text.previousPage+"</span>"}).on("click",function(){n.prev()});var h=i(u.div,{class:a+" "+o+"-zoom"});var p=s.zoomIn=i(u.div,{class:r+" "+o+"-zoomin "+l.icons["zoomin"],title:l.text.zoomIn,html:"<span>"+l.text.zoomIn+"</span>"}).on("click",function(){n.zoom(1);s.update();if(n.target.startPoint&&n.target.pan)n.target.pan(n.target.startPoint)});var g=s.zoomOut=i(u.div,{class:r+" "+o+"-zoomout "+l.icons["zoomout"],title:l.text.zoomOut,html:"<span>"+l.text.zoomOut+"</span>"}).on("click",function(){n.zoom(-1);s.update();if(n.target.startPoint&&n.target.pan)n.target.pan(n.target.startPoint)});h.append(p).append(g);var v=s.pageNumber=i(u.div,{class:r+" "+o+"-page"}).on("change",function(){var e=parseInt(s.pageInput.val(),10);e=d(e);n.gotoPage(e)}).on("keyup",function(e){if(e.keyCode==13){var t=parseInt(s.pageInput.val(),10);t=d(t);if(t!==d(n.target._activePage||n._activePage))n.gotoPage(t)}});s.pageInput=i('<input id="df_book_page_number" type="text"/>').appendTo(v);s.pageLabel=i('<label for="df_book_page_number"/>').appendTo(v);var m=i(u.div,{class:a+" "+o+"-size"});var b=i(u.div,{class:r+" "+o+"-help "+l.icons["help"],title:l.text.toggleHelp,html:"<span>"+l.text.toggleHelp+"</span>"}).on("click",function(){});var w=s.sound=i(u.div,{class:r+" "+o+"-sound "+l.icons["sound"],title:l.text.toggleSound,html:"<span>"+l.text.toggleSound+"</span>"}).on("click",function(){l.soundEnable=!l.soundEnable;s.updateSound()});s.updateSound=function(){if(l.soundEnable==false||l.soundEnable=="false")w.addClass("disabled");else w.removeClass("disabled")};s.updateSound();var P=s.more=i(u.div,{class:r+" "+o+"-more "+l.icons["more"]}).on("click",function(e){if(!P.hasClass("df-active")){i(this).addClass("df-active");e.stopPropagation()}});function x(e){P.removeClass("df-active")}window.addEventListener("click",x,false);var C=i(u.div,{class:"more-container"});P.append(C);if(typeof l.source=="string"&&l.enableDownload==true){var y=r+" "+o+"-download "+l.icons["download"];var E=s.download=i('<a download target="_blank" class="'+y+'"><span>'+l.text.downloadPDFFile+"</span></a>");E.attr("href",l.source).attr("title",l.text.downloadPDFFile)}var k=document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled;if(!k){e.addClass("df-custom-fullscreen")}var L=s.fullScreen=i(u.div,{class:r+" "+o+"-fullscreen "+l.icons["fullscreen"],title:l.text.toggleFullscreen,html:"<span>"+l.text.toggleFullscreen+"</span>"}).on("click",function(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement;var t=n.container[0];if(s.isFullscreen!=true){n.container.addClass("df-fullscreen");if(t.requestFullscreen){t.requestFullscreen()}else if(t.msRequestFullscreen){t.msRequestFullscreen()}else if(t.mozRequestFullScreen){t.mozRequestFullScreen()}else if(t.webkitRequestFullscreen){t.webkitRequestFullscreen()}s.isFullscreen=true}else{n.container.removeClass("df-fullscreen");s.isFullscreen=false;if(document.exitFullscreen){document.exitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}setTimeout(function(){n.resize()},50)});var I=s.fit=i(u.div,{class:r+" "+o+"-fit "+l.icons["fitscreen"]}).on("click",function(){i(this).toggleClass("df-button-fit-active")});m.append(L);var T=i(u.div,{class:a+" "+o+"-controls"});var O=s.shareBox=new t.Share(e,l);var R=s.share=i(u.div,{class:r+" "+o+"-share "+l.icons["share"],title:l.text.share,html:"<span>"+l.text.share+"</span>"}).on("click",function(e){if(s.shareBox.isOpen==true)s.shareBox.close();else{s.shareBox.update(n.getURLHash());s.shareBox.show()}});var M=s.startPage=i(u.div,{class:r+" "+o+"-start "+l.icons["start"],title:l.text.gotoFirstPage,html:"<span>"+l.text.gotoFirstPage+"</span>"}).on("click",function(){n.start()});var D=s.endPage=i(u.div,{class:r+" "+o+"-end "+l.icons["end"],title:l.text.gotoLastPage,html:"<span>"+l.text.gotoLastPage+"</span>"}).on("click",function(){n.end()});var F=s.pageMode=i(u.div,{class:r+" "+o+"-pagemode "+l.icons["singlepage"],html:"<span>"+l.text.singlePageMode+"</span>"}).on("click",function(){var e=i(this);n.setPageMode(!e.hasClass(l.icons["doublepage"]))});n.setPageMode(n.target.pageMode==t.PAGE_MODE.SINGLE);var N=s.altPrev=i(u.div,{class:r+" "+o+"-prev"+" "+o+"-alt "+l.icons["prev"],title:l.text.previousPage,html:"<span>"+l.text.previousPage+"</span>"}).on("click",function(){n.prev()});var B=s.altNext=i(u.div,{class:r+" "+o+"-next"+" "+o+"-alt "+l.icons["next"],title:l.text.nextPage,html:"<span>"+l.text.nextPage+"</span>"}).on("click",function(){n.next()});var z=s.thumbnail=i(u.div,{class:r+" "+o+"-thumbnail "+l.icons["thumbnail"],title:l.text.toggleThumbnails,html:"<span>"+l.text.toggleThumbnails+"</span>"}).on("click",function(){var e=i(this);if(n.target.thumbContainer){var t=n.target.thumbContainer;t.toggleClass("df-thumb-visible");e.toggleClass("df-active")}else{n.contentProvider.initThumbs();e.toggleClass("df-active")}if(e.hasClass("df-active")){e.siblings(".df-active").trigger("click")}s.update(true)});var A=s.outline=i(u.div,{class:r+" "+o+"-outline "+l.icons["outline"],title:l.text.toggleOutline,html:"<span>"+l.text.toggleOutline+"</span>"}).on("click",function(){var e=i(this);if(n.target.outlineContainer){var t=n.target.outlineContainer;e.toggleClass("df-active");t.toggleClass("df-outline-visible");if(e.hasClass("df-active")){e.siblings(".df-active").trigger("click")}s.update(true)}});var _=l.allControls.replace(/ /g,"").split(","),j=","+l.mainControls.replace(/ /g,"")+",",U=","+l.hideControls.replace(/ /g,"")+",";for(var H=0;H<_.length;H++){var W=_[H];if(U.indexOf(","+W+",")<0){var G=s[W];if(G!==void 0){if(j.indexOf(","+W+",")>-1)T.append(G);else if(W!=="more"&&W!=="pageNumber")C.append(G)}}}e.append(T).append(f).append(c).append(h);var V=false,q=false,Z=false;var Y=16,K=17,X=18,Q=83,J=86,$=67,ee=69,te=71,ie=78,ne=79,oe=46,ae=39,re=37,se=27;document.addEventListener("keyup",le,false);function le(e){switch(e.keyCode){case se:if(s.isFullscreen==true)s.fullScreen.trigger("click");break;case Y:q=false;break;case K:V=false;break;case X:Z=false;break;case re:n.prev();break;case ae:n.next();break;default:break}}s.update=function(i){S("ui update");var o=n.target;var a=d(o._activePage||n._activePage);var r=o.pageCount||n.pageCount;var l=o.direction==t.DIRECTION.RTL,c=a==1||a==0,f=a==r;s.next.show();s.prev.show();s.altNext.removeClass("disabled");s.altPrev.removeClass("disabled");if(c&&!l||f&&l){s.prev.hide();s.altPrev.addClass("disabled")}if(f&&!l||c&&l){s.next.hide();s.altNext.addClass("disabled")}s.pageInput.val(a);s.pageLabel.html(a+"/"+r);if(e.find(".df-thumb-visible, .df-outline-visible").length>0){e.addClass("df-sidemenu-open")}else{e.removeClass("df-sidemenu-open")}if(i==true)n.resize();if(o.contentProvider.zoomScale==o.contentProvider.maxZoom){s.zoomIn.addClass("disabled")}else{s.zoomIn.removeClass("disabled")}if(o.contentProvider.zoomScale==1){s.zoomOut.addClass("disabled")}else{s.zoomOut.removeClass("disabled")}};if(n.target!==void 0){n.target.ui=s}if(l.onCreateUI!==void 0)l.onCreateUI()};var _=void 0;function j(){_=function(e){B(t,e);function t(t){t=t||{};var n=this;e.call(this,t);n.options=t;n.canvas=i(n.renderer.domElement).addClass("df-3dcanvas");n.container=t.container;n.container.append(n.canvas);n.type="PreviewStage";n.mouse=new THREE.Vector2;n.raycaster=new THREE.Raycaster;n.camera.position.set(0,20,600);n.camera.lookAt(new THREE.Vector3(0,0,0));n.spotLight.position.set(-220,330,550);n.spotLight.castShadow=F?false:t.webglShadow;if(n.spotLight.shadow){n.spotLight.shadow.bias=-8e-4}n.spotLight.intensity=.22;n.ambientLight.color=new THREE.Color("#888");n.ambientLight.intensity=1.45;var o=new THREE.ShadowMaterial;o.opacity=.15;n.ground.material=o;n.ground.position.z=-2;n.orbitControl.maxAzimuthAngle=.4;n.orbitControl.minAzimuthAngle=-.4;n.orbitControl.minPolarAngle=1.4;n.orbitControl.maxPolarAngle=2.2;n.orbitControl.mouseButtons.ORBIT=THREE.MOUSE.RIGHT;n.orbitControl.mouseButtons.PAN=-1;n.orbitControl.maxDistance=5e3;n.orbitControl.minDistance=50;n.orbitControl.noZoom=true;n.selectiveRendering=true;n.orbitControl.zoomSpeed=5;n.orbitControl.keyPanSpeed=0;n.orbitControl.center.set(0,0,0);n.orbitControl.update();n.swipe_threshold=F?15:20;var a=n.cssRenderer=new THREE.CSS3DRenderer;i(a.domElement).css({position:"absolute",top:0,pointerEvents:"none"}).addClass("df-3dcanvas df-csscanvas");n.container[0].appendChild(a.domElement);var r=n.cssScene=new THREE.Scene;var s=document.createElement("div");s.className="df-page-content df-page-content-left";var l=document.createElement("div");l.className="df-page-content df-page-content-right";var d=r.divLeft=new THREE.CSS3DObject(s);var c=r.divRight=new THREE.CSS3DObject(l);r.add(d);r.add(c);n.resizeCallback=function(){a.setSize(n.canvas.width(),n.canvas.height())};function u(){n.renderRequestPending=true}window.addEventListener(f.move,u,false);window.addEventListener("keyup",u,false);n.dispose=function(){n.clearChild();n.render();window.removeEventListener(f.move,u,false);if(n.options.scrollWheel==true){n.renderer.domElement.removeEventListener("mousewheel",h,false);n.renderer.domElement.removeEventListener("DOMMouseScroll",h,false)}window.removeEventListener("keyup",u,false);n.renderer.domElement.removeEventListener("mousemove",p,false);n.renderer.domElement.removeEventListener("touchmove",p,false);n.renderer.domElement.removeEventListener("mousedown",g,false);n.renderer.domElement.removeEventListener("touchstart",g,false);n.renderer.domElement.removeEventListener("mouseup",m,false);n.renderer.domElement.removeEventListener("touchend",m,false);n.canvas.remove();a.domElement.remove();a=null;n.renderCallback=null;n.orbitControl.dispose();n.orbitControl=null;n.renderer.dispose();n.cancelRAF()};n.renderCallback=function(){if(TWEEN.getAll().length>0)n.renderRequestPending=true;TWEEN.update();a.render(r,n.camera)};var h=function(e){var t=0;if(e.wheelDelta!==void 0){t=e.wheelDelta}else if(e.detail!==void 0){t=-e.detail}if(t){var i=n.previewObject.contentProvider.zoomScale;if(t>0&&i==1||t<0&&i>1){e.preventDefault()}n.previewObject.zoom(t>0?1:-1)}u()};var p=function(e){n.renderRequestPending=true;e=R(e);if(n.isMouseDown&&e.movementX!=0&&e.movementY!=0){n.isMouseMoving=true}if(n.isMouseDown==true&&n.previewObject.contentProvider.zoomScale==1){var t=e.pageX-n.lastPos,i=performance.now()-n.lastTime;if(Math.abs(t)>n.swipe_threshold){if(t<0){n.target.next()}else{n.target.prev()}e.preventDefault();n.isMouseDown=false}n.lastPos=e.pageX;n.lastTime=performance.now()}};var g=function(e){e=R(e);document.activeElement.blur();n.mouseValue=e.pageX+","+e.pageY;n.isMouseMoving=false;n.isMouseDown=true;n.lastPos=e.pageX;n.lastTime=performance.now()};var v=function(e){n.isMouseDown=false;if(e.button!==0)return this;var t=e.pageX+","+e.pageY;if(n.isMouseMoving){}else if(t==n.mouseValue){e=e||window.event;e=i.event.fix(e);var o=n.mouse,a=n.raycaster;o.x=e.offsetX/n.canvas.innerWidth()*2-1;o.y=1-e.offsetY/n.canvas.innerHeight()*2;a.setFromCamera(o,n.camera);var r=a.intersectObjects(n.target instanceof MOCKUP.Bundle?n.target.children:[n.target],true);if(r.length>0){var s,l=0;do{s=r[l]!==void 0?r[l].object:void 0;l++}while((s instanceof THREE.BoxHelper||!(s instanceof MOCKUP.Paper)||s.isFlipping==true)&&l<r.length);if(s.userData.object!==void 0){}else{if(s.angles[1]>90){if(s.isEdge!=true)n.target.next()}else{if(s.isEdge!=true)n.target.prev()}}}else{}}};var m=function(e){e=R(e);v(e)};n.renderer.domElement.addEventListener("mousemove",p,false);n.renderer.domElement.addEventListener("touchmove",p,false);n.renderer.domElement.addEventListener("mousedown",g,false);n.renderer.domElement.addEventListener("touchstart",g,false);n.renderer.domElement.addEventListener("mouseup",m,false);n.renderer.domElement.addEventListener("touchend",m,false);if(n.options.scrollWheel==true){n.renderer.domElement.addEventListener("mousewheel",h,false);n.renderer.domElement.addEventListener("DOMMouseScroll",h,false)}i(n.renderer.domElement).css({display:"block"});i(window).trigger("resize");return this}t.prototype.width=function(){return this.container.width()};t.prototype.height=function(){return this.container.height()};return t}(MOCKUP.Stage);MOCKUP.PreviewStage=_;var e=function(e){B(t,e);function t(t,i){t=t||{};t.folds=1;e.call(this,t,i);this.angle=0;this.isFlipping=false;this.material.materials[5].transparent=true;this.material.materials[4].transparent=true;this.type="BookPaper"}t.prototype.tween=function(e,t){var i=this;var n=1e-5;i.originalStiff=i.stiffness;var o=i.newStiffness;var a=D(i.parent);var r=t-e;var s=e>90;i.init={angle:e,angle2:e<90?0:180,stiff:i.originalStiff,index:s?1:0};i.first={angle:e+r/4,angle2:e<90?90:90,stiff:i.originalStiff,index:s?1:.25};i.mid={angle:e+r*2/4,angle2:e<90?135:45,stiff:i.newStiffness,index:s?.5:.5};i.mid2={angle:e+r*3/4,angle2:e<90?180:0,stiff:i.newStiffness,index:s?.25:1};i.end={angle:t,angle2:e<90?180:0,stiff:i.newStiffness,index:s?0:1};i.isFlipping=true;var l=function(e,t){i.angles[1]=e.angle;i.angles[4]=i.isHard?e.angle:e.angle2;if(i.isHard==true){i.stiffness=0}else{i.stiffness=e.stiff/(o+n)*(i.newStiffness+n);i.stiffness=isNaN(i.stiffness)?0:e.stiff}if(a){i.material.materials[5].opacity=i.material.materials[4].opacity=e.index;i.castShadow=s?e.index>.5:e.index>.5}i.updateAngle(true)};if(!s&&a){i.material.materials[5].opacity=i.material.materials[4].opacity=0;i.castShadow=false}new TWEEN.Tween(i.init).to({angle:[i.first.angle,i.mid.angle,i.mid2.angle,i.end.angle],angle2:[i.first.angle2,i.mid.angle2,i.mid2.angle2,i.end.angle2],stiff:[i.first.stiff,i.mid.stiff,i.mid2.stiff,i.end.stiff],index:[i.first.index,i.mid.index,i.mid2.index,i.end.index]},i.parent.duration).onUpdate(function(e){l(this,e)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(function(e){i.stiffness=i.newStiffness;i.updateAngle();i.material.materials[5].opacity=i.material.materials[4].opacity=1;i.castShadow=true;i.isFlipping=false;if(i.parent&&i.parent.refresh)i.parent.refresh()}).start()};return t}(MOCKUP.FlexBoxPaper);MOCKUP.BookPaper=e;var o=function(e){B(i,e);function i(i,n){i=i||{};i.segments=i.segments||50;this.pageCount=i.pageCount;this.height=i.height;this.width=i.width;this.pageCount=this.pageCount==1?this.pageCount:Math.ceil(this.pageCount/2)*2;this.direction=i.direction||t.DIRECTION.LTR;this.startPage=1;this.endPage=this.pageCount;this.stackCount=i.stackCount||6;this.materials=[];e.call(this,i,n);this.angles=[0,0,0,0,0,0];this.stiffness=i.stiffness||1.5;this.hardConfig="none";this._activePage=i.openPage||this.startPage;this.createStack(i);this.pageMode=i.pageMode||(F||this.pageCount<=2?t.PAGE_MODE.SINGLE:t.PAGE_MODE.DOUBLE);this.singlePageMode=i.singlePageMode||(F?t.SINGLE_PAGE_MODE.BOOKLET:t.SINGLE_PAGE_MODE.ZOOM);this.type="Book"}i.prototype.getPageByNumber=function(e){var t=D(this)?e:Math.floor((e-1)/2);return this.getObjectByName(t.toString())};i.prototype.isPageHard=function(e){return s.isHardPage(this.hardConfig,e,this.pageCount)};i.prototype.activePage=function(e){if(e==void 0)return this._activePage;this.gotoPage(e)};i.prototype.gotoPage=function(e){e=parseInt(e,10);this._activePage=e;this.updatePage(e)};i.prototype.moveBy=function(e){var t=this._activePage+e;t=C(t,this.startPage,this.endPage);this.gotoPage(t)};i.prototype.next=function(e){if(e==void 0)e=this.direction==t.DIRECTION.RTL?-this.pageMode:this.pageMode;this.moveBy(e)};i.prototype.prev=function(e){if(e==void 0)e=this.direction==t.DIRECTION.RTL?this.pageMode:-this.pageMode;this.moveBy(e)};i.prototype.updateAngle=function(){var e=this.angles[1];var t=this.angles[4];var i=t-e;var n=this.stackCount;for(var o=0;o<n;o++){var a=this.children[o];a.angles[1]=e+o*i/(n*100);a.stiffness=this.stiffness;a.updateAngle()}};i.prototype.refresh=function(){this.updatePage(this._activePage);if(this.flipCallback!==void 0)this.flipCallback()};i.prototype.updatePage=function(e){var i=this.direction==t.DIRECTION.RTL,o=D(this),a=T(e);var r=o?1:2;e=Math.floor(e/r);if(i)e=this.pageCount/r-e;var s=this.oldBaseNumber||0;var l=this.pageCount/r;var d=this.stackCount;var c=.02;var f=.4;var u=o?0:(.5-Math.abs(l/2-e)/l)/this.stiffness;var h=1;var p=Math.floor(d/2);var g=false;if(s>e){g=true;this.children[d-1].skipFlip=true;this.children.unshift(this.children.pop())}else if(s<e){this.children[0].skipFlip=true;this.children.push(this.children.shift())}else{}if(Math.abs(s-e)>1){}var v=l-e;var m=5/l;var b=m*e/2;var w=m*v/2;var P=b<w?w:b;for(var x=0;x<d;x++){var C=this.children[x];var y=C.color;var E=C.angles[1];var k;var S=e-p+x;var L=C.isHard=this.isPageHard(S);var I=C.name;C.visible=S>=0&&S<l||o&&S==l;if(this.requestPage!==void 0){if(i)S=Math.floor(this.pageCount/2)-S-1;C.name=S.toString();if(C.name!=I&&C.visible==true){C.textureLoaded=false;C.frontImage(n.textureLoadFallback);C.frontPageStamp="-1";C.frontTextureLoaded=false;C.thumbLoaded=false;C.backImage(n.textureLoadFallback);C.backPageStamp="-1";C.backTextureLoaded=false;this.requestPage()}}C.isEdge=false;if(x==0){C.depth=b<f?f:b}else if(x==d-1){C.depth=w<f?f:w}else{C.depth=f;C.isEdge=false}if(C.isFlipping==true){C.depth=f}C.position.x=0;var O=c*x,R=180-c*(x-p)+c*x;if(x<p){C.newStiffness=L?0:u/(e/l)/4;k=O;C.position.z=P-(-x+p)*f;if(g==true)C.position.z-=f}else{k=R;C.newStiffness=L?0:u/(Math.abs(l-e)/l)/4;C.position.z=P-(-d+x+p+1)*f-C.depth}if(C.isFlipping==false){if(Math.abs(E-k)>20&&C.skipFlip==false){C.depth=f;var M=C.stiffness;if(E>k){M=u/(Math.abs(l-e)/l)/4}else{M=u/(e/l)/4}C.position.z+=f;C.stiffness=isNaN(M)?C.stiffness:M;C.updateAngle(true);C.targetStiffness=x<e?u/(Math.abs(l-e)/l)/4:u/(e/l)/4;C.targetStiffness=isNaN(C.targetStiffness)?C.stiffness:C.targetStiffness;C.isFlipping=true;C.tween(E,k);if(this.preFlipCallback!==void 0)this.preFlipCallback()}else{C.skipFlip=false;C.newStiffness=isNaN(C.newStiffness)?0:C.newStiffness;if(C.angles[1]!=k||C.stiffness!=C.newStiffness||C.depth!=C.oldDepth){C.angles[1]=C.angles[4]=k;C.stiffness=C.newStiffness;C.updateAngle(true)}else{}}}if(o&&x<p&&C.isFlipping==false)C.visible=false;C.oldDepth=C.depth;var F=Math.abs(C.geometry.boundingBox.max.x)<Math.abs(C.geometry.boundingBox.min.x)?C.geometry.boundingBox.max.x:C.geometry.boundingBox.min.x;C.position.x=C.isEdge==true&&C.isFlipping==false?x<p?F:-F:0}this.oldBaseNumber=e;if(this.updatePageCallback!==void 0)this.updatePageCallback()};i.prototype.createCover=function(e){e.width=e.width*2;this.cover=new MOCKUP.BiFold(e);this.add(this.cover)};i.prototype.createStack=function(e){var t="red,green,blue,yellow,orange,black".split(",");for(var i=0;i<this.stackCount;i++){e.angles=[,this.stackCount-i];e.stiffness=(this.stackCount-i)/100;var n=new MOCKUP.BookPaper(e);n.angles[1]=180;n.index=i;n.updateAngle();n.textureReady=false;n.textureRequested=false;this.add(n);n.color=t[i];n.position.z=-1*i}};i.prototype.shininess=function(e){if(e==void 0){return this.mainObject.shininess()}else{this.mainObject.shininess(e)}};i.prototype.bumpScale=function(e){if(e==void 0){return this.mainObject.bumpScale()}else{this.mainObject.bumpScale(e)}};i.prototype.frontImage=function(e){if(e==void 0){return this.mainObject.frontImage()}else{this.mainObject.frontImage(e)}};i.prototype.backImage=function(e){if(e==void 0){return this.mainObject.backImage()}else{this.mainObject.backImage(e)}};return i}(MOCKUP.Bundle);MOCKUP.Book=o}var U=function(e){function n(e){e=e||{};this.type="PreviewObject";var i=this;function n(){setTimeout(function(){i.resize()},50)}window.addEventListener("resize",n,false);this.sound=document.createElement("audio");this.sound.setAttribute("src",e.soundFile+"?ver="+t.version);this.sound.setAttribute("type","audio/mpeg");this.dispose=function(){if(this.container&&this.container.info&&this.container.info.remove)this.container.info.remove();if(this.target&&this.target.dispose)this.target.dispose();this.target=null;if(this.stage&&this.stage.dispose)this.stage.dispose();this.stage=null;if(this.ui&&this.ui.dispose)this.ui.dispose();this.ui=null;if(this.contentProvider&&this.contentProvider.dispose)this.contentProvider.dispose();this.contentProvider=null;window.removeEventListener("resize",n)}}n.prototype={start:function(){this.target.gotoPage(this.target.startPage)},end:function(){this.target.gotoPage(this.target.endPage)},next:function(){},prev:function(){},zoom:function(e){this.pendingZoom=true;this.zoomDelta=e;this.resize();this.ui.update()},resize:function(){var e=this;if(e.target==void 0||e.target.ui==void 0||e.target.contentProvider==void 0||e.target.contentProvider.viewport==void 0||e.target.stage==void 0)return;var n=this.target.pageMode==t.PAGE_MODE.SINGLE,o=e.container.hasClass("df-floating");var a=e.target,r=a.stage,d=a.contentProvider,c=d.pageRatio,f=d.zoomViewport,u=a.mode!=="css";var h,p,g=i(window).height();var v=a.ui.isFullscreen==true?g:this.options.height;e.container.height(v);if(Math.min(e.container.height(),g)==g)v=g;e.container.height(v);v=e.container.height();if(!u){r.css({top:0,bottom:0,right:0,left:0,transform:"translate3d("+e.target.left+"px,"+e.target.top+"px,0)"});a.stageHeight=r.height()}h=r.width();p=r.height();var m=h-(u?100:0),b=Math.min(p-(u?100:0),g),w=Math.floor(n?m:m/2);var P=Math.floor(w/c);var x,E,k,S,L;x=Math.min(P,b);E=Math.floor(x*c);d.maxZoom=d.zoomViewport.height/x;if(e.zoomValue==void 0)e.zoomValue=1;
if(e.pendingZoom==true&&e.zoomDelta!==void 0){var I=e.zoomDelta,T,O=Math.max(x,E);e.zoomValue=e.zoomDelta>0?e.zoomValue*e.options.zoomRatio:e.zoomValue/e.options.zoomRatio;e.zoomValue=C(e.zoomValue,1,d.maxZoom);if(e.zoomValue==1){d.zoomScale=1}else{T=x*e.zoomValue;T=s.zoomStops(T,e.options.zoomRatio);d.zoomScale=C(T/O,1,d.maxZoom)}}L=d.zoomScale==1||d.zoomScale==void 0?1:d.zoomScale;d.checkViewportSize(E,x,L);if(e.contentSourceType==l.PDF){E=d.viewport.width/L;x=d.viewport.height/L}if(d.zoomScale!=1){this.target.container.addClass("df-zoom-enabled")}var R=e.container.width();if(R<400){e.container.addClass("df-xs")}else{e.container.removeClass("df-xs")}var M=d.maxZoom;if(u){var D=e.container.find(".df-ui-controls").height();if(D==null||o)D=0;r.canvas.height(v-D);if(e.container.hasClass("df-sidemenu-open")){h=h-220}r.resizeCanvas(h,v-D);var F=x*L,N=E*L,B=a.height,z=h*B/v,A=F/B,_=h/v;var j=a.width*(n?1:2);var U=z<j?j/_:a.height;var H=e.options.minTopOffset+(o?60:30);var W=v/(v-H);k=1/(2*Math.tan(Math.PI*r.camera.fov*.5/180)/(U/(L/W)));r.camera.updateProjectionMatrix();r.renderRequestPending=true;var G=H/2-e.options.minTopOffset;e.target.position.y=G*B/(e.container.height()-H);r.cssScene.position.y=e.target.position.y;var V=d.zoomScale==1;if(r.camera.position.z!==k&&e.pendingZoom==true){if(e.zoomTween!==void 0)e.zoomTween.stop();e.zoomTween=new TWEEN.Tween({campos:r.camera.position.z,otx:r.orbitControl.target.x,oty:r.orbitControl.target.y,otz:r.orbitControl.target.z}).delay(0).to({campos:k,otx:0,oty:0,otz:0},100).onUpdate(function(){r.camera.position.z=this.campos;if(V){r.orbitControl.target=new THREE.Vector3(this.otx,this.oty,this.otz)}r.orbitControl.update()}).easing(TWEEN.Easing.Linear.None).onComplete(function(){r.camera.position.z=k;if(d.zoomScale==1){r.camera.position.set(0,0,k);r.orbitControl.target=new THREE.Vector3(0,0,0)}r.orbitControl.update()}).start()}else{if(d.zoomScale==1){r.camera.position.set(0,0,k);r.orbitControl.target=new THREE.Vector3(0,0,0)}else{r.camera.position.z=k}r.orbitControl.update()}r.orbitControl.update();r.orbitControl.mouseButtons.ORBIT=L!=1?-1:THREE.MOUSE.RIGHT;r.orbitControl.mouseButtons.PAN=L!=1?THREE.MOUSE.LEFT:-1}else{if(a!==void 0){a.pageWidth=Math.round(E);a.fullWidth=a.pageWidth*2;a.height=Math.round(x);var q=a.zoomWidth=Math.floor(E*L),Z=a.zoomHeight=Math.floor(x*L);var Y=a.stage.innerWidth()-a.stage.width(),K=a.stage.innerHeight()-a.stage.height();var X=a.shiftHeight=C((Z-(v-K))/2,0,Z),Q=a.shiftWidth=C(L==1?1:(q*2-a.container.width()+Y)/2,0,a.fullWidth*L);if(L==1){a.left=0;a.top=0}a.stage.css({top:-X,bottom:-X,right:-Q,left:-Q,transform:"translate3d("+a.left+"px,"+a.top+"px,0)"});var J=a.stage.innerHeight();a.wrapper.css({width:q*2,height:Z,marginTop:v-Z-K>0?(v-K-Z)/2:0});var $=Math.floor(y(E,x))*L;a.stage.find(".df-page-wrapper").width($).height($);a.stage.find(".df-book-page, .df-page-front , .df-page-back, .df-page-fold-inner-shadow").height(Z).width(q)}}e.checkCenter({type:"resize"});if(d.zoomScale==1){this.target.container.removeClass("df-zoom-enabled")}if(a.thumblist){a.thumblist.reset(i(a.thumblist.container).height())}e.pendingZoom=false},playSound:function(){try{if(this.options&&this.options.soundEnable==true){this.sound.currentTime=0;this.sound.play()}}catch(e){}},setPageMode:function(e){if(e==true){this.ui.pageMode.addClass(this.options.icons["doublepage"]);this.ui.pageMode.html("<span>"+this.options.text.doublePageMode+"</span>");this.ui.pageMode.attr("title",this.options.text.doublePageMode);this.target.pageMode=t.PAGE_MODE.SINGLE}else{this.ui.pageMode.removeClass(this.options.icons["doublepage"]);this.ui.pageMode.html("<span>"+this.options.text.singlePageMode+"</span>");this.ui.pageMode.attr("title",this.options.text.singlePageMode);this.target.pageMode=t.PAGE_MODE.DOUBLE}if(this.target&&this.target.singlePageMode==t.SINGLE_PAGE_MODE.BOOKLET){this.target.reset()}this.resize()},height:function(e){if(e==void 0){return this.container.height()}else{this.options.height=e;this.container.height(e);this.resize()}},checkCenter:function(e){e=e==void 0?{}:e;this.centerType=this.centerType||"start";var i=this.target;var n=0,o=0,a=0;var r=s.getBasePage(i._activePage);var l=i._activePage%2==0;var d=i.direction==t.DIRECTION.RTL;var c=i.pageMode==t.PAGE_MODE.SINGLE,f=c&&i.singlePageMode==t.SINGLE_PAGE_MODE.BOOKLET;var u=i.stage.width(),h;if(i.mode=="css"){h=i.wrapper.width();n=Math.max((h-u)/2,0);o=-h/4;a=h/4;if(r==0||f){i.wrapper.css({left:c?d?a-n:o-n:d?a:o});i.shadow.css({width:"50%",left:d?0:"50%",transitionDelay:""})}else if(r==i.pageCount){i.wrapper.css({left:c?d?o-n:a-n:d?o:a});i.shadow.css({width:"50%",left:d?"50%":0,transitionDelay:""})}else{i.wrapper.css({left:c?d?l?o-n:a-n:l?a-n:o-n:0});i.shadow.css({width:"100%",left:0,transitionDelay:parseInt(i.duration,10)+50+"ms"})}i.wrapper.css({transition:e.type=="resize"?"none":""})}else if(i.stage!==void 0){var p=i.position.x,g;n=i.width/4;h=i.width;o=-h/2;a=h/2;if(r==0||f){g=d?a:o}else if(r==i.pageCount){g=d?o:a}else{g=c?d?l?o:a:l?a:o:0}if(g!==this.centerEnd){this.centerTween=new TWEEN.Tween({x:p}).delay(0).to({x:g},i.duration).onUpdate(function(){i.position.x=this.x;i.stage.cssScene.position.x=this.x}).easing(i.ease).start();this.centerEnd=g}}},width:function(e){if(e==void 0){return this.container.width()}else{this.options.width=e;this.container.width(e);this.resize()}}};return n}({});t.PreviewObject=U;var H=function(e){B(a,e);var o=void 0;function a(e,o,a,r){a=a||{};var s=this;s.contentRawSource=e||[n.textureLoadFallback];s.contentSource=s.contentRawSource;s.contentSourceType=void 0;s.minDimension=a.minTextureSize||256;s.maxDimension=a.maxTextureSize||2048;s.flipbook=r;s.waitPeriod=50;s.enableDebug=false;s.zoomScale=1;s.maxZoom=2;s.options=a;s.outline=a.outline;s.links=a.links;s.html=a.html;s.isCrossOrigin=a.isCrossOrigin;s.normalViewport={height:297,width:210,scale:1};s.viewport={height:297,width:210,scale:1};s.zoomViewport={height:297,width:210};s.thumbsize=128;s.cacheIndex=256;s.cache=[];s.pageRatio=a.pageRatio||s.viewport.width/s.viewport.height;s.textureLoadTimeOut=void 0;s.type="TextureLibrary";if(Array===s.contentSource.constructor||Array.isArray(s.contentSource)||s.contentSource instanceof Array){s.contentSourceType=l.IMAGE;s.pageCount=s.contentSource.length;i("<img/>").attr("src",s.contentSource[0]).on("load",function(){s.viewport.height=this.height;s.viewport.width=this.width;s.pageRatio=s.viewport.width/s.viewport.height;s.zoomViewport={width:(s.pageRatio>1?1:s.pageRatio)*s.maxDimension,height:s.maxDimension/(s.pageRatio<1?1:s.pageRatio)};s.linkService=new PDFLinkService;i(this).off();if(o!=void 0)o(s);S(this.height+":"+this.width)})}else if(typeof s.contentSource=="string"||s.contentSource instanceof String){var d=function(){PDFJS.workerSrc=n.pdfjsWorkerSrc;s.contentSourceType=l.PDF;PDFJS.disableAutoFetch=true;PDFJS.disableStream=true;PDFJS.externalLinkTarget=PDFJS.LinkTarget.BLANK;var i=PDFJS.getDocument(s.options.docParameters?s.options.docParameters:e);i.then(function e(i){s.pdfDocument=i;i.getPage(1).then(function(e){s.normalViewport=e.getViewport(1);s.viewport=e.getViewport(1);s.viewport.height=s.viewport.height/10;s.viewport.width=s.viewport.width/10;s.pageRatio=s.viewport.width/s.viewport.height;s.zoomViewport={width:(s.pageRatio>1?1:s.pageRatio)*s.maxDimension,height:s.maxDimension/(s.pageRatio<1?1:s.pageRatio)};s.refPage=e;if(i.numPages>1){i.getPage(2).then(function(e){if(s.options.pageSize==t.PAGE_SIZE.AUTO){var n=e.getViewport(1);var a=n.width/n.height;if(a>s.pageRatio*1.5){s.options.pageSize=t.PAGE_SIZE.DOUBLEINTERNAL;s.pageCount=i.numPages*2-2}else{s.options.pageSize=t.PAGE_SIZE.SINGLE}}if(o!=void 0)o(s)})}else{if(o!=void 0)o(s)}});s.linkService=new PDFLinkService;s.linkService.setDocument(i,null);s.pageCount=i.numPages;s.contentSource=i},function e(t){var i="",n=document.createElement("a");n.href=s.contentSource;if(n.hostname!==window.location.hostname)i="CROSS ORIGIN!! ";s.updateInfo(i+"Cannot access file! "+s.contentSource)});i.onProgress=function e(t){var i=100*t.loaded/t.total;if(isNaN(i)){if(t&&t.loaded){s.updateInfo("Cargando PDF "+(Math.ceil(t.loaded/1e4)/100).toString()+"MB ...")}else{s.updateInfo("Cargando PDF ...")}}else{s.updateInfo("Cargando PDF "+i.toString().split(".")[0]+"% ...")}}};var c=function(){n.pdfjsWorkerSrc+="?ver="+t.version;s.updateInfo("Cargando PDF Worker ...");var e=document.createElement("a");e.href=n.pdfjsWorkerSrc;if(e.hostname!==window.location.hostname){s.updateInfo("Cargando PDF Worker CORS ...");i.ajax({url:n.pdfjsWorkerSrc,cache:true,success:function(e){n.pdfjsWorkerSrc=t.createObjectURL(e,"text/javascript");d()}})}else{d()}};if(window.PDFJS==void 0){s.updateInfo("Cargando PDF Service ...");O(n.pdfjsSrc+"?ver="+t.version,function(){if(typeof define==="function"&&define.amd){s.updateInfo("Cargando PDF Service (require) ...");require(["pdfjs-dist/build/pdf"],function(e){c()})}else{c()}},function(){s.updateInfo("Unable to load PDF service..")})}else{d()}}else{console.error("Unknown source type. Please check documentation for help")}this.dispose=function(){if(this.targetObject){if(this.targetObject.dispose)this.targetObject.dispose();this.targetObject.processPage=null;this.targetObject.requestPage=null}if(this.pdfDocument&&this.pdfDocument.destroy)this.pdfDocument.destroy();if(this.linkService&&this.linkService.dispose)this.linkService.dispose();if(this.outlineViewer&&this.outlineViewer.dispose)this.outlineViewer.dispose();if(this.thumblist&&this.thumblist.dispose)this.thumblist.dispose();this.targetObject=null;this.pdfDocument=null;this.linkService=null;this.outlineViewer=null;this.thumblist=null};return this}a.prototype.updateInfo=function(e){if(this.flipbook&&this.flipbook.updateInfo){this.flipbook.updateInfo(e)}};a.prototype.initThumbs=function(){var e=this;if(e.cache[e.thumbsize]==void 0)e.cache[e.thumbsize]=[];var t;var n=function(){clearTimeout(t);t=setTimeout(function(){t=setTimeout(o,e.waitPeriod/2)},e.waitPeriod)};var o=function(){var o=0;if(Date.now()-e.thumblist.lastScrolled<100){o=1}else{e.targetObject.container.find(".df-thumb-container .df-vrow").each(function(){var t=i(this);if(!t.hasClass("df-thumb-loaded")){o++;var a=i(this).attr("id").replace("df-thumb","");e.getPage(a,n,true);t.addClass("df-thumb-loaded");return false}});if(o==0){clearTimeout(t)}}if(o>0){n()}};e.thumblist=e.targetObject.thumblist=new ThumbList({h:500,addFn:function(e){},scrollFn:n,itemHeight:128,totalRows:e.pageCount,generatorFn:function(e){var t=document.createElement("div");var i=e+1;t.id="df-thumb"+i;var n=document.createElement("div");n.innerHTML=i;t.appendChild(n);return t}});e.thumblist.lastScrolled=Date.now();n();e.targetObject.thumbContainer=i(e.thumblist.container).addClass("df-thumb-container df-thumb-visible");e.targetObject.container.append(e.targetObject.thumbContainer);e.thumblist.reset(i(e.thumblist.container).height());e.targetObject.container.on("click",".df-thumb-container .df-vrow",function(t){t.stopPropagation();var n=i(this).attr("id").replace("df-thumb","");e.targetObject.gotoPage(parseInt(n,10))})};a.prototype.initOutline=function(){var e=this;var t=i("<div>").addClass("df-outline-container");e.targetObject.container.append(t);e.targetObject.outlineContainer=t;e.outlineViewer=new BookMarkViewer({container:t[0],linkService:e.linkService,outlineItemClass:"df-outline-item",outlineToggleClass:"df-outline-toggle",outlineToggleHiddenClass:"df-outlines-hidden"});function n(t){if(e.options.overwritePDFOutline==true){t=[]}t=t||[];if(e.outline){for(var i=0;i<e.outline.length;i++){e.outline[i].custom=true;if(t)t.push(e.outline[i])}}e.outlineViewer.render({outline:t})}if(e.pdfDocument){e.pdfDocument.getOutline().then(function(e){n(e)})}else{n([])}if(e.options.autoEnableOutline==true){e.targetObject.ui.outline.trigger("click")}if(e.options.autoEnableThumbnail==true){e.targetObject.ui.thumbnail.trigger("click")}};a.prototype.checkViewportSize=function(e,t,i){var o=this;var a=o.targetObject;var r=e*i,d=t*i;var c=o.cacheIndex;if(o.contentSourceType==l.PDF){o.cacheIndex=Math.ceil(Math.max(r,d));if(i!==1){o.cacheIndex=L(Math.max(r,d));o.cacheIndex=s.zoomStops(Math.max(r,d),o.options.zoomRatio,c<o.cacheIndex)}o.cacheIndex=C(o.cacheIndex*n.pixelRatio,o.minDimension,o.maxDimension);if(o.cache[o.cacheIndex]==void 0)o.cache[o.cacheIndex]=[];if(c!==o.cacheIndex){for(var f=0;f<a.children.length;f++){var u=a.children[f]}a.refresh()}o.viewport=a.mode=="css"?o.refPage.getViewport(d/o.normalViewport.height):o.refPage.getViewport(300/o.normalViewport.height);S(o.cacheIndex);var h=a.container.find(".linkAnnotation"),p=o.viewport.clone({dontFlip:true});h.css({transform:"matrix("+p.transform.join(",")+")"})}else{if(o.cache[o.cacheIndex]==void 0)o.cache[o.cacheIndex]=[]}};a.prototype.getCache=function(e,t){return t==true?this.cache[this.thumbsize]==void 0?void 0:this.cache[this.thumbsize][e]:this.cache[this.cacheIndex]==void 0?void 0:this.cache[this.cacheIndex][e]};a.prototype.setCache=function(e,t,i,n){if(i==true){if(this.cache[this.thumbsize]!=void 0)this.cache[this.thumbsize][e]=t}else{var o=n==void 0?this.cacheIndex:n;if(this.cache[o]!=void 0)this.cache[o][e]=t}};a.prototype.setTarget=function(e){var t=this;if(e==void 0){return this.targetObject}else{this.targetObject=e;e.contentProvider=this;e.container.removeClass("df-loading df-init");if(t.linkService!==void 0){t.linkService.setViewer(e);t.initOutline()}e.processPage=function(e,i){if(e>0&&e<=t.pageCount){t.getPage(e,i)}else{t.setPage(e,n.textureLoadFallback,i)}};e.requestPage=function(){t.review("Request")};if(e.resize!==void 0)e.resize()}};a.prototype.review=function(e){var t=this;e=e||"timer review";clearTimeout(o);o=setTimeout(function(){o=setTimeout(t.reviewPages,t.waitPeriod/2,t,e)},t.waitPeriod)};a.prototype.reviewPages=function(e,t){e=e||this;var n=e.targetObject;if(n==void 0)return;var o=D(n);if(t!==void 0)S(t);var a=false;var r,s;for(r=0;r<e.targetObject.children.length;r++){s=n.children[r];if(s.isFlipping==true){a=true;break}}if(a==false){var l=n.children.length>3?3:n.children.length;var d=l/2;var c=o?n._activePage:T(n._activePage);if(e.zoomScale>1){l=1}for(r=0;r<l;r++){var f=Math.floor(r/2);var u=r%2==0?-f*(o?1:2):(f==0?1:f)*(o?1:2);var h=c+u,p=c+u+1;var g=n.getPageByNumber(h),v=n.getPageByNumber(p),m=h+"|"+e.cacheIndex,b=p+"|"+e.cacheIndex;var w=0;if(g!==void 0&&g.frontPageStamp!=m&&g.visible==true){n.processPage(h,function(){e.review("Batch Call")});g.frontPageStamp=m;g.frontTextureLoaded=true;w++}if(v!==void 0&&v.backPageStamp!=b&&v.visible==true&&!o){n.processPage(p,function(){e.review("Batch Call")});v.backPageStamp=b;v.backTextureLoaded=true;w++}if(u==0&&e.annotedPage!==c&&n.mode!=="css"){e.getAnnotations(h);if(!o)e.getAnnotations(p);e.annotedPage=c}if(w>0){break}}if(w==0){if(n.mode!=="css"){e.setLoading(c)}else{e.setLoading(c);e.setLoading(c+1)}}}else{e.review("Revisit request");if(e.annotedPage!==void 0&&n.mode!=="css"){var P=T(n._activePage);i(n.getContentLayer(P)).html("");i(n.getContentLayer(P+1)).html("");e.annotedPage=void 0}}};a.prototype.getPage=function(e,i,o){var a=this;e=parseInt(e,10);var r=a.contentSource;if(e<=0&&e>=a.pageCount){a.setPage(e,n.textureLoadFallback,i,o)}else{if(a.contentSourceType==l.PDF){if(a.getCache(e,o)!==void 0){a.setPage(e,a.getCache(e,o),i,o);S("Page "+e+" loaded from cache")}else{if(o!==true)a.setLoading(e,true);var s=e;if(a.options.pageSize==t.PAGE_SIZE.DOUBLEINTERNAL&&e>2){s=Math.ceil((e-1)/2)+1}r.getPage(s,o).then(function(t){c(t,e,i,o)})}}else if(a.contentSourceType==l.IMAGE||a.contentSourceType==l.HTML){if(a.getCache(e,o)!==void 0){a.setPage(e,a.getCache(e,o),i,o);S("Page "+e+" loaded from cache")}else{if(o!==true)a.setLoading(e,true);if(a.isCrossOrigin==void 0){a.setCache(e,r[e-1],o,a.cacheIndex);a.setPage(e,r[e-1],i,o);if(i!=void 0)i()}else{d(r[e-1],function(t){a.setCache(e,t,o,a.cacheIndex);a.setPage(e,t,i,o);if(i!=void 0)i()},a.isCrossOrigin)}}}}function d(e,i,o){var a=new Image;a.crossOrigin="Anonymous";a.onload=function(){if(o==true){var r=document.createElement("canvas"),s=r.getContext("2d");r.width=a.width;r.height=a.height;s.drawImage(a,0,0);if(n.canvasToBlob==true){r.toBlob(function(e){var n=t.createObjectURL(e,"image/jpeg");if(i!=void 0)i(n)},"image/jpeg",.85)}else{if(i!=void 0)i(r)}}else{if(i!=void 0)i(e)}a.onload=null;a=null};a.src=e;if(a.complete||a.complete===undefined){a.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";a.src=e}}function c(e,i,n,o){var r=a.options.forceFit;var s=a.options.pageSize==t.PAGE_SIZE.DOUBLEINTERNAL&&i>1&&i<a.pageCount;var l=s&&r?2:1;var d=r?e.getViewport(1):a.normalViewport;var c=a.cacheIndex/Math.max(d.width/l,d.height);if(a.webgl==true){c=L(a.cacheIndex)/(a.pageRatio>1?d.width/l:d.height)}var f=document.createElement("canvas");var u=performance.now();var h=a.cacheIndex;var p=f.getContext("2d");if(o==true){c=a.thumbsize/a.normalViewport.height}f.height=Math.round(d.height*c);f.width=Math.round(d.width/l*c);if(a.targetObject.mode=="css"&&Math.abs(a.targetObject.zoomHeight-f.height)<2){f.height=a.targetObject.zoomHeight+0;f.width=a.targetObject.zoomWidth+0}d=e.getViewport(c);S("rendering "+i+" at "+f.width+"x"+f.height);if(s&&i%2==1){d.transform[4]=-f.width}var g={canvasContext:p,viewport:d};e.cleanupAfterRender=true;var v=e.render(g);v.promise.then(function(){S(performance.now()-u);u=performance.now();if(o==true||a.options.canvasToBlob==true&&a.webgl!==true){f.toBlob(function(e){var r=t.createObjectURL(e,"image/jpeg");S(performance.now()-u);a.setCache(i,r,o,h);a.setPage(i,r,n,o)},"image/jpeg",.9)}else{a.setPage(i,f,n,o)}g=null})}};a.prototype.getTargetPage=function(e){};a.prototype.setLoading=function(e,t){if(this.targetObject!==void 0){if(this.webgl==true){var n=this.targetObject.container;if(t==true){if(n.isLoading!==true){n.addClass("df-loading");n.isLoading=true;S("CArgando icono at "+e+" as "+t)}}else{if(n.isLoading!==void 0){n.removeClass("df-loading");n.isLoading=void 0;S("Cargando icon at "+e+" as "+t)}}}else{var o=i(this.targetObject.getContentLayer(e));if(o!==void 0){if(t==true)o.addClass("df-page-loading");else o.removeClass("df-page-loading")}}}};a.prototype.getAnnotations=function(e){var n=this;if(n.options.enableAnnotation==false)return;var o=n.targetObject;e=parseInt(e,10);var a=n.contentSource;var r=i(o.getContentLayer(e));r.empty();if(e>0&&e<=n.pageCount){if(n.contentSourceType==l.PDF){var s=T(e);var d=e;if(n.options.pageSize==t.PAGE_SIZE.DOUBLEINTERNAL&&e>2){d=Math.ceil((e-1)/2)+1}a.getPage(d).then(function(t){if(r!==void 0&&r.length>0){n.setupAnnotations(t,n.viewport,r,e)}})}if(n.links!==void 0&&n.links[e]!==void 0){var c=n.links[e];for(var f=0;f<c.length;f++){var u=c[f];var h=document.createElement("a");h.setAttribute("dest",u.dest);h.className="customLinkAnnotation";h.href="#"+u.dest;h.onclick=function(){var e=this.getAttribute("dest");if(e){n.linkService.customNavigateTo(e)}return false};h.style.left=u.x+"%";h.style.top=u.y+"%";h.style.width=u.w+"%";h.style.height=u.h+"%";r[0].appendChild(h)}}if(n.html!==void 0&&n.html[e]!==void 0){var p=n.html[e];r.append(i("<div class='customHTMLAnnotation'>").html(p))}}};a.prototype.setPage=function(e,i,o,a){var r=this;var s=r.targetObject;if(a==true){var l=r.targetObject.container.find("#df-thumb"+e);l.css({backgroundImage:P(i)})}else{if(i==n.textureLoadFallback){S("Fallback on "+e)}else{if(s.mode=="css")r.getAnnotations(e)}var d=s.getPageByNumber(e);if(d!==void 0){if(e%2!=0&&s.direction==t.DIRECTION.LTR||e%2!=1&&s.direction==t.DIRECTION.RTL||D(r.targetObject)){S(e+"rendered to back of "+d.color);d.backImage(i,function(){r.setLoading(e);if(o!=void 0)o()})}else{S(e+"rendered to front of "+d.color);d.frontImage(i,function(){r.setLoading(e);if(o!=void 0)o()})}}else{S("Invalid set request on Page "+e)}}};a.prototype.setupAnnotations=function(e,n,o,a){if(o==void 0||i(o).length==0)return;var r=this;return e.getAnnotations().then(function(s){n=n.clone({dontFlip:true});if(r.options.pageSize==t.PAGE_SIZE.DOUBLEINTERNAL&&a>2&&a%2==1){}else if(a==1){}if(o==void 0){return}o=i(o);if(o.find(".annotationDiv").length==0){o.append(i("<div class='annotationDiv'>"))}var l=o.find(".annotationDiv");l.empty();if(r.options.pageSize==t.PAGE_SIZE.DOUBLEINTERNAL&&a>2&&a%2==1){l.css({left:"-100%"})}else if(a==1){l.css({left:""})}PDFJS.AnnotationLayer.render({annotations:s,div:l[0],page:e,viewport:n,linkService:r.linkService});if(r.options.annotationClass&&r.options.annotationClass!==""){l.find(" > section").addClass(r.options.annotationClass)}})};return a}({});var W=function(){function e(e){this.angles=e.angles||[0,0,0,0,0,0];this.stiffness=e.angles||.1;this.segments=e.segments||1;this.initDOM()}function o(e){var t=e.contentLayer=i(u.div,{class:"df-page-content"});e.append(t)}e.prototype={initDOM:function(){var e=this.element=i(u.div,{class:"df-book-page"});var t=this.wrapper=i(u.div,{class:"df-page-wrapper"});var n=this.front=i(u.div,{class:"df-page-front"});var a=this.back=i(u.div,{class:"df-page-back"});var r=this.foldInnerShadow=i(u.div,{class:"df-page-fold-inner-shadow"});var s=this.foldOuterShadow=i(u.div,{class:"df-page-fold-outer-shadow"});this.frontIMG=new Image;this.backIMG=new Image;o(n,this.segments,true);o(a,this.segments,false);e.append(t).append(s);t.append(n).append(a).append(r)},updatePoint:function(e){if(e==void 0)return;var i=this.parent.dragPage!=void 0?this.parent.dragPage:e.page!=void 0?e.page:this;var n=i.element.width(),o=i.element.height();var a=this.parent.corner!==void 0?this.parent.corner:e.corner,r=t.CORNERS;var s=i.side==c.right,l=a==r.BL||a==r.BR;e.rx=s==true?n*2-e.x:e.x;e.ry=l==true?o-e.y:e.y;var d=Math.atan2(e.ry,e.rx);d=Math.PI/2-C(d,0,h(90));var f=s?e.x/2:n-e.x/2,u=e.ry/2,g=Math.max(0,Math.sin(d-Math.atan2(u,f))*y(f,u)),m=.5*y(e.rx,e.ry);var w=Math.round(n-g*Math.sin(d)),P=Math.round(g*Math.cos(d)),x=p(d);var E=l?s?180+(90-x):180+x:s?x:90-x;var k=l?s?180+(90-x):x:s?x+180:E,S=l?s?90-x:x+90:s?E-90:E+180,L=s?n-w:w,I=l?o+P:-P,T=s?-w:w-n,O=l?-o-P:P;var R=C(e.distance*.5/n,0,.5);var D=C((n*2-e.rx)*.5/n,.05,.3);i.element.addClass("df-folding");var F=s?i.back:i.front;var N=s?i.front:i.back;var B=i.foldOuterShadow;var z=i.foldInnerShadow;i.wrapper.css({transform:v(L,I)+b(E)});F.css({transform:b(-E)+v(-L,-I)});N.css({transform:b(k)+v(T,O),boxShadow:"rgba(0, 0, 0, "+R+") 0px 0px 20px"});z.css({transform:b(k)+v(T,O),opacity:D/2,backgroundImage:M.css+"linear-gradient( "+S+"deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) "+m*.7+"px, rgb(255, 255, 255) "+m+"px)"});B.css({opacity:D/2,left:s?"auto":0,right:s?0:"auto",backgroundImage:M.css+"linear-gradient( "+(-S+180)+"deg, rgba(0, 0, 0,0) "+m/3+"px, rgb(0, 0, 0) "+m+"px)"})},updateAngle:function(e,t){var i=this.element.width()*5;this.wrapper.css({perspective:i,perspectiveOrigin:t==true?"0% 50%":"100% 50%"});this.front.css({display:t==true?e<=-90?"block":"none":e<90?"block":"none",transform:(M.dom!=="MfS"?"":"perspective("+i+"px) ")+(t==true?"translateX(-100%) ":"")+"rotateY("+((t==true?180:0)+e)+"deg)"});this.back.css({display:t==true?e>-90?"block":"none":e>=90?"block":"none",transform:(M.dom!=="MSd"?"":"perspective("+i+"px) ")+(t==false?"translateX(100%) ":"")+"rotateY("+((t==false?-180:0)+e)+"deg)"});return},tween:function(e){var i=this;if(i==void 0||i.parent==void 0)return;var n=D(i.parent);var o=i.side==c.right;var a=i.parent.corner==t.CORNERS.BL||i.parent.corner==t.CORNERS.BR;var r=i.magnetic==true;var s=a?i.parent.height:0;var l,d,f,u=0;var h=i.end=i&&i.animateToReset==true?{x:o?i.parent.fullWidth:0,y:s}:{x:o?0:i.parent.fullWidth,y:s};i.ease=i.isHard?TWEEN.Easing.Quadratic.InOut:TWEEN.Easing.Linear.None;var p=i.parent.duration;if(i.isHard==true){if(e!=void 0){u=k(e.distance,e.fullWidth)}l=i.init={angle:u*(o?-1:1)};h=i.end=i&&i.animateToReset==true?{angle:o?0:-0}:{angle:o?-180:180}}else{if(e==void 0){l=i.init=i&&i.animateToReset==true?{x:o?0:i.parent.fullWidth,y:0}:{x:o?i.parent.fullWidth:0,y:0};d=i.first={x:(o?3:1)*i.parent.fullWidth/4,y:0};f=i.mid={x:(o?1:3)*i.parent.fullWidth/4,y:0}}else{l=i.init={x:e.x,y:e.y,opacity:1};d=i.first={x:e.x*3/4,y:e.y*3/4,opacity:1};f=i.mid={x:e.x/4,y:e.y/4,opacity:1};p=i.parent.duration*E(l.x,l.y,h.x,h.y)/i.parent.fullWidth;p=C(p,i.parent.duration/3,i.parent.duration)}}l.index=0;h.index=1;i.isFlipping=true;var g=function(e){if(i.isHard==true){i.updateAngle(e.angle,o)}else{i.updatePoint({x:e.x,y:e.y})}if(n&&!r)i.element[0].style.opacity=o?e.index>.5?2*(1-e.index):1:e.index<.5?2*e.index:1};if(!o&&n)i.element[0].style.opacity=0;var v=i.completeTween=i.completeTween||function(e){i.isFlipping=false;if(i.isHard==true){i.updateAngle(i.end.angle);i.back.css({display:"block"});i.front.css({display:"block"})}else{i.updatePoint({x:i.end.x,y:i.end.y})}i.element[0].style.opacity=1;if(i.animateToReset!==true){i.side=i.side==c.right?c.left:c.right}else i.animateToReset=void 0;i.currentTween=void 0;i.pendingPoint=void 0;i.magnetic=false;i.parent.dragPage=void 0;i.parent.corner=t.CORNERS.NONE;if(e!=true)i.parent.refresh()};if(i.isHard==true){i.currentTween=new TWEEN.Tween(l).delay(0).to(h,i.parent.duration).onUpdate(function(){g(this)}).easing(i.ease).onComplete(i.completeTween).start()}else{if(e==void 0){i.currentTween=new TWEEN.Tween(l).delay(0).to(h,i.parent.duration).onUpdate(function(){g(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween).start()}else{i.currentTween=new TWEEN.Tween(l).delay(0).to(h,p).onUpdate(function(){g(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(i.completeTween);i.currentTween.start()}}},frontImage:function(e,t){var o=this;function a(){o.front.css({backgroundImage:P(e)});if(t!==void 0)t()}if(e.nodeName=="CANVAS"){o.front.find(">canvas").remove();o.front.append(i(e));if(t!==void 0)t()}else{if(e==n.textureLoadFallback){a()}else{o.frontIMG.onload=a;o.frontIMG.src=e}}},backImage:function(e,t){var o=this;function a(){o.back.css({backgroundImage:P(e)});if(t!==void 0)t()}if(e.nodeName=="CANVAS"){o.back.find(">canvas").remove();o.back.append(i(e));if(t!==void 0)t()}else{if(e==n.textureLoadFallback){a()}else{o.backIMG.onload=a;o.backIMG.src=e}}},updateCSS:function(e){this.element.css(e)},resetCSS:function(){this.wrapper.css({transform:""});this.front.css({transform:"",boxShadow:""});this.back.css({transform:"",boxShadow:""})},clearTween:function(e){this.currentTween.stop();this.completeTween(e==true);this.resetCSS()}};return e}();var G=function(e){B(l,e);function a(e){e.parent.container.find(".df-folding").removeClass("df-folding");e.element.addClass("df-folding")}function r(e){var t=false;for(var i=0;i<e.pages.length;i++){var n=e.pages[i];if(n.isFlipping==true){t=true;break}}return t}function l(e,n){var l=this;l.type="BookCSS";l.images=e.images||[];l.pageCount=e.pageCount||2;l.foldSense=50;l.stackCount=4;l.mode="css";l.pages=[];l.duration=e.duration;l.container=i(n);l.options=e;l.drag=c.none;l.pageCount=l.pageCount==1?l.pageCount:Math.ceil(l.pageCount/2)*2;l.pageMode=e.pageMode||(F||l.pageCount<=2?t.PAGE_MODE.SINGLE:t.PAGE_MODE.DOUBLE);l.singlePageMode=e.singlePageMode||(F?t.SINGLE_PAGE_MODE.BOOKLET:t.SINGLE_PAGE_MODE.ZOOM);l.swipe_threshold=F?15:50;l.direction=e.direction||t.DIRECTION.LTR;l.startPage=1;l.endPage=l.pageCount;l._activePage=e.openPage||l.startPage;l.hardConfig=e.hard;o="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style;l.animateF=function(){if(TWEEN.getAll().length>0)TWEEN.update();else clearInterval(l.animate)};l.init(e);l.skipDrag=false;function d(e){if(l.dragPage!=e.page&&e.page.visible==true){l.dragPage.clearTween(true);l.dragPage=e.page;l.corner=e.corner;l.dragPage.pendingPoint=e}}var f=function(e){var i=l.eventToPoint(e);if(e.touches!==void 0&&e.touches.length==2&&l.startTouches!==void 0){return;var n=s.getVectorAvg(s.getTouches(e,l.container.offset())),o=h(l.startTouches,s.getTouches(e)),a=o/l.lastScale;var d=l.contentProvider.zoomScale;l.wrapper.css({transform:"scale3d("+o+","+o+",1)"});l.lastScale=o;l.lastZoomCenter=n;e.preventDefault()}if(e.touches!==void 0&&e.touches.length>1||l.startPoint==void 0||l.startTouches!==void 0)return;var f=l.dragPage||i.page;if(l.contentProvider.zoomScale!==1){if(e.touches!==void 0||l.isPanning==true){l.pan(i);e.preventDefault()}}else{if(l.skipDrag!==true){var u=i.distance;if(!r(l)){if(l.dragPage!==void 0||i.isInside==true){if(l.dragPage!==void 0){S("set mouse down move")}else{i.y=C(i.y,1,l.height-1);i.x=C(i.x,1,i.fullWidth-1)}var p=l.corner||i.corner;if(f.isHard){var g=p==t.CORNERS.BR||p==t.CORNERS.TR;var v=k(i.distance,i.fullWidth);f.updateAngle(v*(g?-1:1),g)}else{f.updatePoint(i,l)}f.magnetic=true;f.magneticCorner=i.corner;e.preventDefault()}if(l.dragPage==void 0&&f!==void 0&&i.isInside==false&&f.magnetic==true){f.pendingPoint=i;f.animateToReset=true;l.corner=f.magneticCorner;l.animatePage(f);f.pendingPoint=void 0;f.magnetic=false;f.magneticCorner=void 0}if(l.isPanning==true&&l.dragPage==void 0&&l.contentProvider.zoomScale==1){var m=i.x-l.lastPos,b=performance.now()-l.lastTime;if(Math.abs(m)>l.swipe_threshold){if(m<0){l.next()}else{l.prev()}l.drag=c.none;l.isPanning=false;e.preventDefault()}l.lastPos=i.x;l.lastTime=performance.now()}}}}},u=function(e){if(e.touches!==void 0&&e.touches.length==0){var i=l.contentProvider.zoomScale;if(l.lastScale>1&&i<l.contentProvider.maxZoom||l.lastScale<1&&i>1){l.previewObject.zoom(l.lastScale<1?-1:1)}l.wrapper.css({transform:""});l.lastScale=void 0;l.startTouches=void 0}l.isPanning=false;if(e.touches!==void 0&&e.touches.length>1)return;if(l.skipDrag!==true){var n=l.eventToPoint(e);if(l.dragPage){e.preventDefault();l.dragPage.pendingPoint=n;if(n.x==l.startPoint.x&&n.y==l.startPoint.y&&n.isInside==true){if(l.corner==t.CORNERS.BR||l.corner==t.CORNERS.TR){d(n);if(l.dragPage.isFlipping!==true)l.next()}else if(l.corner==t.CORNERS.BL||l.corner==t.CORNERS.TL){d(n);if(l.dragPage.isFlipping!==true)l.prev()}}else if(l.dragPage.isFlipping!==true){if(n.distance>n.fullWidth/2){if(n.x>n.fullWidth/2)l.prev();else l.next()}else{l.dragPage.animateToReset=true;l.animatePage(l.dragPage)}}if(l.dragPage){l.dragPage.pendingPoint=void 0;l.dragPage.magnetic=false}}else{}l.drag=c.none}},h=function(e,t){var i=E(e[0].x,e[0].y,e[1].x,e[1].y),n=E(t[0].x,t[0].y,t[1].x,t[1].y);return n/i},p=function(e){var i=l.eventToPoint(e);var n=e.srcElement||e.originalTarget;if(l.dragPage&&l.dragPage.magnetic)return;if(l.wrapper[0].contains(e.target)&&l.contentProvider.zoomScale==1&&i.x==l.startPoint.x&&i.y==l.startPoint.y&&i.isInsidePage&&l.startPoint.page==i.page&&!i.page.isFlipping&&n.nodeName!=="A"){if(l.startPoint.page.side==0){l.corner=t.CORNERS.TL;l.prev();l.startPoint.page=void 0}else{l.corner=t.CORNERS.TR;l.next();l.startPoint.page=void 0}l.isPanning=false}},g=function(e){if(e.touches!==void 0&&e.touches.length==2&&l.startTouches==void 0){l.startTouches=s.getTouches(e);l.lastScale=1}if(e.touches!==void 0&&e.touches.length>1||e.touches==void 0&&e.button!==0)return;var i=l.eventToPoint(e);l.startPoint=i;l.left=l.left||0;l.top=l.top||0;l.isPanning=true;l.lastPos=i.x;l.lastTime=performance.now();if(l.skipDrag!==true){if(i.isInside==true&&!r(l)){l.startPoint=i;l.drag=i.drag;l.dragPage=i.page;l.corner=i.corner;S(l.corner);a(l.dragPage);if(i.page.isHard){}else{i.page.updatePoint(i,l)}if(i.page.name=="0"){l.shadow.css({width:"50%",left:l.direction==t.DIRECTION.RTL?0:"50%",transitionDelay:""})}else if(i.page.name==Math.ceil(l.pageCount/2)-1){l.shadow.css({width:"50%",left:l.direction==t.DIRECTION.RTL?"50%":0,transitionDelay:""})}}}},v=function(e){var t=0;if(e.wheelDelta!=void 0){t=e.wheelDelta/120}else if(e.detail!==void 0){t=-e.detail/3}var i=l.contentProvider.zoomScale,n=l.contentProvider.maxZoom;if(t){if(t>0&&i<n||t<0&&i>1){e.stopPropagation();e.preventDefault();var o=l.eventToPoint(e);var a=l.eventToPoint(e);var r={x:l.container.width()/2,y:-23+l.container.height()/2};l.previewObject.zoom(t);var s=l.contentProvider.zoomScale;if(i!==s){var d=s/i;if(s==1){l.left=0;l.top=0}else{l.left*=d;l.top*=d}var c=(o.raw.x-r.x)*d,f=(o.raw.y-r.y)*d;a.raw.x=r.x+c;a.raw.y=r.y+f;l.startPoint=a;l.pan(o);var u=l.dragPage||o.page;if(l.dragPage==void 0&&u!==void 0&&o.isInside==true&&u.magnetic==true){
u.pendingPoint=o;u.animateToReset=true;l.corner=u.magneticCorner;l.animatePage(u);u.pendingPoint=void 0;u.magnetic=false;u.magneticCorner=void 0}}}}};var m=l.container[0];var b=l.stage[0];if(m){m.addEventListener("mousemove",f,false);m.addEventListener("touchmove",f,false);m.addEventListener("mousedown",g,false);m.addEventListener("click",p,false);m.addEventListener("mouseup",u,false);m.addEventListener("touchend",u,false);m.addEventListener("touchstart",g,false);if(l.options.scrollWheel==true){b.addEventListener("mousewheel",v,false);b.addEventListener("DOMMouseScroll",v,false)}}this.dispose=function(){m.removeEventListener("mousemove",f,false);m.removeEventListener("touchmove",f,false);m.removeEventListener("mousedown",g,false);m.removeEventListener("click",p,false);m.removeEventListener("mouseup",u,false);m.removeEventListener("touchend",u,false);m.removeEventListener("touchstart",g,false);if(l.options.scrollWheel==true){b.removeEventListener("mousewheel",v,false);b.removeEventListener("DOMMouseScroll",v,false)}l.flipCallback=null;l.animateF=null;l.stage.remove()}}l.prototype={add:function(e){if(e instanceof W)this.container.append(i(e.element));else this.container.append(i(e))},pan:function(e){var t=this.startPoint;var i=this.contentProvider.zoomScale;var n=this.left+(e.raw.x-t.raw.x),o=this.top+(e.raw.y-t.raw.y);this.left=Math.round(C(n,-this.shiftWidth,this.shiftWidth));this.top=Math.round(C(o,-this.shiftHeight,this.shiftHeight));this.startPoint=e;this.stage.css({transform:"translate3d("+this.left+"px,"+this.top+"px,0)"})},getPageByNumber:function(e){var t=D(this)?e:Math.floor((e-1)/2);var i;for(var n=0;n<this.pages.length;n++){if(t==parseInt(this.pages[n].name,10))i=this.pages[n]}return i},getPageSide:function(e){var i=this.direction==t.DIRECTION.RTL;var n=this.getPageByNumber(e);if(n==void 0)return;if(D(this))return n.back;if(e%2==0)return i?n.back:n.front;else return i?n.front:n.back},getContentLayer:function(e){var t=this.getPageSide(e);return t==void 0?void 0:t.contentLayer}};l.prototype.init=function(e){var t=this;t.stage=i(u.div,{class:"df-book-stage"});t.wrapper=i(u.div,{class:"df-book-wrapper"});t.shadow=i(u.div,{class:"df-book-shadow"});t.container.append(t.stage);t.stage.append(t.wrapper);t.wrapper.append(t.shadow);t.createStack(e)};l.prototype.createStack=function(e){var t="red,green,blue,yellow,orange,black".split(",");for(var i=0;i<this.stackCount;i++){e.angles=[,this.stackCount-i];e.stiffness=(this.stackCount-i)/100;var n=new W(e);n.angles[1]=180;n.index=i;n.parent=this;n.textureReady=false;n.textureRequested=false;this.wrapper.append(n.element);n.isFlipping=false;this.pages.push(n);n.color=t[i]}this.children=this.pages};l.prototype.isPageHard=function(e){return s.isHardPage(this.hardConfig,e,this.pageCount,D(this))};l.prototype.setDuration=function(e){this.duration=e};l.prototype.moveBy=function(e){var t=this._activePage+e;t=C(t,this.startPage,this.endPage);this.gotoPage(t)};l.prototype.next=function(e){if(e==void 0)e=this.direction==t.DIRECTION.RTL?-this.pageMode:this.pageMode;this.moveBy(e)};l.prototype.prev=function(e){if(e==void 0)e=this.direction==t.DIRECTION.RTL?this.pageMode:-this.pageMode;this.moveBy(e)};l.prototype.eventToPoint=function(e){e=R(e);var n=this.wrapper,o=this.pages,a=this.pageWidth,r=this.fullWidth,s=this.height,l=i(window),d={x:e.clientX,y:e.clientY};var f=d.x-n[0].getBoundingClientRect().left;var u=d.y-n[0].getBoundingClientRect().top;d.x=d.x-this.container[0].getBoundingClientRect().left;d.y=d.y-this.container[0].getBoundingClientRect().top;var h=this.drag==c.none?f<a?f:r-f:this.drag==c.left?f:r-f;var p=f<a?o[this.stackCount/2-1]:o[this.stackCount/2];var g=f<this.foldSense?c.left:f>r-this.foldSense?c.right:c.none;var v=f,m=u,b=s,w=r,P=this.foldSense,x=t.CORNERS,C;if(v>=0&&v<P){if(m>=0&&m<=P)C=x.TL;else if(m>=b-P&&m<=b)C=x.BL;else if(m>P&&m<b-P)C=x.L;else C=x.NONE}else if(v>=w-P&&v<=w){if(m>=0&&m<=P)C=x.TR;else if(m>=b-P&&m<=b)C=x.BR;else if(m>P&&m<b-P)C=x.R;else C=x.NONE}else C=x.NONE;return{isInsidePage:v>=0&&v<=w&&m>=0&&m<=b,isInside:C!==x.NONE&&C!==x.L&&C!==x.R,x:f,y:u,fullWidth:r,rawDistance:r-f,distance:h,page:p,drag:g,foldSense:this.foldSense,event:e,raw:d,corner:C}};l.prototype.gotoPage=function(e){e=parseInt(e,10);this._activePage=e;this.updatePage(e)};l.prototype.refresh=function(){this.updatePage(this._activePage);if(this.flipCallback!==void 0)this.flipCallback()};l.prototype.updatePage=function(e){var o=this.direction==t.DIRECTION.RTL,a=D(this),r=T(e);var s=a?1:2;e=Math.floor(e/s);if(o)e=this.pageCount/s-e;var l=this.oldBaseNumber||0;var d=this.pageCount/s;var f=this.stackCount;var u=Math.floor(f/2);if(l>e){this.children[f-1].skipFlip=true;this.children.unshift(this.children.pop())}else if(l<e){this.children[0].skipFlip=true;this.children.push(this.children.shift())}for(var h=0;h<f;h++){var p=this.children[h];if(l!==e){if(p.currentTween!==void 0){p.clearTween(true)}}var g=p.side;var v;var m=e-u+h;var b=p.name;p.isHard=this.isPageHard(m);if(p.isHard){p.element.addClass("df-hard-page")}else{p.element.removeClass("df-hard-page");p.front.css({display:"block"});p.back.css({display:"block"})}var w=i(p.element).attr("pageNumber");if(w!=m){p.front.contentLayer.empty();p.back.contentLayer.empty()}i(p.element).attr("pageNumber",m);p.visible=m>=0&&m<d||a&&m==d;if(this.requestPage!==void 0&&p.visible==true){if(o)m=Math.floor(this.pageCount/2)-m-1;p.name=m.toString();if(p.name!=b){p.backTextureLoaded=false;p.frontTextureLoaded=false;p.backPageStamp="-1";p.frontPageStamp="-1";p.thumbLoaded=false;p.front.contentLayer.html("");p.back.contentLayer.html("");p.frontImage(n.textureLoadFallback);p.backImage(n.textureLoadFallback);this.requestPage()}}p.isEdge=false;if(h==0){}else if(h==f-1){}else{p.isEdge=false}if(h<u){v=c.left}else{v=c.right}if(p.isFlipping==false){if(v!==g&&p.skipFlip==false){this.animatePage(p);if(this.preFlipCallback!==void 0)this.preFlipCallback()}else{p.skipFlip=false;p.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side");p.element.addClass(h<u?"df-left-side":"df-right-side");p.side=v}}if(a&&h<u&&p.isFlipping==false)p.visible=false;p.oldDepth=p.depth;p.updateCSS({display:p.visible==true?"block":"none",zIndex:6+(h<u?h-u:u-h),transform:""});if(p.pendingPoint==void 0){p.resetCSS()}}if(TWEEN.getAll().length==0){clearInterval(this.animate)}i(".quick-hint").html(e);this.oldBaseNumber=e;if(this.updatePageCallback!==void 0)this.updatePageCallback()};l.prototype.animatePage=function(e){e.element.addClass("df-flipping");e.isFlipping=true;if(this.animate!==void 0){clearInterval(this.animate)}this.animate=setInterval(this.animateF,30);e.tween(e.pendingPoint)};return l}({});var V=function(e){B(o,e);function o(n,o,a){e.call(this,a);var r=this;r.type="FlipBook";r.container=n;r.options=a;r.options.source=o;r.contentSource=o;if(a.height!==void 0&&a.height.toString().indexOf("%")<0){r.container.height(Math.min(a.height,i(window).height()))}else{r.container.height(a.height)}if(r.options.isLightBox){window.dfLightBox.closeButton.addClass(r.options.icons["close"])}if(!r.options.isLightBox&&r.container.attr("id")!==void 0){r.options.id=r.container.attr("id")}if(r.options.parsed!==true&&r.options.links!=void 0){t.parseLinks(r.options.links)}var s=r.webgl=a.webgl==true&&N==true;n.addClass("df-container df-loading df-init df-floating");if(r.options.transparent==true){n.addClass("df-transparent")}r.container.info=i(u.div,{class:"loading-info"}).appendTo(r.container).html("Cargando...");if(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0){r.options.webgl=false}if(!!navigator.userAgent.match(/msie\s[5-9]/i)){r.container.info.html("Your browser (Internet Explorer) is out of date to run DFlip Flipbook Plugin. <br><a href='http://browsehappy.com/'>Upgrade to a new one</a>").addClass("df-old-browser");n.removeClass("df-loading");return r}var l=a.backgroundImage==void 0||a.backgroundImage==""?"":"url('"+a.backgroundImage+"')";r.container.css({position:"relative",overflow:"hidden",backgroundColor:a.backgroundColor,backgroundImage:l});r.init(s,o);if(r.options.onCreate!==void 0)r.options.onCreate();return r}o.prototype.init=function(e){var o=this;var a=o.target;var r=o.options;if(e==true){var s=function(e){var i=function(){MOCKUP.defaults.anisotropy=0;MOCKUP.defaults.groundTexture="blank";THREE.skipPowerOfTwo=true;j();if(e!==void 0)e()};if(window.MOCKUP==void 0){o.updateInfo("Cargando WEBGL 3D ...");O(n.threejsSrc+"?ver="+t.version,function(){O(n.mockupjsSrc+"?ver="+t.version,function(){i()})})}else{i()}};s(function(){o.container.css({minHeight:300,minWidth:300});o.stage=new _(I(o.options,{container:o.container}));o.stage.previewObject=o;o.contentProvider=new H(o.contentSource,function(n){var r={pageCount:n.pageCount,stackCount:6,segments:20,width:300*n.pageRatio,height:300};o.checkOpenPage();o.target=a=o.stage.target=new MOCKUP.Book(I(o.options,r),o.stage);o.extendtarget();A(o.container,o);a.ui=o.ui;a.container=o.container;n.webgl=e;n.setTarget(o.target);a.getContentLayer=function(e){var i=a.direction==t.DIRECTION.RTL,n=o.stage.cssScene.divLeft.element,r=o.stage.cssScene.divRight.element;var s=T(a._activePage);if(D(a))return r;if(e%2==0)return i?r:n;else return i?n:r};a.stage=o.stage;a.flipCallback=function(){o.contentProvider.review("flipCallback");var e=T(a._activePage);var n,r;var s=a.getPageByNumber(e),l=a.getPageByNumber(e+1);var d=a.parent.cssScene.divLeft,c=a.parent.cssScene.divRight;var f=a.pageMode==t.PAGE_MODE.SINGLE;var u=a.direction==t.DIRECTION.RTL;if(s!==void 0&&d!==void 0){n=Math.abs(s.geometry.boundingBox.max.x-s.geometry.boundingBox.min.x);r=Math.abs(s.geometry.boundingBox.max.z-s.geometry.boundingBox.min.z);d.rotation.y=-Math.atan2(r,n)*.9;d.position.z=r*.8;d.position.x=r/2.5;i(d.element).css({width:n,left:-n/2})}if(l!==void 0&&c!==void 0){n=Math.abs(l.geometry.boundingBox.max.x-l.geometry.boundingBox.min.x);r=Math.abs(l.geometry.boundingBox.max.z-l.geometry.boundingBox.min.z);c.rotation.y=Math.atan2(r,n)*.9;c.position.z=r*.8;c.position.x=-r/2.5;i(c.element).css({width:n,left:n/2})}if(o.options.onFlip!==void 0)o.options.onFlip()};a.resize=function(){o.resize()}();a.updatePageCallback=function(){o.ui.update();o.checkCenter();o.stage.renderRequestPending=true};var s=i(o.stage.cssScene.divLeft.element);var l=i(o.stage.cssScene.divRight.element);a.preFlipCallback=function(){s.empty();l.empty();if(o.options.beforeFlip!==void 0)o.options.beforeFlip();o.playSound()};i(window).trigger("resize");s.css({width:300*n.pageRatio,height:300,left:-300*n.pageRatio/2});l.css({width:300*n.pageRatio,height:300,left:300*n.pageRatio/2});a.ease=TWEEN.Easing.Cubic.InOut;a.contentProvider=n;a.duration=o.options.duration;a.gotoPage(a._activePage);a.flipCallback();if(o.options.onReady!==void 0)o.options.onReady()},r,o)})}else{o.contentProvider=new H(o.contentSource,function(t){var n={pageCount:t.pageCount};o.checkOpenPage();o.target=a=new G(I(o.options,n),o.container);o.target.previewObject=o;o.extendtarget();A(o.container,o);t.webgl=e;t.setTarget(o.target);t.waitPeriod=2;a.ease=TWEEN.Easing.Quadratic.InOut;a.duration=o.options.duration;a.container=o.container;a.updatePageCallback=function(){o.ui.update();o.checkCenter()};a.gotoPage(a._activePage);a.resize=function(){o.resize()}();i(window).trigger("resize");a.flipCallback=function(){o.contentProvider.review("flipCallback");if(o.options.onFlip!==void 0)o.options.onFlip()};a.preFlipCallback=function(){if(o.options.beforeFlip!==void 0)o.options.beforeFlip();o.playSound()};if(o.options.onReady!==void 0)o.options.onReady()},r,o)}};o.prototype.extendtarget=function(){var e=this;e.target.reset=function(){for(var t=0;t<e.target.children.length;t++){var i=e.target.children[t];i.skipFlip=true;i.name="-2"}e.contentProvider.annotedPage="-2";e.target.refresh()}};o.prototype.getURLHash=function(){if(this.options.id!=void 0){var e="dflip-"+(this.options.slug!==void 0?this.options.slug:this.options.id)+"/";if(this.target!=void 0&&this.target._activePage!=void 0){e+=this.target._activePage+"/"}window.location.hash=e}return window.location.href};o.prototype.checkOpenPage=function(){if(this.options.id!=void 0){var e=i("#"+this.options.id);if(e.length>0&&e.data("page")!==void 0){var t=parseInt(e.data("page"),10);if(!isNaN(t))this.options.openPage=t}}};o.prototype.end=function(){this.target.gotoPage(this.target.endPage)};o.prototype.gotoPage=function(e){this.target.gotoPage(e);if(this.ui!==void 0)this.ui.update()};o.prototype.prev=function(){this.target.prev()};o.prototype.next=function(){this.target.next()};o.prototype.updateInfo=function(e){if(this.container&&this.container.info&&this.container.info.html)this.container.info.html(e)};return o}(U);i.fn.extend({shelf:function(){},flipBook:function(e,t){return new V(i(this),e,z(t))}})})(DFLIP,jQuery);(function(e){"use strict";e.URL=e.URL||e.webkitURL;if(e.Blob&&e.URL){try{new Blob;return}catch(e){}}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},i=function e(){this.data=[]},n=function e(t,i,n){this.data=t;this.size=t.length;this.type=i;this.encoding=n},o=i.prototype,a=n.prototype,r=e.FileReaderSync,s=function(e){this.code=this[this.name=e]},l=("NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "+"NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR").split(" "),d=l.length,c=e.URL||e.webkitURL||e,f=c.createObjectURL,u=c.revokeObjectURL,h=c,p=e.btoa,g=e.atob,v=e.ArrayBuffer,m=e.Uint8Array,b=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;n.fake=a.fake=true;while(d--){s.prototype[l[d]]=d+1}if(!c.createObjectURL){h=e.URL=function(e){var t=document.createElementNS("http://www.w3.org/1999/xhtml","a"),i;t.href=e;if(!("origin"in t)){if(t.protocol.toLowerCase()==="data:"){t.origin=null}else{i=e.match(b);t.origin=i&&i[1]}}return t}}h.createObjectURL=function(e){var t=e.type,i;if(t===null){t="application/octet-stream"}if(e instanceof n){i="data:"+t;if(e.encoding==="base64"){return i+";base64,"+e.data}else if(e.encoding==="URI"){return i+","+decodeURIComponent(e.data)}if(p){return i+";base64,"+p(e.data)}else{return i+","+encodeURIComponent(e.data)}}else if(f){return f.call(c,e)}};h.revokeObjectURL=function(e){if(e.substring(0,5)!=="data:"&&u){u.call(c,e)}};o.append=function(e){var i=this.data;if(m&&(e instanceof v||e instanceof m)){var o="",a=new m(e),l=0,d=a.length;for(;l<d;l++){o+=String.fromCharCode(a[l])}i.push(o)}else if(t(e)==="Blob"||t(e)==="File"){if(r){var c=new r;i.push(c.readAsBinaryString(e))}else{throw new s("NOT_READABLE_ERR")}}else if(e instanceof n){if(e.encoding==="base64"&&g){i.push(g(e.data))}else if(e.encoding==="URI"){i.push(decodeURIComponent(e.data))}else if(e.encoding==="raw"){i.push(e.data)}}else{if(typeof e!=="string"){e+=""}i.push(unescape(encodeURIComponent(e)))}};o.getBlob=function(e){if(!arguments.length){e=null}return new n(this.data.join(""),e,"raw")};o.toString=function(){return"[object BlobBuilder]"};a.slice=function(e,t,i){var o=arguments.length;if(o<3){i=null}return new n(this.data.slice(e,o>1?t:this.data.length),i,this.encoding)};a.toString=function(){return"[object Blob]"};a.close=function(){this.size=0;delete this.data};return i}(e);e.Blob=function(e,i){var n=i?i.type||"":"";var o=new t;if(e){for(var a=0,r=e.length;a<r;a++){if(Uint8Array&&e[a]instanceof Uint8Array){o.append(e[a].buffer)}else{o.append(e[a])}}}var s=o.getBlob(n);if(!s.slice&&s.webkitSlice){s.slice=s.webkitSlice}return s};var i=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=i(new e.Blob)})(window);(function(e){"use strict";var t=e.Uint8Array,i=e.HTMLCanvasElement,n=i&&i.prototype,o=/\s*;\s*base64\s*(?:;|$)/i,a="toDataURL",r,s=function(e){var i=e.length,n=new t(i/4*3|0),o=0,a=0,s=[0,0],l=0,d=0,c,f;while(i--){f=e.charCodeAt(o++);c=r[f-43];if(c!==255&&c!==void 0){s[1]=s[0];s[0]=f;d=d<<6|c;l++;if(l===4){n[a++]=d>>>16;if(s[1]!==61){n[a++]=d>>>8}if(s[0]!==61){n[a++]=d}l=0}}}return n};if(t){r=new t([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])}if(i&&!n.toBlob){n.toBlob=function(e,i){if(!i){i="image/png"}if(this.mozGetAsFile){e(this.mozGetAsFile("canvas",i));return}if(this.msToBlob&&/^\s*image\/png\s*(?:$|;)/i.test(i)){e(this.msToBlob());return}var n=Array.prototype.slice.call(arguments,1),r=this[a].apply(this,n),l=r.indexOf(","),d=r.substring(l+1),c=o.test(r.substring(0,l)),f;if(Blob.fake){f=new Blob;if(c){f.encoding="base64"}else{f.encoding="URI"}f.data=d;f.size=d.length}else if(t){if(c){f=new Blob([s(d)],{type:i})}else{f=new Blob([decodeURIComponent(d)],{type:i})}}e(f)};if(n.toDataURLHD){n.toBlobHD=function(){a="toDataURLHD";var e=this.toBlob();a="toDataURL";return e}}else{n.toBlobHD=n.toBlob}}})(window);(function e(){if("performance"in window===false){window.performance={}}Date.now=Date.now||function(){return(new Date).getTime()};if("now"in window.performance===false){var t=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-t}}})();(function e(){var t=t||function(){var e=[];return{getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);if(i!==-1){e.splice(i,1)}},update:function(t){if(e.length===0){return false}var i=0;t=t!==void 0?t:window.performance.now();while(i<e.length){if(e[i].update(t)){i++}else{e.splice(i,1)}}return true}}}();t.Tween=function(e){var i=e;var n={};var o={};var a={};var r=1e3;var s=0;var l=false;var d=false;var c=false;var f=0;var u=null;var h=t.Easing.Linear.None;var p=t.Interpolation.Linear;var g=[];var v=null;var m=false;var b=null;var w=null;var P=null;for(var x in e){n[x]=parseFloat(e[x],10)}this.to=function(e,t){if(t!==void 0){r=t}o=e;return this};this.start=function(e){t.add(this);d=true;m=false;u=e!==void 0?e:window.performance.now();u+=f;for(var r in o){if(o[r]instanceof Array){if(o[r].length===0){continue}o[r]=[i[r]].concat(o[r])}if(n[r]===void 0){continue}n[r]=i[r];if(n[r]instanceof Array===false){n[r]*=1}a[r]=n[r]||0}return this};this.stop=function(){if(!d){return this}t.remove(this);d=false;if(P!==null){P.call(i)}this.stopChainedTweens();return this};this.stopChainedTweens=function(){for(var e=0,t=g.length;e<t;e++){g[e].stop()}};this.complete=function(){if(!d){return this}t.remove(this);d=false;if(w!==null){w.call(i)}this.completeChainedTweens();return this};this.completeChainedTweens=function(){for(var e=0,t=g.length;e<t;e++){g[e].complete()}};this.delay=function(e){f=e;return this};this.repeat=function(e){s=e;return this};this.yoyo=function(e){l=e;return this};this.easing=function(e){h=e==void 0?h:e;return this};this.interpolation=function(e){p=e;return this};this.chain=function(){g=arguments;return this};this.onStart=function(e){v=e;return this};this.onUpdate=function(e){b=e;return this};this.onComplete=function(e){w=e;return this};this.onStop=function(e){P=e;return this};this.update=function(e){var t;var d;var P;if(e<u){return true}if(m===false){if(v!==null){v.call(i)}m=true}d=(e-u)/r;d=d>1?1:d;P=h(d);for(t in o){if(n[t]===void 0){continue}var x=n[t]||0;var C=o[t];if(C instanceof Array){i[t]=p(C,P)}else{if(typeof C==="string"){if(C.startsWith("+")||C.startsWith("-")){C=x+parseFloat(C,10)}else{C=parseFloat(C,10)}}if(typeof C==="number"){i[t]=x+(C-x)*P}}}if(b!==null){b.call(i,P)}if(d===1){if(s>0){if(isFinite(s)){s--}for(t in a){if(typeof o[t]==="string"){a[t]=a[t]+parseFloat(o[t],10)}if(l){var y=a[t];a[t]=o[t];o[t]=y}n[t]=a[t]}if(l){c=!c}u=e+f;return true}else{if(w!==null){w.call(i)}for(var E=0,k=g.length;E<k;E++){g[E].start(u+r)}return false}}return true}};t.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){if((e*=2)<1){return.5*e*e}return-.5*(--e*(e-2)-1)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){if((e*=2)<1){return.5*e*e*e*e}return-.5*((e-=2)*e*e*e-2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){if((e*=2)<1){return.5*e*e*e}return.5*((e-=2)*e*e+2)}}};t.Interpolation={Linear:function(e,i){var n=e.length-1;var o=n*i;var a=Math.floor(o);var r=t.Interpolation.Utils.Linear;if(i<0){return r(e[0],e[1],o)}if(i>1){return r(e[n],e[n-1],n-o)}return r(e[a],e[a+1>n?n:a+1],o-a)},Bezier:function(e,i){var n=0;var o=e.length-1;var a=Math.pow;var r=t.Interpolation.Utils.Bernstein;for(var s=0;s<=o;s++){n+=a(1-i,o-s)*a(i,s)*e[s]*r(o,s)}return n},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,i){var n=t.Interpolation.Utils.Factorial;return n(e)/n(i)/n(e-i)},Factorial:function(){var e=[1];return function(t){var i=1;if(e[t]){return e[t]}for(var n=t;n>1;n--){i*=n}e[t]=i;return i}}(),CatmullRom:function(e,t,i,n,o){var a=(i-e)*.5;var r=(n-t)*.5;var s=o*o;var l=o*s;return(2*t-2*i+a+r)*l+(-3*t+3*i-2*a-r)*s+a*o+t}}};window.TWEEN=t})();DFLIP.createBlob=function e(t,i){if(typeof Blob!=="undefined"){return new Blob([t],{type:i})}var n=new MozBlobBuilder;n.append(t);return n.getBlob(i)};DFLIP.createObjectURL=function e(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function e(i,n){if(typeof URL!=="undefined"&&URL.createObjectURL){var o=DFLIP.createBlob(i,n);return URL.createObjectURL(o)}var a="data:"+n+";base64,";for(var r=0,s=i.length;r<s;r+=3){var l=i[r]&255;var d=i[r+1]&255;var c=i[r+2]&255;var f=l>>2,u=(l&3)<<4|d>>4;var h=r+1<s?(d&15)<<2|c>>6:64;var p=r+2<s?c&63:64;a+=t[f]+t[u]+t[h]+t[p]}return a}}();var ThumbList=function e(){function t(e){var i=e&&e.w+"px"||"100%";var n=e&&e.h+"px"||"100%";var o=this.itemHeight=e.itemHeight;this.items=e.items;this.generatorFn=e.generatorFn;this.totalRows=e.totalRows||e.items&&e.items.length;this.addFn=e.addFn;this.scrollFn=e.scrollFn;var a=t.createScroller(o*this.totalRows);this.container=t.createContainer(i,n);this.container.appendChild(a);this.screenItemsLen=Math.ceil(e.h/o);this.offsetItems=this.screenItemsLen;this.cachedItemsLen=this.screenItemsLen+this.offsetItems*2;this._renderChunk(this.container,0);var r=this;r.lastRepaintY=0;var s=this.screenItemsLen*o;var l=0;var d;function c(e){var t=e.target.scrollTop;if(!r.lastRepaintY||Math.abs(t-r.lastRepaintY)>=r.offsetItems*r.itemHeight){var i=parseInt(t/o,10)-r.offsetItems;r._renderChunk(r.container,i<0?0:i);r.lastRepaintY=t}r.lastScrolled=l=Date.now();if(r.scrollFn!==void 0){r.scrollFn()}e.preventDefault&&e.preventDefault()}r.dispose=function(){if(r.container){if(r.container.parentNode){r.container.parentNode.removeChild(r.container)}}r.container.removeEventListener("scroll",c)};r.container.addEventListener("scroll",c)}t.prototype.reset=function(e){this.screenItemsLen=Math.ceil(e/this.itemHeight);this.cachedItemsLen=this.screenItemsLen+this.offsetItems*2;var t=parseInt(this.lastRepaintY/this.itemHeight,10)-this.offsetItems;this.needReset=true;this._renderChunk(this.container,Math.max(t,0))};t.prototype.createRow=function(e){var t;if(this.generatorFn){t=this.generatorFn(e);t.classList.add("df-vrow");t.style.position="absolute";t.style.top=e*this.itemHeight+"px";t.setAttribute("index",e)}return t};t.prototype._renderChunk=function(e,t){var i=this.range==void 0;this.range=this.range||{min:0,max:this.cachedItemsLen};var n=this.range;var o=n.min,a=n.max;var r=i?true:t>=o;if(!i&&t==o&&this.needReset==false)return;var s;var l=i?o:r?a:t;l=l>this.totalRows?this.totalRows:l<0?0:l;var d=t+this.cachedItemsLen;d=d>this.totalRows?this.totalRows:d;for(s=l;s<d;s++){if(r)e.appendChild(this.createRow(s));else e.insertBefore(this.createRow(s),e.childNodes[1+s-l]);if(this.addFn!==void 0){this.addFn(s)}}var c=Math.abs(t-o);this.needReset=false;if(!i&&e.childNodes.length>this.cachedItemsLen+1){var f=r?1:1+this.cachedItemsLen,u=f+(d-l);for(var h=u;h>f;h--){if(e.childNodes[f])this.container.removeChild(e.childNodes[f])}}this.range.min=t;this.range.max=d};t.createContainer=function(e,t){var i=document.createElement("div");i.style.width=e;i.style.height=t;i.style.overflow="auto";i.style.position="relative";i.style.padding=0;return i};t.createScroller=function(e){var t=document.createElement("div");t.style.opacity=0;t.style.position="absolute";t.style.top=0;t.style.left=0;t.style.width="1px";t.style.height=e+"px";return t};return t}();var BookMarkViewer=function e(){function t(e){this.outline=null;this.lastToggleIsShow=true;this.container=e.container;this.linkService=e.linkService;this.outlineItemClass=e.outlineItemClass||"outlineItem";this.outlineToggleClass=e.outlineToggleClass||"outlineItemToggler";this.outlineToggleHiddenClass=e.outlineToggleHiddenClass||"outlineItemsHidden"}t.prototype={dispose:function(){if(this.container){if(this.container.parentNode){this.container.parentNode.removeChild(this.container)}}this.linkService=null},reset:function e(){this.outline=null;this.lastToggleIsShow=true;var t=this.container;while(t.firstChild){t.removeChild(t.firstChild)}},_dispatchEvent:function e(t){var i=document.createEvent("CustomEvent");i.initCustomEvent("outlineloaded",true,true,{outlineCount:t});this.container.dispatchEvent(i)},_bindLink:function e(t,i){var n=this.linkService;if(i.custom==true){t.href=n.getCustomDestinationHash(i.dest);t.onclick=function e(t){n.customNavigateTo(i.dest);return false}}else{if(i.url){PDFJS.addLinkAttributes(t,{url:i.url});return}t.href=n.getDestinationHash(i.dest);t.onclick=function e(t){n.navigateTo(i.dest);return false}}},_addToggleButton:function e(t){var i=document.createElement("div");i.className=this.outlineToggleClass+" "+this.outlineToggleHiddenClass;i.onclick=function(e){e.stopPropagation();i.classList.toggle(this.outlineToggleHiddenClass);if(e.shiftKey){var n=!i.classList.contains(this.outlineToggleHiddenClass);this._toggleOutlineItem(t,n)}}.bind(this);t.insertBefore(i,t.firstChild)},_toggleOutlineItem:function e(t,i){this.lastToggleIsShow=i;var n=t.querySelectorAll("."+this.outlineToggleClass);for(var o=0,a=n.length;o<a;++o){n[o].classList[i?"remove":"add"](this.outlineToggleHiddenClass)}},toggleOutlineTree:function e(){if(!this.outline){return}this._toggleOutlineItem(this.container,!this.lastToggleIsShow)},render:function e(t){var i=t&&t.outline||null;var n=0;if(this.outline){this.reset()}this.outline=i;if(!i){return}var o=document.createDocumentFragment();var a=[{parent:o,items:this.outline}];var r=false;while(a.length>0){var s=a.shift();var l=s.custom;for(var d=0,c=s.items.length;d<c;d++){var f=s.items[d];var u=document.createElement("div");u.className=this.outlineItemClass;var h=document.createElement("a");if(f.custom==void 0&&l!==void 0)f.custom=l;this._bindLink(h,f);h.textContent=f.title.replace(/\x00/g,"");u.appendChild(h);if(f.items&&f.items.length>0){r=true;this._addToggleButton(u);var p=document.createElement("div");p.className=this.outlineItemClass+"s";u.appendChild(p);a.push({parent:p,custom:f.custom,items:f.items})}s.parent.appendChild(u);n++}}if(r){if(this.container.classList!=void 0){this.container.classList.add(this.outlineItemClass+"s")}else if(this.container.className!=void 0){this.container.className+=" picWindow"}}this.container.appendChild(o);this._dispatchEvent(n)}};return t}();var DFLightBox=function e(t){function i(e,i){this.duration=300;var n=this;n.lightboxWrapper=t("<div>").addClass("df-lightbox-wrapper");n.container=t("<div>").addClass("df-container").appendTo(n.lightboxWrapper);n.controls=t("<div>").addClass("df-lightbox-controls").appendTo(n.lightboxWrapper);n.closeButton=t("<div>").addClass("df-lightbox-close df-ui-btn").on("click",function(){n.close(e)}).appendTo(n.controls);n.lightboxWrapper.append(n.container);return n}i.prototype.show=function(e){if(this.lightboxWrapper.parent().length==0)t("body").append(this.lightboxWrapper);this.lightboxWrapper.fadeIn(this.duration,e);return this};i.prototype.close=function(e){this.lightboxWrapper.fadeOut(this.duration,e);return this};return i}(jQuery);DFLIP.Share=function e(t){function i(e,i){var n=this;var o="<div>";var a="df-share-button";var r="width=500,height=400";n.isOpen=false;n.shareUrl="";n.wrapper=t('<div class="df-share-wrapper" style="display: none;">').on("click",function(e){n.close()});n.box=t('<div class="df-share-box">').on("click",function(e){e.preventDefault();e.stopPropagation()}).appendTo(n.wrapper).html('<span class="df-share-title">'+i.text.share+"</span>");n.urlInput=t('<textarea class="df-share-url">').on("click",function(){t(this).select()});n.facebook=t(o,{class:a+" df-share-facebook "+i.icons["facebook"]}).on("click",function(e){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(n.shareUrl),"Sharer",r)});n.google=t(o,{class:a+" df-share-google "+i.icons["google"]}).on("click",function(e){window.open("https://plus.google.com/share?url="+encodeURIComponent(n.shareUrl),"Sharer",r)});n.twitter=t(o,{class:a+" df-share-twitter "+i.icons["twitter"]}).on("click",function(e){window.open("http://twitter.com/share?url="+encodeURIComponent(n.shareUrl),"Sharer",r)});n.box.append(n.urlInput).append(n.facebook).append(n.twitter);t(e).append(n.wrapper)}i.prototype.show=function(){this.wrapper.fadeIn(300);this.urlInput.val(this.shareUrl);this.urlInput.trigger("click");this.isOpen=true};i.prototype.dispose=function(){var e=this;e.box.off();e.google.off();e.twitter.off();e.facebook.off();e.urlInput.off();e.wrapper.off().remove()};i.prototype.close=function(){this.wrapper.fadeOut(300);this.isOpen=false};i.prototype.update=function(e){this.shareUrl=e};return i}(jQuery);var PDFLinkService=function(){function e(){this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null}e.prototype={dispose:function(){this.baseUrl=null;this.pdfDocument=null;this.pdfViewer=null;this.pdfHistory=null;this._pagesRefCache=null},setDocument:function e(t,i){this.baseUrl=i;this.pdfDocument=t;this._pagesRefCache=Object.create(null)},setViewer:function e(t){this.pdfViewer=t},setHistory:function e(t){this.pdfHistory=t},get pagesCount(){return this.pdfDocument.numPages},get page(){return this.pdfViewer.currentPageNumber},set page(e){this.pdfViewer.currentPageNumber=e},navigateTo:function e(t){var i="";var n=this;var o=function(e){var a=e instanceof Object?n._pagesRefCache[e.num+" "+e.gen+" R"]:e+1;if(a){if(a>n.pagesCount){a=n.pagesCount}n.pdfViewer.gotoPage(a);if(n.pdfHistory){n.pdfHistory.push({dest:t,hash:i,page:a})}}else{n.pdfDocument.getPageIndex(e).then(function(t){var i=t+1;var a=e.num+" "+e.gen+" R";n._pagesRefCache[a]=i;o(e)})}};var a;if(typeof t==="string"){i=t;a=this.pdfDocument.getDestination(t)}else{a=Promise.resolve(t)}a.then(function(e){t=e;if(!(e instanceof Array)){return}o(e[0])})},customNavigateTo:function e(t){if(t==""||t==void 0||t=="void 0")return;var i=void 0;if(!isNaN(Math.round(t))){i=t}else if(typeof t==="string"){i=parseInt(t.replace("#",""),10);if(isNaN(i)){window.open(t);return}}if(i!==void 0)this.pdfViewer.gotoPage(i)},getDestinationHash:function e(t){if(typeof t==="string"){return this.getAnchorUrl("#"+escape(t))}if(t instanceof Array){var i=t[0];var n=i instanceof Object?this._pagesRefCache[i.num+" "+i.gen+" R"]:i+1;if(n){var o=this.getAnchorUrl("#page="+n);var a=t[1];if(typeof a==="object"&&"name"in a&&a.name==="XYZ"){var r=t[4]||this.pdfViewer.currentScaleValue;var s=parseFloat(r);if(s){r=s*100}o+="&zoom="+r;if(t[2]||t[3]){o+=","+(t[2]||0)+","+(t[3]||0)}}return o}}return this.getAnchorUrl("")},getCustomDestinationHash:function e(t){return"#"+escape(t)},getAnchorUrl:function e(t){return(this.baseUrl||"")+t},setHash:function e(t){if(t.indexOf("=")>=0){var i=parseQueryString(t);if("nameddest"in i){if(this.pdfHistory){this.pdfHistory.updateNextHashParam(i.nameddest);
}this.navigateTo(i.nameddest);return}var n,o;if("page"in i){n=i.page|0||1}if("zoom"in i){var a=i.zoom.split(",");var r=a[0];var s=parseFloat(r);if(r.indexOf("Fit")===-1){o=[null,{name:"XYZ"},a.length>1?a[1]|0:null,a.length>2?a[2]|0:null,s?s/100:r]}else{if(r==="Fit"||r==="FitB"){o=[null,{name:r}]}else if(r==="FitH"||r==="FitBH"||(r==="FitV"||r==="FitBV")){o=[null,{name:r},a.length>1?a[1]|0:null]}else if(r==="FitR"){if(a.length!==5){console.error("PDFLinkService_setHash: "+"Not enough parameters for 'FitR'.")}else{o=[null,{name:r},a[1]|0,a[2]|0,a[3]|0,a[4]|0]}}else{console.error("PDFLinkService_setHash: '"+r+"' is not a valid zoom value.")}}}if(o){this.pdfViewer.scrollPageIntoView(n||this.page,o)}else if(n){this.page=n}if("pagemode"in i){var l=document.createEvent("CustomEvent");l.initCustomEvent("pagemode",true,true,{mode:i.pagemode});this.pdfViewer.container.dispatchEvent(l)}}else if(/^\d+$/.test(t)){this.page=t}else{if(this.pdfHistory){this.pdfHistory.updateNextHashParam(unescape(t))}this.navigateTo(unescape(t))}},executeNamedAction:function e(t){switch(t){case"GoBack":if(this.pdfHistory){this.pdfHistory.back()}break;case"GoForward":if(this.pdfHistory){this.pdfHistory.forward()}break;case"NextPage":this.page++;break;case"PrevPage":this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}var i=document.createEvent("CustomEvent");i.initCustomEvent("namedaction",true,true,{action:t});this.pdfViewer.container.dispatchEvent(i)},cachePageRef:function e(t,i){var n=i.num+" "+i.gen+" R";this._pagesRefCache[n]=t}};return e}();DFLIP.TextLayerBuilder=function e(){function t(e){this.textLayerDiv=e.textLayerDiv;this.renderingDone=false;this.divContentDone=false;this.pageIdx=e.pageIndex;this.pageNumber=this.pageIdx+1;this.matches=[];this.viewport=e.viewport;this.textDivs=[];this.findController=e.findController||null;this.textLayerRenderTask=null;this.enhanceTextSelection=e.enhanceTextSelection;this._bindMouse()}t.prototype={_finishRendering:function e(){this.renderingDone=true;if(!this.enhanceTextSelection){var t=document.createElement("div");t.className="endOfContent";this.textLayerDiv.appendChild(t)}},render:function e(t){if(!this.divContentDone||this.renderingDone){return}if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}this.textDivs=[];var i=document.createDocumentFragment();this.textLayerRenderTask=PDFJS.renderTextLayer({textContent:this.textContent,container:i,viewport:this.viewport,textDivs:this.textDivs,timeout:t,enhanceTextSelection:this.enhanceTextSelection});this.textLayerRenderTask.promise.then(function(){this.textLayerDiv.appendChild(i);this._finishRendering();this.updateMatches()}.bind(this),function(e){})},setTextContent:function e(t){if(this.textLayerRenderTask){this.textLayerRenderTask.cancel();this.textLayerRenderTask=null}this.textContent=t;this.divContentDone=true},convertMatches:function e(t,i){var n=0;var o=0;var a=this.textContent.items;var r=a.length-1;var s=this.findController===null?0:this.findController.state.query.length;var l=[];if(!t){return l}for(var d=0,c=t.length;d<c;d++){var f=t[d];while(n!==r&&f>=o+a[n].str.length){o+=a[n].str.length;n++}if(n===a.length){console.error("Could not find a matching mapping")}var u={begin:{divIdx:n,offset:f-o}};if(i){f+=i[d]}else{f+=s}while(n!==r&&f>o+a[n].str.length){o+=a[n].str.length;n++}u.end={divIdx:n,offset:f-o};l.push(u)}return l},renderMatches:function e(t){if(t.length===0){return}var i=this.textContent.items;var n=this.textDivs;var o=null;var a=this.pageIdx;var r=this.findController===null?false:a===this.findController.selected.pageIdx;var s=this.findController===null?-1:this.findController.selected.matchIdx;var l=this.findController===null?false:this.findController.state.highlightAll;var d={divIdx:-1,offset:undefined};function c(e,t){var i=e.divIdx;n[i].textContent="";f(i,0,e.offset,t)}function f(e,t,o,a){var r=n[e];var s=i[e].str.substring(t,o);var l=document.createTextNode(s);if(a){var d=document.createElement("span");d.className=a;d.appendChild(l);r.appendChild(d);return}r.appendChild(l)}var u=s,h=u+1;if(l){u=0;h=t.length}else if(!r){return}for(var p=u;p<h;p++){var g=t[p];var v=g.begin;var m=g.end;var b=r&&p===s;var w=b?" selected":"";if(this.findController){this.findController.updateMatchPosition(a,p,n,v.divIdx)}if(!o||v.divIdx!==o.divIdx){if(o!==null){f(o.divIdx,o.offset,d.offset)}c(v)}else{f(o.divIdx,o.offset,v.offset)}if(v.divIdx===m.divIdx){f(v.divIdx,v.offset,m.offset,"highlight"+w)}else{f(v.divIdx,v.offset,d.offset,"highlight begin"+w);for(var P=v.divIdx+1,x=m.divIdx;P<x;P++){n[P].className="highlight middle"+w}c(m,"highlight end"+w)}o=m}if(o){f(o.divIdx,o.offset,d.offset)}},updateMatches:function e(){if(!this.renderingDone){return}var t=this.matches;var i=this.textDivs;var n=this.textContent.items;var o=-1;for(var a=0,r=t.length;a<r;a++){var s=t[a];var l=Math.max(o,s.begin.divIdx);for(var d=l,c=s.end.divIdx;d<=c;d++){var f=i[d];f.textContent=n[d].str;f.className=""}o=s.end.divIdx+1}if(this.findController===null||!this.findController.active){return}var u,h;if(this.findController!==null){u=this.findController.pageMatches[this.pageIdx]||null;h=this.findController.pageMatchesLength?this.findController.pageMatchesLength[this.pageIdx]||null:null}this.matches=this.convertMatches(u,h);this.renderMatches(this.matches)},_bindMouse:function e(){var t=this.textLayerDiv;var i=this;t.addEventListener("mousedown",function(e){if(i.enhanceTextSelection&&i.textLayerRenderTask){i.textLayerRenderTask.expandTextDivs(true);return}var n=t.querySelector(".endOfContent");if(!n){return}var o=e.target!==t;o=o&&window.getComputedStyle(n).getPropertyValue("-moz-user-select")!=="none";if(o){var a=t.getBoundingClientRect();var r=Math.max(0,(e.pageY-a.top)/a.height);n.style.top=(r*100).toFixed(2)+"%"}n.classList.add("active")});t.addEventListener("mouseup",function(e){if(i.enhanceTextSelection&&i.textLayerRenderTask){i.textLayerRenderTask.expandTextDivs(false);return}var n=t.querySelector(".endOfContent");if(!n){return}n.style.top="";n.classList.remove("active")})}};return t}();DFLIP.ConvertPageLinks=function(){var e=arguments[0]/100,t=arguments[1]/100;var i=function(i,n,o,a,r){return{x:i/e,y:n/t,w:o/e,h:a/t,dest:r}};var n=[];var o;for(var a=2;a<arguments.length;a++){o=arguments[a];n[a-2]=i.apply(this,o)}return n};DFLIP.parseLinks=function(e){var t;if(e!==void 0&&e.length>0){for(var i=0;i<e.length;i++){t=e[i];if(t!==void 0&&t[0]!==void 0&&t[0].dest==void 0){t=DFLIP.ConvertPageLinks.apply(this,t);e[i]=t}}}return e};(function(e){function t(e){return e=="true"||e==true}function i(e){if(e.webgl!==void 0)e.webgl=t(e.webgl);if(e.enableDownload!==void 0)e.enableDownload=t(e.enableDownload);if(e.scrollWheel!==void 0)e.scrollWheel=t(e.scrollWheel);if(e.autoEnableOutline!==void 0)e.autoEnableOutline=t(e.autoEnableOutline);if(e.autoEnableThumbnail!==void 0)e.autoEnableThumbnail=t(e.autoEnableThumbnail);if(e.transparent!==void 0)e.transparent=t(e.transparent);if(e.overwritePDFOutline!==void 0)e.overwritePDFOutline=t(e.overwritePDFOutline);if(e.soundEnable!==void 0)e.soundEnable=t(e.soundEnable);if(e.forceFit!==void 0)e.forceFit=t(e.forceFit);if(e.enableAnnotation!==void 0)e.enableAnnotation=t(e.enableAnnotation);if(e.webglShadow!==void 0)e.webglShadow=t(e.webglShadow);if(e.minTopOffset!==void 0)e.minTopOffset=parseInt(e.minTopOffset,10);if(e.zoomRatio!==void 0)e.zoomRatio=parseFloat(e.zoomRatio,10);if(e.pageMode==0||e.pageMode=="0")e.pageMode=void 0;if(e.singlePageMode==0||e.singlePageMode=="0")e.singlePageMode=void 0}function n(e){if(e.parsed==true)return;e.parsed=true;var t=[];i(e);if(typeof dFlipWPGlobal!=="undefined"&&e.wpOptions=="true"){try{for(var n in e.links){var o=e.links[n];var a=[100,100];for(var r=0;r<o.length;r++){var s=o[r];var l=s.replace("[","").replace("]","").split(",");var d=[];for(var c=0;c<5;c++){d[c]=l[c]}a.push(d)}t[parseInt(n,10)+1]=a}}catch(e){console.error(e.stack)}e.links=DFLIP.parseLinks(t)}else{e.links=DFLIP.parseLinks(e.links)}}DFLIP.getOptions=function(t){t=e(t);var i=t.attr("id");var o="option_"+i,a=t.attr("source")||t.attr("df-source");o=o==void 0||o==""||window[o]==void 0?{}:window[o];o.source=a==void 0||a==""?o.source:a;var r={webgl:t.attr("webgl"),height:t.attr("height"),soundEnable:t.attr("sound"),transparent:t.attr("transparent"),enableDownload:t.attr("download"),duration:t.attr("duration"),hard:t.attr("hard"),pageMode:t.attr("pagemode"),direction:t.attr("direction"),backgroundColor:t.attr("backgroundcolor"),scrollWheel:t.attr("scrollwheel"),backgroundImage:t.attr("backgroundimage"),minTopOffset:t.attr("mintopoffset"),wpOptions:t.attr("wpoptions")};o=e.extend(true,{},o,r);n(o);return o};DFLIP.parseBooks=function(){e("._df_button, ._df_thumb, ._df_custom, ._df_book").each(function(){var t=e(this);var i=t.attr("parsed")||t.attr("df-parsed");if(i!=="true"){t.attr("df-parsed","true");if(t.hasClass("_df_book")){var n=t.attr("id"),o=t.attr("slug");var a=DFLIP.getOptions(t);a.id=n;if(o!==void 0)a.slug=o;if(n){window[n.toString()]=e(t).flipBook(a.source,a)}else{e(t).flipBook(a.source,a)}}else{t.on("click",function(){var t=e(this);if(!window.dfLightBox){window.dfLightBox=new DFLightBox(function(){window.location.hash="";window.dfActiveLightBoxBook.dispose();window.dfActiveLightBoxBook=null})}window.dfLightBox.duration=500;if(window.dfActiveLightBoxBook&&window.dfActiveLightBoxBook.dispose){window.dfActiveLightBoxBook.dispose()}else{window.dfLightBox.show(function(){var i=DFLIP.getOptions(t);i.transparent=false;i.id=t.attr("id");var n=t.attr("slug");if(n!==void 0)i.slug=n;i.isLightBox=true;window.dfActiveLightBoxBook=e(window.dfLightBox.container).flipBook(i.source,i)})}});if(t.hasClass("_df_thumb")){var r=e("<div class='_df_book-cover'>");var s=t.html();t.html("");var l=e("<span class='_df_book-title'>").html(s).appendTo(r);var d=t.attr("thumb")||t.attr("df-thumb"),c=t.attr("tags")||t.attr("df-tags");if(c){c=c.split(",");if(c.length>0){for(var f=0;f<c.length;f++){t.append("<span class='_df_book-tag'>"+c[f]+"</span>")}}}if(d!==void 0&&d.toString().trim()!=""){r.css({backgroundImage:"url("+d+")"})}else{r.addClass("_df_thumb-not-found")}t.append(r)}}}})};e(document).ready(function(){if(typeof dFlipLocation!=="undefined"){if(dFlipLocation.length>2&&dFlipLocation.slice(-1)!=="/"){dFlipLocation+="/"}DFLIP.defaults.mockupjsSrc=dFlipLocation+"js/libs/mockup.min.js";DFLIP.defaults.pdfjsSrc=dFlipLocation+"js/libs/pdf.min.js";DFLIP.defaults.pdfjsCompatibilitySrc=dFlipLocation+"js/libs/compatibility.js";DFLIP.defaults.threejsSrc=dFlipLocation+"js/libs/three.min.js";DFLIP.defaults.pdfjsWorkerSrc=dFlipLocation+"js/libs/pdf.worker.min.js";DFLIP.defaults.soundFile=dFlipLocation+"sound/turn2.mp3";if(typeof dFlipWPGlobal!=="undefined"){i(dFlipWPGlobal);e.extend(DFLIP.defaults,dFlipWPGlobal)}}DFLIP.preParseHash=window.location.hash;DFLIP.parseBooks();if(DFLIP.preParseHash&&DFLIP.preParseHash.indexOf("dflip-")>=0){var t=DFLIP.preParseHash.split("dflip-")[1].split("/")[0];var n=DFLIP.preParseHash.split("dflip-")[1].split("/")[1];if(n!=void 0){n=n.split("/")[0]}var o;o=e("[slug="+t+"]");if(o.length==0)o=e("#"+t);if(o.length>0){if(n!=void 0){o.data("page",n)}if(o.is("._df_button, ._df_thumb, ._df_custom")){o.trigger("click")}}}})})(jQuery);