Mister Spy Say ="Hello Kids ... :D" ___ ____ _ _____ | \/ (_) | | / ___| | . . |_ ___| |_ ___ _ __ \ `--. _ __ _ _ | |\/| | / __| __/ _ \ '__| `--. \ '_ \| | | | | | | | \__ \ || __/ | /\__/ / |_) | |_| | \_| |_/_|___/\__\___|_| \____/| .__/ \__, | | | __/ | |_| |___/ Bot Mister Spy V3
Mister Spy

Mister Spy

Current Path : /home/caballoscriollos/www/revistas/js/
Upload File :
Current File : /home/caballoscriollos/www/revistas/js/flipbook.webgl.min.js

/* v 2.40
author http://codecanyon.net/user/creativeinteractivemedia/portfolio?ref=creativeinteractivemedia
*/

var FLIPBOOK=FLIPBOOK||{};FLIPBOOK.PageWebGL=function(t,e,i,o,s,n,r,h){THREE.Object3D.call(this),this.book=t,this.frontTexture=i,this.backTexture=o,this.index=e,this.materialType=n.pageMaterial,this.pW=n.pageWidth,this.pH=n.pageHeight,this.nfacesw=n.pageSegmentsW,this.nfacesh=n.pageSegmentsH,this.mats=[],this.pageHardness=s,this.pageThickness=s,this.duration=n.pageFlipDuration,this.angle=.25*Math.PI*this.pW/this.pH,this.force=10,this.offset=0,this.to=null,this.mod=null,this.bend=null,this.pivot=null,this.isFlippedLeft=!1,this.isFlippedRight=!0,this.flippingLeft=!1,this.flippingRight=!1,this.options=n,this.loadedF={},this.loadedB={},this.frontMaterials={},this.backMaterials={},this.frontTextures={},this.backTextures={},this.showing=!1,this.preloaderMatF=r,this.preloaderMatB=h,this.gF=new THREE.BoxGeometry(this.pW,this.pH,.01,this.nfacesw,this.nfacesh,0);var a=new THREE.MeshBasicMaterial({color:15592941}),p=[a,a,a,a,r,h],c=[a,a,a,a,a,a];new THREE.MeshBasicMaterial({color:16711680});this.cube=new THREE.Mesh(this.gF,p),this.cube.position.x=.5*this.pW,this.gF.faceVertexUvs[1]=this.gF.faceVertexUvs[0],this.showMat(),this.cubeEmpty=new THREE.Mesh(new THREE.BoxGeometry(this.pW,this.pH,.01,1,1,0),c),this.cubeEmpty.position.x=.5*this.pW,this.pageFlippedAngle=Math.PI*this.options.pageFlippedAngle/180,this.bendF=new MOD3.Bend(0,0,0),this.bendF.constraint=MOD3.ModConstant.LEFT,this.pH>this.pW&&(this.bendF.switchAxes=!0),this.b2=new MOD3.Bend(0,0,0),this.b2.constraint=MOD3.ModConstant.RIGHT,this.pH>this.pW&&(this.b2.switchAxes=!0),this.b2.force=Math.PI/2,this.b2.offset=.1,this.modF=new MOD3.ModifierStack(new MOD3.LibraryThree,this.cube),this.modF.addModifier(this.bendF),this.modF.apply(),this.frontMaterials={},this.backMaterials={};var u=this;jQuery(n.main).bind("pageLoaded",function(t,e,i){var o=u.options.rightToLeft?u.book.pages.length-u.index-1:u.index,s=u.options.rightToLeft?2*o+1:2*o,n=u.options.rightToLeft?2*o:2*o+1;if(e==s){if(u.loaded=!0,u.frontTextureSize>=i)return;if(u.frontTextureSize=i,u.frontTextures[i])u.frontMaterial.map=u.frontTextures[i],u.frontMaterial.needsUpdate=!0;else{var r=u.options.pages[s].canvas[i],h=new THREE.CanvasTexture(r);h.anisotropy=u.book.renderer.capabilities.getMaxAnisotropy(),h.needsUpdate=!0,h.repeat.x=r.scaleX,h.repeat.y=r.scaleY,h.repeat.y=r.scaleY,h.offset.y=1-r.scaleY,u.frontTextures[i]=h,u.frontMaterial=u.createMaterial(h,"front"),u.frontMaterial.needsUpdate=!0,u.setFrontMat(u.frontMaterial),delete r}u.book.updateHtmlLayer()}else if(e==n){if(u.backTextureSize>=i)return;if(u.backTextureSize=i,u.backTextures[i])u.backMaterial.map=u.backTextures[i],u.backMaterial.needsUpdate=!0;else{var a=u.options.pages[n].canvas[i],p=new THREE.CanvasTexture(a);p.anisotropy=u.book.renderer.capabilities.getMaxAnisotropy(),p.needsUpdate=!0,p.repeat.x=a.scaleX,p.repeat.y=a.scaleY,p.repeat.y=a.scaleY,p.offset.y=1-a.scaleY,u.backTextures[i]=p,u.backMaterial=u.createMaterial(p,"back"),u.backMaterial.needsUpdate=!0,u.setBackMat(u.backMaterial),delete a}u.book.updateHtmlLayer()}})},FLIPBOOK.PageWebGL.prototype=new THREE.Object3D,FLIPBOOK.PageWebGL.prototype.constructor=FLIPBOOK.PageWebGL,FLIPBOOK.PageWebGL.prototype.load=function(t,e,i){function o(t){return y.isPowerOfTwo(t.width)&&y.isPowerOfTwo(t.height)}function s(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.width=y.nearestPowerOfTwo(t.width),e.height=y.nearestPowerOfTwo(t.height),e.getContext("2d").drawImage(t,0,0,e.width,e.height),e}return t}function n(t){return 1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter}e=e||128;for(var r=this.book.pages,h=0;h<r.length;h++){var a=r[h];if(a.flippingLeft||a.flippingRight)return}this.disposed=!1;var p=this,c=this.book.options,u=c.main,l=p.options.rightToLeft?this.book.pages.length-this.index-1:this.index,f=p.options.rightToLeft?2*l+1:2*l,g=p.options.rightToLeft?2*l:2*l+1;if(c.pdfMode){var d;switch(t){case"front":d=[f];break;case"back":d=[g];break;default:d=[f,g]}u.loadPagesFromPdf(d,e,function(){i.call(p)})}else{if(this.loaded)return void i.call(this);if(this.loaded=!0,p.frontMaterial&&p.backMaterial)return p.setFrontMat(p.frontMaterial),p.setBackMat(p.backMaterial),void i.call(p);this.callback=i;var y={isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.min(Math.pow(2,Math.round(Math.log(t)/Math.LN2)),p.options.pageTextureSize)}},m=new THREE.TextureLoader;p.options.main.setLoadingProgress(.3),m.load(p.frontTexture,function(t){n(t)&&!o(t.image)&&(t.image=s(t.image)),t.anisotropy=p.book.renderer.capabilities.getMaxAnisotropy(),t.needsUpdate=!0,"left"==p.options.pages[2*p.index].side?t.repeat.x=.5:"right"==p.options.pages[2*p.index].side&&(t.repeat.x=.5,t.offset.x=.5),p.frontMaterial=p.createMaterial(t),p.setFrontMat(p.frontMaterial),m.load(p.backTexture,function(e){n(t)&&!o(e.image)&&(e.image=s(e.image)),e.anisotropy=p.book.renderer.capabilities.getMaxAnisotropy(),e.needsUpdate=!0,"left"==p.options.pages[2*p.index+1].side?e.repeat.x=.5:"right"==p.options.pages[2*p.index+1].side&&(e.repeat.x=.5,e.offset.x=.5),p.backMaterial=p.createMaterial(e,"back"),p.setBackMat(p.backMaterial),p.loaded=!0,p.callback.call(p),p.options.main.setLoadingProgress(1)})})}},FLIPBOOK.PageWebGL.prototype.createMaterial=function(t,e){var i;if(this.options.lights){var o="back"==e?this.book.specularB:this.book.specularF,s=this.options;i=new THREE.MeshStandardMaterial({map:t,roughness:s.pageRoughness,metalness:s.pageMetalness,emissive:0,color:16777215,lightMap:o})}else i=new THREE.MeshBasicMaterial({map:t});return i},FLIPBOOK.PageWebGL.prototype._setAngle=function(t,e){if(t<=180&&t>=-180){if(t=t/180*Math.PI,this.singlePage&&(t>=90&&(t=90),t<0&&(t-=90),t<-180&&(t=-180),this.index==this.book.pages.length-1))return;t<0&&(t+=Math.PI),this.angle=t,this.positionZ(200),this.dragging=!0,this.rotation.y=-t,this.isFlippedLeft?this.bendF.force=1.35*Math.pow(-Math.abs(Math.cos(-t/2)),1)/Math.pow(this.pageHardness,1.5):this.bendF.force=1.35*Math.pow(Math.abs(Math.sin(-t/2)),1)/Math.pow(this.pageHardness,1.5),this.updateBend(),this.book.htmlLayerVisible&&(this.book.$pageL.hide(),this.book.$pageR.hide(),this.book.htmlLayerVisible=!1)}},FLIPBOOK.PageWebGL.prototype.updateBend=function(){this.b2.force=this.rotation.y+Math.PI/2,this.modF.apply(),this.gF.computeFaceNormals(),this.gF.computeVertexNormals(!0)},FLIPBOOK.PageWebGL.prototype.flipLeft=function(t){if(this.onComplete=t,this.dragging=!1,!this.isFlippedLeft&&!this.flippingLeft&&!this.flippingRight&&this.index==this.book.flippedleft){if(this.duration>0){this.flippingLeft=!0,this.flipping=!0,this.force=0;var e=(1+.5*Math.random())/this.pageHardness,i=.1+.2*Math.random();this.to={angle:this.rotation.y,t:-1,xx:0,thiss:this,force:this.force,offset:this.offset},this.bendIn(-Math.PI,e,i)}else this.rotation.y=-Math.PI,this.flippingLeft=!1,this.isFlippedLeft=!0,this.flippingRight=!1,this.isFlippedRight=!1;this.correctZOrder()}},FLIPBOOK.PageWebGL.prototype.correctZOrder=function(){var t;for(this.position.z=3,t=this.index-1;t>=0;t--)this.book.pages[t].position.z=this.book.pages[t+1].position.z-2-2-1;for(t=this.index+1;t<this.book.pages.length;t++)this.book.pages[t].position.z=this.book.pages[t-1].position.z-2-2-1},FLIPBOOK.PageWebGL.prototype.flipLeftInstant=function(t){if(this.onComplete=t,this.dragging=!1,!this.isFlippedLeft&&!this.flippingLeft&&!this.flippingRight&&this.index==this.book.flippedleft){this.thiss=this,this.xx=0,this.angle=-Math.PI,this.flippingLeft=!0,this.isFlippedLeft=!1,this.renderFlip(),this.flippingLeft=!1,this.isFlippedLeft=!0,this.flippingRight=!1,this.isFlippedRight=!1;this.position.z=3;for(e=this.index+1;e<this.book.pages.length;e++)this.book.pages[e].position.z=this.book.pages[e-1].position.z-2-2-1;if(this.index<this.book.pages.length-1){this.position.z=this.book.pages[this.index+1].position.z;for(var e=this.index-1;e>=0;e--)this.book.pages[e].position.z=this.book.pages[e+1].position.z-2-2-1}else this.index>0&&(this.book.pages[this.index].position.z=this.book.pages[this.index-1].position.z+2+2-1);this.flipFinished()}},FLIPBOOK.PageWebGL.prototype.hideMat=function(){this.showing&&(this.remove(this.cube),this.add(this.cubeEmpty),this.showing=!1)},FLIPBOOK.PageWebGL.prototype.showMat=function(){this.showing||(this.add(this.cube),this.remove(this.cubeEmpty),this.showing=!0)},FLIPBOOK.PageWebGL.prototype.setFrontMat=function(t){this.cube.material[4]!==t&&(this.cube.material[4]=t)},FLIPBOOK.PageWebGL.prototype.setBackMat=function(t){this.cube.material[5]!==t&&(this.cube.material[5]=t)},FLIPBOOK.PageWebGL.prototype.disposeMat=function(){if(this.loaded){var t=this.cube.material[4],e=this.cube.material[5],i=t.map,o=e.map;t.dispose(),e.dispose(),i&&i.dispose(),o&&o.dispose(),this.disposed=!0,this.loaded=!1}},FLIPBOOK.PageWebGL.prototype.flipRightInstant=function(t){if(this.onComplete=t,this.dragging=!1,!this.isFlippedRight&&!this.flippingRight&&!this.flippingLeft&&this.index==this.book.getNumPages()-this.book.flippedright-1){this.thiss=this,this.xx=0,this.angle=0,this.flippingRight=!0,this.isFlippedRight=!1,this.renderFlip(),this.flippingLeft=!1,this.isFlippedLeft=!1,this.flippingRight=!1,this.isFlippedRight=!0;this.position.z=3;for(e=this.index-1;e>=0;e--)this.book.pages[e].position.z=this.book.pages[e+1].position.z-2-2-1;if(this.index>0){this.position.z=this.book.pages[this.index-1].position.z;for(var e=this.index+1;e<this.book.pages.length;e++)this.book.pages[e].position.z=this.book.pages[e-1].position.z-2-2-1}else this.book.pages.length>1&&(this.position.z=this.book.pages[this.index+1].position.z+2+2-1);this.flipFinished()}},FLIPBOOK.PageWebGL.prototype.flipRight=function(t){if(this.onComplete=t,this.dragging=!1,!this.isFlippedRight&&!this.flippingRight&&!this.flippingLeft&&this.index==this.book.getNumPages()-this.book.flippedright-1){if(this.duration>0){this.flippingRight=!0,this.flipping=!0,this.force=0,this.to={angle:this.rotation.y,t:-1,xx:0,thiss:this,force:this.force,offset:this.offset};var e=(-1-.5*Math.random())/this.pageHardness,i=.1+.2*Math.random();this.bendIn(0,e,i)}else this.rotation.y=0,this.flippingLeft=!1,this.isFlippedLeft=!1,this.flippingRight=!1,this.isFlippedRight=!0;this.correctZOrder()}},FLIPBOOK.PageWebGL.prototype.bendIn=function(t,e,i){this.bendF.force=0,this.bendF.offset=0,this.updateBend();var o=2*this.duration*240*Math.pow(Math.abs(this.rotation.y-t)/Math.PI,.5)*Math.pow(this.pageHardness,.25);new TWEEN.Tween(this.to).to({angle:t,xx:1,t:1},o).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(this.renderFlip).onComplete(this.bendOut).start(),this.book.options.main.playFlipSound()},FLIPBOOK.PageWebGL.prototype.bendOut=function(){var t=this.thiss,e=t.duration*Math.pow(Math.abs(t.bendF.force),.5)*1e3;new TWEEN.Tween(t.bendF).to({force:0,offset:1},e).easing(TWEEN.Easing.Sinusoidal.Out).onUpdate(function(){t.updateBend()}).onComplete(function(){t.flipFinished(t)}).start();if(t.flippingLeft)if(t.index<t.book.pages.length-1){t.position.z=t.book.pages[t.index+1].position.z;for(i=t.index-1;i>=0;i--)t.book.pages[i].position.z=t.book.pages[i+1].position.z-2-2-1}else t.book.pages.length>1&&(t.book.pages[t.index].position.z=t.book.pages[t.index-1].position.z+2+2-1);if(t.flippingRight)if(t.index>0){t.position.z=t.book.pages[t.index-1].position.z;for(var i=t.index+1;i<t.book.pages.length;i++)t.book.pages[i].position.z=t.book.pages[i-1].position.z-2-2-1}else t.book.pages.length>1&&(t.position.z=t.book.pages[t.index+1].position.z+2+2-1)},FLIPBOOK.PageWebGL.prototype.modApply=function(){this.thiss.bendF.force=this.thiss.bendB.force=this.force,this.thiss.bendF.offset=this.thiss.bendB.offset=this.offset,this.thiss.updateBend()},FLIPBOOK.PageWebGL.prototype.renderFlip=function(){this.thiss._setAngle(180*-this.angle/Math.PI)},FLIPBOOK.PageWebGL.prototype.flipFinished=function(){var t=this;t.flippingLeft?(t.flippingLeft=!1,t.isFlippedLeft=!0,t.flippingRight=!1,t.isFlippedRight=!1):t.flippingRight&&(t.flippingLeft=!1,t.isFlippedRight=!0,t.flippingRight=!1,t.isFlippedLeft=!1),t.bendF.force=0,t.bendF.offset=0,t.updateBend(),t.flipping=!1,t.dragging=!1,void 0!==t.onComplete&&t.onComplete(t),t.book.flipFinnished()},FLIPBOOK.PageWebGL.prototype.isFlippedLeft=function(){return this.thiss.isFlippedLeft},FLIPBOOK.PageWebGL.prototype.isFlippedRight=function(){return this.thiss.isFlippedRight},FLIPBOOK.PageWebGL.prototype.positionZ=function(){},FLIPBOOK.BookWebGL=function(t,e){this.elementId=jQuery(e.main.elem).attr("id"),this.wrapper="object"==typeof t?t:document.getElementById(t),this.options=e,this.options.cameraDistance=2800,this.main=e.main,this.pageW=e.pageWidth,this.pageH=e.pageHeight,this.pageW=1e3*e.pageWidth/e.pageHeight,this.pageH=1e3,this.main.options.pageWidth=this.pageW,this.main.options.pageHeight=this.pageH,this.scroll=e.scroll,this.pagesArr=e.pagesArr,this.pages=[],this.animating=!1,this.rightIndex=0,this.sc=1;var i=this.wrapper.style;i.width="100%",i.height="100%",i.position="absolute",i.overflow="hidden",e.lightBox&&!e.lightBoxOpened||this.enable(),this.options.cameraDistance=this.options.cameraDistance/1.5,this.enable()},FLIPBOOK.BookWebGL.prototype=new THREE.Object3D,FLIPBOOK.BookWebGL.prototype.constructor=FLIPBOOK.BookWebGL,FLIPBOOK.BookWebGL.prototype.init3d=function(){var t=this,e=jQuery(t.wrapper).width()/jQuery(t.wrapper).height(),i=this.options;this.Scene=new THREE.Scene,this.centerContainer=new THREE.Object3D,this.Scene.add(this.centerContainer),this.Camera=new THREE.PerspectiveCamera(30,e,1,1e4),this.Scene.add(this.Camera),this.zoom=i.zoom,this.pan=i.pan,this.tilt=i.tilt,this.updateCameraPosition();var o=this.wrapper,s=(document.createElement("canvas").getContext("webgl"),new THREE.WebGLRenderer({antialias:this.options.antialias,alpha:!0}));window.renderer=s,s.gammaInput=!0,s.gammaOutput=!0,window.webglrenderer=this.renderer=s,this.renderer.setSize(o.clientWidth,o.clientHeight);var n=window.devicePixelRatio<i.minPixelRatio?i.minPixelRatio:window.devicePixelRatio;this.renderer.setPixelRatio(n),o.appendChild(this.renderer.domElement);for(var r=!1,h=this.options.pages,a=0;a<h.length;a++)h[a].htmlContent&&(r=!0);if(this.options.hasHtmlContent=r||i.pdfMode,this.options.hasHtmlContent&&this.initHtmlContent(),this.canvas=this.renderer.domElement,this._bind("mousedown",this.canvas),this._bind("mousemove",this.canvas),this._bind("mouseout",this.canvas),this._bind("mouseup",this.canvas),this._bind("touchstart",this.canvas),this._bind("touchmove",this.canvas),this._bind("touchend",this.canvas),this._bind("touchcancel",this.canvas),this.options.lights){var p=i.spotlightColor||16777215,c=i.spotlightIntensity||.14,u=new THREE.SpotLight(p);u.intensity=c,u.position.set(1e3,0,2e3),u.distance=4e3,u.penumbra=.1,u.decay=0,this.Scene.add(u);var l=i.ambientLightColor||3355443,f=new THREE.AmbientLight(l);this.Scene.add(f)}this.centerContainer.position.set(0,0,0),this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y),this.onResize(),this.centerContainer.position.x=.5*-this.pageW*this.centerContainer.scale.x,this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y),this.flippedleft=0,this.flippedright=0,this.cameraZMin=300,this.cameraZMax=5e3,function e(){if(t.rendering){if(!t.enabled)return;TWEEN.update(),t.renderer.render(t.Scene,t.Camera),t.htmlLayer&&t.cssRenderer.render(t.Scene,t.Camera)}requestAnimationFrame(e)}()},FLIPBOOK.BookWebGL.prototype.initHtmlContent=function(){THREE.CSS3DObject=function(t){THREE.Object3D.call(this),this.element=t,this.element.style.position="absolute",this.addEventListener("removed",function(t){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)})},THREE.CSS3DObject.prototype=Object.create(THREE.Object3D.prototype),THREE.CSS3DObject.prototype.constructor=THREE.CSS3DObject,THREE.CSS3DSprite=function(t){THREE.CSS3DObject.call(this,t)},THREE.CSS3DSprite.prototype=Object.create(THREE.CSS3DObject.prototype),THREE.CSS3DSprite.prototype.constructor=THREE.CSS3DSprite,THREE.CSS3DRenderer=function(){var t,e,i,o,s=new THREE.Matrix4,n={camera:{fov:0,style:""},objects:{}},r=document.createElement("div");r.style.overflow="hidden",r.style.WebkitTransformStyle="preserve-3d",r.style.MozTransformStyle="preserve-3d",r.style.oTransformStyle="preserve-3d",r.style.transformStyle="preserve-3d",this.domElement=r;var h=document.createElement("div");h.style.WebkitTransformStyle="preserve-3d",h.style.MozTransformStyle="preserve-3d",h.style.oTransformStyle="preserve-3d",h.style.transformStyle="preserve-3d",r.appendChild(h),this.setClearColor=function(){},this.getSize=function(){return{width:t,height:e}},this.setSize=function(s,n){i=(t=s)/2,o=(e=n)/2,r.style.width=s+"px",r.style.height=n+"px",h.style.width=s+"px",h.style.height=n+"px"};var a=function(t){return Math.abs(t)<Number.EPSILON?0:t},p=function(t){var e=t.elements;return"matrix3d("+a(e[0])+","+a(-e[1])+","+a(e[2])+","+a(e[3])+","+a(e[4])+","+a(-e[5])+","+a(e[6])+","+a(e[7])+","+a(e[8])+","+a(-e[9])+","+a(e[10])+","+a(e[11])+","+a(e[12])+","+a(-e[13])+","+a(e[14])+","+a(e[15])+")"},c=function(t){var e=t.elements;return"translate3d(-50%,-50%,0) matrix3d("+a(e[0])+","+a(e[1])+","+a(e[2])+","+a(e[3])+","+a(-e[4])+","+a(-e[5])+","+a(-e[6])+","+a(-e[7])+","+a(e[8])+","+a(e[9])+","+a(e[10])+","+a(e[11])+","+a(e[12])+","+a(e[13])+","+a(e[14])+","+a(e[15])+")"},u=function(t,e){if(t instanceof THREE.CSS3DObject){var i;t instanceof THREE.CSS3DSprite?(s.copy(e.matrixWorldInverse),s.transpose(),s.copyPosition(t.matrixWorld),s.scale(t.scale),s.elements[3]=0,s.elements[7]=0,s.elements[11]=0,s.elements[15]=1,i=c(s)):i=c(t.matrixWorld);var o=t.element,r=n.objects[t.id];void 0!==r&&r===i||(o.style.WebkitTransform=i,o.style.MozTransform=i,o.style.oTransform=i,o.style.transform=i,n.objects[t.id]=i),o.parentNode!==h&&h.appendChild(o)}for(var a=0,p=t.children.length;a<p;a++)u(t.children[a],e)};this.render=function(t,s){var a=.5/Math.tan(THREE.Math.degToRad(.5*s.fov))*e;n.camera.fov!==a&&(r.style.WebkitPerspective=a+"px",r.style.MozPerspective=a+"px",r.style.oPerspective=a+"px",r.style.perspective=a+"px",n.camera.fov=a),t.updateMatrixWorld(),null===s.parent&&s.updateMatrixWorld(),s.matrixWorldInverse.getInverse(s.matrixWorld);var c="translate3d(0,0,"+a+"px)"+p(s.matrixWorldInverse)+" translate3d("+i+"px,"+o+"px, 0)";n.camera.style!==c&&(h.style.WebkitTransform=c,h.style.MozTransform=c,h.style.oTransform=c,h.style.transform=c,n.camera.style=c),u(t,s)}};var t=document.createElement("div");t.className="htmlLayer";var e=jQuery(t);this.$htmlLayer=e,this.$pageR=jQuery("<div>").css("width",1e3*this.options.pageWidth/this.options.pageHeight+"px").css("height","1000px").css("position","absolute").css("top","-500px").css("pointer-events","none").appendTo(e),this.$pageRInner=jQuery("<div>").css("pointer-events","all").appendTo(this.$pageR),this.$pageL=jQuery("<div>").css("width",1e3*this.options.pageWidth/this.options.pageHeight+"px").css("height","1000px").css("position","absolute").css("top","-500px").css("left",-1e3*this.options.pageWidth/this.options.pageHeight+"px").css("pointer-events","none").appendTo(e),this.$pageLInner=jQuery("<div>").css("pointer-events","all").appendTo(this.$pageL),this.htmlLayer=new THREE.CSS3DObject(t),this.Scene.add(this.htmlLayer),this.cssRenderer=new THREE.CSS3DRenderer;this.wrapper;this.wrapper.appendChild(this.cssRenderer.domElement),this.cssRenderer.domElement.style.position="absolute",this.cssRenderer.domElement.style.top="0",this.cssRenderer.domElement.style.left="0",this.cssRenderer.domElement.style.pointerEvents="none"},FLIPBOOK.BookWebGL.prototype.enablePrev=function(t){this.prevEnabled=t},FLIPBOOK.BookWebGL.prototype.enableNext=function(t){this.nextEnabled=t},FLIPBOOK.BookWebGL.prototype.isZoomed=function(){return this.main.zoom>this.options.zoomLevels[0]&&this.main.zoom>1},FLIPBOOK.BookWebGL.prototype.getRightPage=function(){return this.pages[this.flippedleft]},FLIPBOOK.BookWebGL.prototype.getNextPage=function(){return this.pages[this.flippedleft+1]},FLIPBOOK.BookWebGL.prototype.getLeftPage=function(){return this.pages[this.flippedleft-1]},FLIPBOOK.BookWebGL.prototype.getPrevPage=function(){return this.pages[this.flippedleft-2]},FLIPBOOK.BookWebGL.prototype.onSwipe=function(t,e,i,o,s,n,r){if(!this.isZoomed()){o=r[0].start.x-r[0].end.x;var h=this.getLeftPage(),a=this.getRightPage(),p=this.getNextPage(),c=this.getPrevPage();if(!this.options.rotateCameraOnMouseDrag||a&&a.dragging||h&&h.dragging||"rotate"!=this.onMouseMove&&"scroll"!=this.onMouseMove){if(("cancel"==e||"end"==e)&&n<=1){if(1==this.view&&this.draggingBook&&"left"==i)return this.nextPage(),void(this.draggingBook=!1);if(1==this.view&&this.draggingBook&&"right"==i)return this.prevPage(),void(this.draggingBook=!1);!(o<0)||a&&a.dragging?!(o>0)||h&&h.dragging?0==o&&this.clickedPage&&(this.clickedPage.isFlippedLeft?this.prevPage():this.nextPage()):this.nextPage():this.prevPage(),a&&(a.dragging=!1),h&&(h.dragging=!1)}if("move"==e&&n<=1){if(this.draggingBook)return this.centerContainer.position.x=this.draggingBookStartX-o,void this.updateHtmlLayerPosition();if(1==this.view&&this.isFocusedLeft()&&"left"==i)return this.draggingBookStartX=this.centerContainer.position.x,void(this.draggingBook=!0);if(1==this.view&&this.isFocusedRight()&&"right"==i)return this.draggingBookStartX=this.centerContainer.position.x,void(this.draggingBook=!0);if(o=180*(r[0].start.x-r[0].end.x)/jQuery(this.wrapper).width(),h&&h.flipping||a&&a.flipping)return;a&&a.dragging||h&&h.dragging?h&&!a||h&&!a.dragging?o<=0&&h._setAngle(o,i):(a&&!h||a&&!h.dragging)&&o>=0&&a._setAngle(o,i):0!=o&&("right"!=i||!h||a&&a.dragging||!this.prevEnabled?"left"==i&&a&&this.nextEnabled&&(a._setAngle(o,i),a.positionZ(200),p&&p.showMat()):(h._setAngle(o,i),h.positionZ(200),c&&c.showMat()))}}}},FLIPBOOK.BookWebGL.prototype.onResize=function(){var t=jQuery(this.wrapper).width(),e=jQuery(this.wrapper).height(),i=t/e,o=this.options.pageWidth/this.options.pageHeight,s=Math.min(this.zoom,1),n=Number(this.options.zoomLevels[0]);i>2*o*s?(this.options.responsiveView?(this.view=2,0==this.rightIndex?this.focusRighttPage():this.focusBothPages()):0==this.flippedleft?this.focusRighttPage():0==this.flippedright?this.focusLeftPage():this.focusBothPages(),this.sc=1):this.options.responsiveView&&t<=this.options.responsiveViewTreshold?(this.view=1,0==this.rightIndex||this.isFocusedRight()?this.focusRighttPage():this.focusLeftPage(),this.sc=o>i?n*i/(o*s):1):(this.sc=n*i/(2*o*s),0==this.flippedleft?this.focusRighttPage():0==this.flippedright?this.focusLeftPage():this.focusBothPages()),this.renderer.setSize(t,e),this.htmlLayer&&(this.cssRenderer.setSize(t,e),this.htmlLayer.scale.set(this.sc,this.sc,this.sc)),this.Camera.aspect=t/e,this.Camera.updateProjectionMatrix(),this.updateCameraPosition(),this.updateBookPosition(),this.wrapperW=t,this.wrapperH=e},FLIPBOOK.BookWebGL.prototype.updateCameraPosition=function(){var t=Math.PI*this.tilt/180,e=0,i=this.options.cameraDistance*Math.sin(t)/this.zoom,o=this.options.cameraDistance*Math.cos(t)/this.zoom;this.centerContainer.scale.set(this.sc,this.sc,this.sc),t=Math.PI*this.pan/180,e=Math.sin(t)*o,o=Math.cos(t)*o,this.cameraZ=o,this.Camera.position.set(Math.round(e),Math.round(i),Math.round(o)),this.Camera.lookAt(this.Scene.position)},FLIPBOOK.BookWebGL.prototype.createPages=function(){var t,e,i,o,s,n=this,r=n.options,h=r.pageMiddleShadowSize,a=document.createElement("canvas");a.width=64,a.height=64;var p=a.getContext("2d"),c=p.createLinearGradient(64-h,0,64,0);c.addColorStop(0,"#AAAAAA"),c.addColorStop(1,r.pageMiddleShadowColorL),p.fillStyle=c,p.fillRect(0,0,64,64);var u=new THREE.CanvasTexture(a);u.needsUpdate=!0,n.specularB=u;var l=document.createElement("canvas");l.width=64,l.height=64;var f=l.getContext("2d"),g=f.createLinearGradient(0,0,h,0);g.addColorStop(0,r.pageMiddleShadowColorR),g.addColorStop(1,"#AAAAAA"),f.fillStyle=g,f.fillRect(0,0,64,64);var d=new THREE.CanvasTexture(l);d.needsUpdate=!0,n.specularF=d;var y,m;n.options.lights?(y=new THREE.MeshStandardMaterial({roughness:n.options.pageRoughness,metalness:n.options.pageMetalness,emissive:0,color:15592941,lightMap:n.specularF}),m=new THREE.MeshStandardMaterial({roughness:n.options.pageRoughness,metalness:n.options.pageMetalness,emissive:0,color:15592941,lightMap:n.specularB})):y=m=new THREE.MeshBasicMaterial({color:15592941});var x=n.pagesArr;for(s=0;s<x.length/2;s++){t=x[2*s].src,e=2*s+1>=x.length?"":x[2*s+1].src,i=0==s||s==x.length/2-1?n.options.coverHardness:n.options.pageHardness,o=new FLIPBOOK.PageWebGL(n,s,t,e,i,n.options,y,m),n.pages.push(o),n.centerContainer.add(o),n.flippedright++;s>0?(o.position.z=n.pages[s-1].position.z-2-2-1,this.bg&&(this.bg.position.z=o.position.z-5)):o.position.z=2}n.initialized=!0,this.updateHtmlLayer()},FLIPBOOK.BookWebGL.prototype.getNumPages=function(){return this.pages.length},FLIPBOOK.BookWebGL.prototype.centerContainer=function(){return this.centerContainer},FLIPBOOK.BookWebGL.prototype.goToPage=function(t,e){if(this.initialized)if(t<0&&(t=0),t>this.options.pages.length&&(t=this.options.pages.length),t%2!=0&&t--,t!=this.rightIndex){this.goingToPage=t;var i=this,o=1e3*this.options.pageFlipDuration/6;if(void 0!==e&&e){if(t>i.rightIndex)for(;i.rightIndex<t;)this.nextPageInstant();else for(;i.rightIndex>t;)this.prevPageInstant();return this.updateBookPosition(),this.turnPageComplete(),void this.updateHtmlLayer()}this.rightIndex>t?(o=1/(this.rightIndex-t)*this.options.pageFlipDuration*1e3/6,this.rightIndex-t>10&&(o=0),this.rightIndex-2>t?(this.prevPage(!1),o>0?setTimeout(function(){i.goToPage(t,e)},o):i.goToPage(t,e)):(this.prevPage(),setTimeout(function(){if(void 0!==e&&e)for(var t=0;t<i.pages.length;t++)i.pages[t].duration=i.options.pageFlipDuration;i.turnPageComplete()},o))):this.rightIndex<t&&(o=-1/(this.rightIndex-t)*this.options.pageFlipDuration*1e3/6,this.rightIndex-t<-10&&(o=0),this.rightIndex+2<t?(this.nextPage(!1),o>0?setTimeout(function(){i.goToPage(t,e)},o):i.goToPage(t,e)):(this.nextPage(),setTimeout(function(){if(void 0!==e&&e)for(var t=0;t<i.pages.length;t++)i.pages[t].duration=i.options.pageFlipDuration;i.turnPageComplete()},o)))}else this.turnPageComplete();else{i=this;setTimeout(function(){i.goToPage(t,e)},100)}},FLIPBOOK.BookWebGL.prototype.nextPageInstant=function(t){if(0!=this.flippedright){var e;for(e=0;e<this.pages.length;e++)if(this.pages[e].flippingRight)return;this.pages[this.pages.length-this.flippedright].flipLeftInstant(),this.flippedleft++,this.flippedright--,this.rightIndex+=2,this.updateBookPosition()}},FLIPBOOK.BookWebGL.prototype.prevPageInstant=function(t){if(0!=this.flippedleft){var e;for(e=0;e<this.pages.length;e++)if(this.pages[e].flippingLeft)return;this.pages[this.flippedleft-1].flipRightInstant(),this.flippedleft--,this.flippedright++,this.rightIndex-=2,this.updateBookPosition()}},FLIPBOOK.BookWebGL.prototype.nextPage=function(t){if(0!=this.flippedright&&this.nextEnabled&&(this.clickedPage=null,!(1==this.flippedright&&2*this.pages.length>this.pagesArr.length)||this.options.rightToLeft)){var e,i=0;for(e=0;e<this.pages.length;e++){if(this.pages[e].flippingRight)return;this.pages[e].flipping&&i++}var o=this.pages[this.pages.length-this.flippedright],s=(this.pages[o.index-2],this.pages[o.index-3],this.pages[o.index+1]);if(s&&i<5&&s.showMat(),1==this.view){if(this.isFocusedLeft())return void this.focusRighttPage(300);this.focusLeftPage(600,200)}else 0==this.flippedleft?this.focusBothPages(500):1==this.flippedright&&this.focusLeftPage(500);if(!o.flipping){var n,r=this;(void 0===t||t)&&(n=function(t){r.turnPageComplete()}),o.flipLeft(n)}this.flippedleft++,this.flippedright--,this.rightIndex+=2}},FLIPBOOK.BookWebGL.prototype.updateBookPosition=function(){1==this.view||(0==this.rightIndex?this.focusRighttPage():this.rightIndex>=this.options.pagesArr.length?this.focusLeftPage():this.focusBothPages()),this.centerContainer.position.y=0,this.updateHtmlLayerPosition()},FLIPBOOK.BookWebGL.prototype.updateHtmlLayerPosition=function(){this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y)},FLIPBOOK.BookWebGL.prototype.turnPageComplete=function(){for(var t=this.pages,e=0;e<t.length;e++)if((h=t[e]).flippingLeft||h.flippingRight)return;for(var i=this.pages[this.flippedleft],o=this.pages[this.flippedleft-1],s=this.pages[this.flippedleft-2],n=this.pages[this.flippedleft+1],r=this.main,e=0;e<t.length;e++){var h=t[e];h!==i&&h!==o||h.showMat(),o&&h.index<o.index-2&&(h.hideMat(),h.disposeMat()),i&&h.index>i.index+2&&(h.hideMat(),h.disposeMat())}r.setLoadingProgress(.1);var a=this.options.pageTextureSize,p=this.options.pageTextureSize;o?o.load("back",a,function(){i?i.load("front",a,function(){r.setLoadingProgress(1),o.load("front",p,function(){}),i.load("back",p,function(){}),s&&s.load("back",p,function(){}),n&&n.load("front",p,function(){})}):(r.setLoadingProgress(1),o.load("front",p,function(){s&&s.load("back",p,function(){})}))}):i&&i.load("front",a,function(){r.setLoadingProgress(1),i.load("back",p,function(){n&&n.load("front",p,function(){})})}),this.main.turnPageComplete()},FLIPBOOK.BookWebGL.prototype.focusLeftPage=function(t,e){var i=.5*this.options.pageWidth*this.centerContainer.scale.x;this.moveToPos(i,t,e)},FLIPBOOK.BookWebGL.prototype.focusRighttPage=function(t,e){var i=.5*-this.options.pageWidth*this.centerContainer.scale.x;this.moveToPos(i,t,e)},FLIPBOOK.BookWebGL.prototype.focusBothPages=function(t,e){this.moveToPos(0,t,e)},FLIPBOOK.BookWebGL.prototype.moveToPos=function(t,e,i){if(e&&this.movingTo!=t&&this.centerContainer.position.x!=t){var o=this;this.movingTo=t;new TWEEN.Tween(this.centerContainer.position).to({x:t},e).easing(TWEEN.Easing.Sinusoidal.Out).onUpdate(function(){o.updateHtmlLayerPosition()}).onComplete(function(){o.movingTo=null,o.htmlLayer&&(o.htmlLayer.position.x=o.centerContainer.position.x,o.htmlLayer.position.y=o.centerContainer.position.y)}).delay(i||0).start()}else this.centerContainer.position.x=t},FLIPBOOK.BookWebGL.prototype.isFocusedLeft=function(){return this.centerContainer.position.x>0},FLIPBOOK.BookWebGL.prototype.isFocusedRight=function(){return this.centerContainer.position.x<0},FLIPBOOK.BookWebGL.prototype.prevPage=function(t){if(0!=this.flippedleft&&this.prevEnabled&&(this.clickedPage=null,1!=this.flippedleft||2*this.pages.length!=this.pagesArr.length||!this.options.rightToLeft||!this.options.oddPages)){var e,i=0;for(e=0;e<this.pages.length;e++){if(this.pages[e].flippingLeft)return;this.pages[e].flipping&&i++}var o=this.pages[this.flippedleft-1],s=this.pages[o.index-1];this.pages[o.index+2],this.pages[o.index+3];if(s&&i<5&&s.showMat(),1==this.view){if(this.isFocusedRight())return void this.focusLeftPage(300);this.focusRighttPage(600,200)}else 1==this.flippedleft?this.focusRighttPage(500):0==this.flippedright&&this.focusBothPages(500);if(!o.flipping){var n,r=this;(void 0===t||t)&&(n=function(t){r.turnPageComplete()}),o.flipRight(n)}this.flippedleft--,this.flippedright++,this.rightIndex-=2}},FLIPBOOK.BookWebGL.prototype.firstPage=function(){},FLIPBOOK.BookWebGL.prototype.flipFinnished=function(){this.updateHtmlLayer()},FLIPBOOK.BookWebGL.prototype.lastPage=function(){},FLIPBOOK.BookWebGL.prototype.updateVisiblePages=function(){},FLIPBOOK.BookWebGL.prototype.updateHtmlLayer=function(){if(this.htmlLayer){for(var t=0;t<this.pages.length;t++)if(this.pages[t].flipping)return;if(this.htmlContentRightIndex=this.rightIndex,this.htmlLayerVisible=!1,0==this.rightIndex)this.$pageL.hide();else if(this.options.pages[this.rightIndex-1].htmlContent){this.$pageLInner.empty();jQuery(this.options.pages[this.rightIndex-1].htmlContent).appendTo(this.$pageLInner);this.$pageL.show(),this.htmlLayerVisible=!0}else this.$pageL.hide();if(this.rightIndex==2*this.pages.length)this.$pageR.hide();else if(this.options.pages[this.rightIndex].htmlContent){this.$pageRInner.empty();jQuery(this.options.pages[this.rightIndex].htmlContent).appendTo(this.$pageRInner);this.$pageR.show(),this.htmlLayerVisible=!0}else this.$pageR.hide()}},FLIPBOOK.BookWebGL.prototype.onZoom=function(){var t=this;this.enabled&&setTimeout(function(){t.turnPageComplete()},100)},FLIPBOOK.BookWebGL.prototype.render=function(t){this.rendering=t},FLIPBOOK.BookWebGL.prototype.zoomTo=function(t,e,i){if(void 0===e&&(e=50),i){var o=this.zoom*this.wrapper.clientHeight/1e3,s=t*this.wrapper.clientHeight/1e3,n=(this.zoom,this.centerContainer.position),r={x:(i.offsetX-this.wrapper.clientWidth/2)/o-n.x,y:(-i.offsetY+this.wrapper.clientHeight/2)/o-n.y},h={x:(i.offsetX-this.wrapper.clientWidth/2)/s-n.x,y:(-i.offsetY+this.wrapper.clientHeight/2)/s-n.y},a=n;a.x=n.x-(r.x-h.x),a.y=n.y-(r.y-h.y),this.centerContainer.position.set(a.x,a.y,0),this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y),this.updateCameraPosition()}var p=this;if(newZoom=t>this.options.zoomMax?this.options.zoomMax:t,newZoom=t<this.options.zoomMin?this.options.zoomMin:t,newZoom==this.options.zoom){this.options;var c=this.isFocusedLeft();this.centerContainer.position.set(0,0,0),1==this.view&&(c?this.focusLeftPage():this.focusRighttPage()),this.updateBookPosition()}e>0?this.zooming||(this.zooming=!0,new TWEEN.Tween(this).to({zoom:newZoom},e).easing(TWEEN.Easing.Sinusoidal.InOut).onUpdate(this.updateCameraPosition).onComplete(function(){p.zooming=!1}).start()):(this.zoom=newZoom,this.zooming=!1,this.updateCameraPosition()),t<=1&&t<=this.zoom&&this.updateBookPosition(),p.options.parent.onZoom(newZoom)},FLIPBOOK.BookWebGL.prototype.tiltTo=function(t){var e=this.tilt+.3*t;e=(e=e>this.options.tiltMax?this.options.tiltMax:e)<this.options.tiltMin?this.options.tiltMin:e,this.tilt=e,this.updateCameraPosition()},FLIPBOOK.BookWebGL.prototype.panTo=function(t){var e=this.pan-.2*t;e=(e=e>this.options.panMax?this.options.panMax:e)<this.options.panMin?this.options.panMin:e,this.pan=e,this.updateCameraPosition()},FLIPBOOK.BookWebGL.prototype._bind=function(t,e,i){(e||this.wrapper).addEventListener(t,this,!!i)},FLIPBOOK.BookWebGL.prototype.handleEvent=function(t){var e=this;switch(t.type){case"mousedown":e._start(t);break;case"touchstart":e._touchstart(t);break;case"touchmove":e._touchmove(t);break;case"mousemove":e._move(t);break;case"mouseout":case"mouseup":case"touchend":e._end(t)}},FLIPBOOK.BookWebGL.prototype.resetCameraPosition=function(){this.centerContainer.position.set(0,0,0)},FLIPBOOK.BookWebGL.prototype._start=function(t){this.mouseDown=!0,this.onMouseMove="",this.pointX=t.pageX,this.pointY=t.pageY,this.startPoint=t;var e=this._getVector(t);e.unproject(this.Camera);var i=new THREE.Raycaster(this.Camera.position,e.sub(this.Camera.position).normalize()).intersectObjects(this.pages,!0);this.pageMouseDown=i.length>0,!this.pageMouseDown&&this.options.lightBox&&this.options.lightboxCloseOnClick&&this.options.main.lightbox.closeLightbox()},FLIPBOOK.BookWebGL.prototype._touchstart=function(t){if(t.touches.length>1){this.touches=[],this.touches[0]={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},this.touches[1]={pageX:t.touches[1].pageX,pageY:t.touches[1].pageY};var e=Math.abs(this.touches[0].pageX-this.touches[1].pageX),i=Math.abs(this.touches[0].pageY-this.touches[1].pageY);this.touchesDistStart=Math.sqrt(e*e+i*i)}else t=t.touches[0],this._start(t)},FLIPBOOK.BookWebGL.prototype._getVector=function(t){var e=jQuery(this.canvas).width(),i=jQuery(this.canvas).height(),o=t.pageX-jQuery(this.canvas).offset().left,s=t.pageY-jQuery(this.canvas).offset().top;jQuery(this.canvas).offset().x,jQuery(this.canvas).offset().y;return new THREE.Vector3(o/e*2-1,-s/i*2+1,.5)},FLIPBOOK.BookWebGL.prototype._touchmove=function(t){if(t.touches.length>1){this.touches=[],this.touches[0]={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},this.touches[1]={pageX:t.touches[1].pageX,pageY:t.touches[1].pageY};var e=Math.abs(this.touches[0].pageX-this.touches[1].pageX),i=Math.abs(this.touches[0].pageY-this.touches[1].pageY);this.touchesDist=Math.sqrt(e*e+i*i);var o=this.zoom*Math.pow(this.touchesDist/this.touchesDistStart,.2);return o>.5&&o<5&&this.zoomTo(o,0,{offsetX:this.touches[0].pageX/2+this.touches[1].pageX/2,offsetY:this.touches[0].pageY/2+this.touches[1].pageY/2}),void this.updateCameraPosition()}t=t.touches[0],this._move(t)},FLIPBOOK.BookWebGL.prototype._move=function(t){var e=this._getVector(t);e.unproject(this.Camera);var i=new THREE.Raycaster(this.Camera.position,e.sub(this.Camera.position).normalize()).intersectObjects(this.pages,!0),o=t,s=.5*(o.pageX-this.pointX),n=.5*(o.pageY-this.pointY);if(this.pointX=o.pageX,this.pointY=o.pageY,!this.mouseDown)return this.onMouseMove="",void(this.options.rotateCameraOnMouseMove&&(this.tilt=this.options.tiltMin2+(this.options.tiltMax2-this.options.tiltMin2)*(1-this.pointY/jQuery(this.canvas).height()),this.pan=this.options.panMin2+(this.options.panMax2-this.options.panMin2)*this.pointX/jQuery(this.canvas).width(),this.updateCameraPosition()));if(i.length>0?""==this.onMouseMove&&this.zoom>1&&(this.onMouseMove="scroll"):""==this.onMouseMove&&(this.onMouseMove="rotate"),"scroll"==this.onMouseMove)0==s&&0==n||(this.moved=!0,this.centerContainer.position.x+=1e4*s/(this.cameraZ*this.zoom*this.zoom),this.centerContainer.position.y-=1e4*n/(this.cameraZ*this.zoom*this.zoom)),this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y);else if("rotate"==this.onMouseMove){var r=this.getRightPage(),h=this.getLeftPage();this.options.rotateCameraOnMouseMove||!this.options.rotateCameraOnMouseDrag||h&&h.dragging||r&&r.dragging||this.tiltTo(n)}},FLIPBOOK.BookWebGL.prototype._end=function(t){this.mouseDown=!1,void 0!==t.changedTouches&&(t=t.changedTouches[0]),this.pointX=t.pageX,this.pointY=t.pageY,this.endPoint=t;var e=this._getVector(this.endPoint);e.unproject(this.Camera);var i=new THREE.Raycaster(this.Camera.position,e.sub(this.Camera.position).normalize()).intersectObjects(this.pages,!0);if(i.length>0&&this.pageMouseDown&&!this.moved){var o=i[0];this.clickedPage=o.object.parent}this.pageMouseDown=!1,this.moved=!1},FLIPBOOK.BookWebGL.prototype.moveCamera=function(t,e){},FLIPBOOK.BookWebGL.prototype.enable=function(){this.enabled?this.onResize():(this.enabled=!0,this.initialized||(this.init3d(),this.createPages(),this.rendering=!1,this.onResize()),this.render(!0),this.onResize())},FLIPBOOK.BookWebGL.prototype.disable=function(){this.enabled=!1,this.render(!1)};var MOD3=MOD3||{};!function(t){t.Constants={PI:Math.PI,invPI:1/Math.PI,halfPI:.5*Math.PI,doublePI:2*Math.PI,toRad:1/180*Math.PI,toDeg:1/180*Math.PI},t.ModConstant={LEFT:-1,RIGHT:1,NONE:0,X:1,Y:2,Z:4}}(MOD3),function(t){var e=t.Constants;t.XMath={},t.XMath.normalize=function(e,i,o){return i-e==0?1:t.XMath.trim(0,1,(o-e)/i)},t.XMath.toRange=function(t,e,i){return e-t==0?0:t+(e-t)*i},t.XMath.inRange=function(t,e,i,o){return void 0===o&&(o=!1),o?i>=t&&i<=e:i>t&&i<e},t.XMath.sign=function(t,e){return void 0===e&&(e=0),0==t?e:t>0?1:-1},t.XMath.trim=function(t,e,i){return Math.min(e,Math.max(t,i))},t.XMath.wrap=function(t,e,i){return i<t?i+(e-t):i>=e?i-(e-t):i},t.XMath.degToRad=function(t){return t*e.toRad},t.XMath.radToDeg=function(t){return t*e.toDeg},t.XMath.presicion=function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i},t.XMath.uceil=function(t){return t<0?Math.floor(t):Math.ceil(t)}}(MOD3),function(t){t.Range=function(t,e){this.start=0,this.end=1,void 0!==t&&(this.start=t),void 0!==e&&(this.end=e)},t.Range.prototype.getSize=function(){return this.end-this.start},t.Range.prototype.move=function(t){this.start+=t,this.end+=t},t.Range.prototype.isIn=function(t){return t>=this.start&&t<=this.end},t.Range.prototype.normalize=function(e){return t.XMath.normalize(this.start,this.end,e)},t.Range.prototype.toRange=function(e){return t.XMath.toRange(this.start,this.end,e)},t.Range.prototype.trim=function(e){return t.XMath.trim(this.start,this.end,e)},t.Range.prototype.interpolate=function(t,e){return this.toRange(e.normalize(t))},t.Range.prototype.toString=function(){return"["+this.start+" - "+this.end+"]"}}(MOD3),function(t){t.Phase=function(t){this.value=0,void 0!==t&&(this.value=t)},t.Phase.prototype.getPhasedValue=function(){return Math.sin(this.value)},t.Phase.prototype.getAbsPhasedValue=function(){return Math.abs(this.getPhasedValue())},t.Phase.prototype.getNormValue=function(){return.5*(this.getPhasedValue()+1)}}(MOD3),function(t){t.Point=function(t,e){this.y=this.x=0,void 0!==t&&(this.x=t),void 0!==e&&(this.y=e)},t.Point.prototype.clone=function(){return new t.Point(this.x,this.y)}}(MOD3),function(t){t.Matrix=function(t,e,i,o){this.m11=1,this.m21=this.m12=0,this.m22=1,void 0!==t&&(this.m11=t),void 0!==e&&(this.m12=e),void 0!==i&&(this.m21=i),void 0!==o&&(this.m22=o)},t.Matrix.prototype.rotate=function(t){var e=Math.cos(t),t=Math.sin(t);return this.m11=e,this.m12=-t,this.m21=t,this.m22=e,this},t.Matrix.prototype.scale=function(t,e){return this.m21=this.m12=0,void 0!==t&&(this.m22=this.m11=t),void 0!==e&&(this.m22=e),this},t.Matrix.prototype.multiply=function(t){var e=this.m11,i=this.m12,o=this.m21,s=this.m22,n=t.m11,r=t.m12,h=t.m21,t=t.m22;return this.m11=e*n+i*h,this.m12=e*r+i*t,this.m21=o*n+s*h,this.m22=o*r+s*t,this},t.Matrix.prototype.transformPoint=function(e){return new t.Point(this.m11*e.x+this.m12*e.y,this.m21*e.x+this.m22*e.y)}}(MOD3),function(t){t.Vector3=function(t,e,i){this.z=this.y=this.x=null,this.x=t,this.y=e,this.z=i},t.Vector3.ZERO=function(){return new t.Vector3(0,0,0)},t.Vector3.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},t.Vector3.prototype.clone=function(){return new t.Vector3(this.x,this.y,this.z)},t.Vector3.prototype.equals=function(t){return this.x==t.x&&this.y==t.y&&this.z==t.z},t.Vector3.prototype.zero=function(){this.x=this.y=this.z=0},t.Vector3.prototype.negate=function(){return new t.Vector3(-this.x,-this.y,-this.z)},t.Vector3.prototype.add=function(e){return new t.Vector3(this.x+e.x,this.y+e.y,this.z+e.z)},t.Vector3.prototype.subtract=function(e){return new t.Vector3(this.x-e.x,this.y-e.y,this.z-e.z)},t.Vector3.prototype.multiplyScalar=function(e){return new t.Vector3(this.x*e,this.y*e,this.z*e)},t.Vector3.prototype.multiply=function(e){return new t.Vector3(this.x*e.x,this.y*e.y,this.z*e.z)},t.Vector3.prototype.divide=function(e){return e=1/e,new t.Vector3(this.x*e,this.y*e,this.z*e)},t.Vector3.prototype.normalize=function(){var t=this.x,e=this.y,i=this.z;(t=t*t+e*e+i*i)>0&&(t=1/Math.sqrt(t),this.x*=t,this.y*=t,this.z*=t)},t.Vector3.prototype.getMagnitude=function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},t.Vector3.prototype.setMagnitude=function(t){this.normalize(),this.x*=t,this.y*=t,this.z*=t},t.Vector3.prototype.toString=function(){return"["+this.x+" , "+this.y+" , "+this.z+"]"},t.Vector3.prototype.sum=function(t,e){return t.add(e)},t.Vector3.prototype.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},t.Vector3.prototype.cross=function(e,i){var o=e.x,s=e.y,n=e.z,r=i.x,h=i.y,a=i.z;return new t.Vector3(s*a-n*h,n*r-o*a,o*h-s*r)},t.Vector3.prototype.distance=function(t,e){var i=t.x-e.x,o=t.y-e.y,s=t.z-e.z;return Math.sqrt(i*i+o*o+s*s)}}(MOD3),function(t){t.Matrix4=function(t,e,i,o,s,n,r,h,a,p,c,u,l,f,g,d){this.n11=1,this.n21=this.n14=this.n13=this.n12=0,this.n22=1,this.n32=this.n31=this.n24=this.n23=0,this.n33=1,this.n43=this.n42=this.n41=this.n34=0,this.n44=1,void 0!==t&&(this.n11=t),void 0!==e&&(this.n12=e),void 0!==i&&(this.n13=i),void 0!==o&&(this.n14=o),void 0!==s&&(this.n21=s),void 0!==n&&(this.n22=n),void 0!==r&&(this.n23=r),void 0!==h&&(this.n24=h),void 0!==a&&(this.n31=a),void 0!==p&&(this.n32=p),void 0!==c&&(this.n33=c),void 0!==u&&(this.n34=u),void 0!==l&&(this.n41=l),void 0!==f&&(this.n42=f),void 0!==g&&(this.n43=g),void 0!==d&&(this.n44=d)},t.Matrix4.prototype.translationMatrix=function(t,e,i){return this.n14=t,this.n24=e,this.n34=i,this},t.Matrix4.prototype.scaleMatrix=function(t,e,i){return this.n11=t,this.n22=e,this.n33=i,this},t.Matrix4.prototype.rotationMatrix=function(t,e,i,o){var s=Math.cos(o),n=Math.sin(o),r=t*e*(o=1-s),h=e*i*o,a=t*i*o,p=n*i,c=n*e;return n*=t,this.n11=s+t*t*o,this.n12=-p+r,this.n13=c+a,this.n14=0,this.n21=p+r,this.n22=s+e*e*o,this.n23=-n+h,this.n24=0,this.n31=-c+a,this.n32=n+h,this.n33=s+i*i*o,this.n34=0,this},t.Matrix4.prototype.calculateMultiply=function(t,e){var i=t.n11,o=e.n11,s=t.n21,n=e.n21,r=t.n31,h=e.n31,a=t.n12,p=e.n12,c=t.n22,u=e.n22,l=t.n32,f=e.n32,g=t.n13,d=e.n13,y=t.n23,m=e.n23,x=t.n33,M=e.n33,v=t.n14,P=e.n14,b=t.n24,L=e.n24,w=t.n34,O=e.n34;this.n11=i*o+a*n+g*h,this.n12=i*p+a*u+g*f,this.n13=i*d+a*m+g*M,this.n14=i*P+a*L+g*O+v,this.n21=s*o+c*n+y*h,this.n22=s*p+c*u+y*f,this.n23=s*d+c*m+y*M,this.n24=s*P+c*L+y*O+b,this.n31=r*o+l*n+x*h,this.n32=r*p+l*u+x*f,this.n33=r*d+l*m+x*M,this.n34=r*P+l*L+x*O+w},t.Matrix4.prototype.multiply=function(t,e){return this.calculateMultiply(t,e),this},t.Matrix4.prototype.multiplyVector=function(t,e){var i=e.x,o=e.y,s=e.z;e.x=i*t.n11+o*t.n12+s*t.n13+t.n14,e.y=i*t.n21+o*t.n22+s*t.n23+t.n24,e.z=i*t.n31+o*t.n32+s*t.n33+t.n34}}(MOD3),function(t){t.VertexProxy=function(t){this.originalZ=this.originalY=this.originalX=this.ratioZ=this.ratioY=this.ratioX=null,void 0!==t&&(this.vertex=t)},t.VertexProxy.prototype.setVertex=function(){},t.VertexProxy.prototype.setRatios=function(t,e,i){this.ratioX=t,this.ratioY=e,this.ratioZ=i},t.VertexProxy.prototype.setOriginalPosition=function(t,e,i){this.originalX=t,this.originalY=e,this.originalZ=i},t.VertexProxy.prototype.getX=function(){},t.VertexProxy.prototype.getY=function(){},t.VertexProxy.prototype.getZ=function(){},t.VertexProxy.prototype.setX=function(){},t.VertexProxy.prototype.setY=function(){},t.VertexProxy.prototype.setZ=function(){},t.VertexProxy.prototype.getValue=function(e){switch(e){case t.ModConstant.X:return this.getX();case t.ModConstant.Y:return this.getY();case t.ModConstant.Z:return this.getZ()}return 0},t.VertexProxy.prototype.setValue=function(e,i){switch(e){case t.ModConstant.X:this.setX(i);break;case t.ModConstant.Y:this.setY(i);break;case t.ModConstant.Z:this.setZ(i)}},t.VertexProxy.prototype.getRatio=function(e){switch(e){case t.ModConstant.X:return this.ratioX;case t.ModConstant.Y:return this.ratioY;case t.ModConstant.Z:return this.ratioZ}return-1},t.VertexProxy.prototype.getOriginalValue=function(e){switch(e){case t.ModConstant.X:return this.originalX;case t.ModConstant.Y:return this.originalY;case t.ModConstant.Z:return this.originalZ}return 0},t.VertexProxy.prototype.reset=function(){this.setX(this.originalX),this.setY(this.originalY),this.setZ(this.originalZ)},t.VertexProxy.prototype.collapse=function(){this.originalX=this.getX(),this.originalY=this.getY(),this.originalZ=this.getZ()},t.VertexProxy.prototype.getVector=function(){return new t.Vector3(this.getX(),this.getY(),this.getZ())},t.VertexProxy.prototype.setVector=function(t){this.setX(t.x),this.setY(t.y),this.setZ(t.z)},t.VertexProxy.prototype.getRatioVector=function(){return new t.Vector3(this.ratioX,this.ratioY,this.ratioZ)}}(MOD3),function(t){t.FaceProxy=function(){this.vertices=[]},t.FaceProxy.prototype.addVertex=function(t){this.vertices.push(t)},t.FaceProxy.prototype.getVertices=function(){return this.vertices}}(MOD3),function(t){t.MeshProxy=function(){this.depth=this.height=this.width=this.minAxis=this.midAxis=this.maxAxis=this.minZ=this.minY=this.minX=this.maxZ=this.maxY=this.maxX=null,this.vertices=[],this.faces=[],this.mesh=null},t.MeshProxy.prototype.getVertices=function(){return this.vertices},t.MeshProxy.prototype.getFaces=function(){return this.faces},t.MeshProxy.prototype.analyzeGeometry=function(){for(var e,i,o,s,n,r,h,a,p,c,u=this.getVertices(),l=u.length,f=l,g=!0,d=Math.min,y=Math.max;--f>=0;)e=u[f],i=e.getX(),o=e.getY(),s=e.getZ(),g?(n=r=i,h=a=o,p=c=s,g=!1):(n=d(n,i),h=d(h,o),p=d(p,s),r=y(r,i),a=y(a,o),c=y(c,s)),e.setOriginalPosition(i,o,s);for(i=r-n,o=a-h,depth=c-p,this.width=i,this.height=o,this.depth=depth,this.minX=n,this.maxX=r,this.minY=h,this.maxY=a,this.minZ=p,this.maxZ=c,f=y(i,y(o,depth)),d=d(i,d(o,depth)),f==i&&d==o?(this.minAxis=t.ModConstant.Y,this.midAxis=t.ModConstant.Z,this.maxAxis=t.ModConstant.X):f==i&&d==depth?(this.minAxis=t.ModConstant.Z,this.midAxis=t.ModConstant.Y,this.maxAxis=t.ModConstant.X):f==o&&d==i?(this.minAxis=t.ModConstant.X,this.midAxis=t.ModConstant.Z,this.maxAxis=t.ModConstant.Y):f==o&&d==depth?(this.minAxis=t.ModConstant.Z,this.midAxis=t.ModConstant.X,this.maxAxis=t.ModConstant.Y):f==depth&&d==i?(this.minAxis=t.ModConstant.X,this.midAxis=t.ModConstant.Y,this.maxAxis=t.ModConstant.Z):f==depth&&d==o&&(this.minAxis=t.ModConstant.Y,this.midAxis=t.ModConstant.X,this.maxAxis=t.ModConstant.Z),f=l;--f>=0;)(e=u[f]).setRatios((e.getX()-n)/i,(e.getY()-h)/o,(e.getZ()-p)/depth)},t.MeshProxy.prototype.resetGeometry=function(){for(var t=this.getVertices(),e=t.length;--e>=0;)t[e].reset()},t.MeshProxy.prototype.collapseGeometry=function(){for(var t=this.getVertices(),e=t.length;--e>=0;)t[e].collapse();this.analyzeGeometry()},t.MeshProxy.prototype.getMin=function(e){switch(e){case t.ModConstant.X:return this.minX;case t.ModConstant.Y:return this.minY;case t.ModConstant.Z:return this.minZ}return-1},t.MeshProxy.prototype.getMax=function(e){switch(e){case t.ModConstant.X:return this.maxX;case t.ModConstant.Y:return this.maxY;case t.ModConstant.Z:return this.maxZ}return-1},t.MeshProxy.prototype.getSize=function(e){switch(e){case t.ModConstant.X:return this.width;case t.ModConstant.Y:return this.height;case t.ModConstant.Z:return this.depth}return-1},t.MeshProxy.prototype.setMesh=function(t){this.mesh=t,this.vertices=[],this.faces=[]},t.MeshProxy.prototype.postApply=function(){},t.MeshProxy.prototype.updateMeshPosition=function(){}}(MOD3),function(t){t.Modifier=function(){this.mod=null},t.Modifier.prototype.setModifiable=function(t){this.mod=t},t.Modifier.prototype.getVertices=function(){return this.mod.getVertices()},t.Modifier.prototype.apply=function(){}}(MOD3),MOD3.Library3d=function(){this.id="",this.vertexClass=this.meshClass=null},function(t){t.PluginFactory={},t.PluginFactory.getMeshProxy=function(t){return new t.meshClass}}(MOD3),function(t){t.ModifierStack=function(e,i){this.lib3d=e,this.stack=this.baseMesh=null,this.baseMesh=t.PluginFactory.getMeshProxy(e),this.baseMesh.setMesh(i),this.baseMesh.analyzeGeometry(),this.stack=[]},t.ModifierStack.prototype.addModifier=function(t){t.setModifiable(this.baseMesh),this.stack.push(t)},t.ModifierStack.prototype.apply=function(){this.baseMesh.resetGeometry();for(var t=this.stack,e=t.length,i=0;i<e;)t[i++].apply();this.baseMesh.postApply()},t.ModifierStack.prototype.collapse=function(){this.apply(),this.baseMesh.collapseGeometry(),this.stack=[]},t.ModifierStack.prototype.clear=function(){this.stack=[]},t.ModifierStack.prototype.getMeshInfo=function(){return this.baseMesh}}(MOD3),function(t){t.Pivot=function(e,i,o){this.pivot=new t.Vector3(e,i,o)},t.Pivot.prototype=new t.Modifier,t.Pivot.prototype.constructor=t.Pivot,t.Pivot.prototype.setMeshCenter=function(){var e=this.mod;this.pivot=new t.Vector3(-(e.minX+.5*e.width),-(e.minY+.5*e.height),-(e.minZ+.5*e.depth))},t.Pivot.prototype.apply=function(){for(var t,e,i=this.mod.getVertices(),o=i.length,s=this.pivot;--o>=0;)t=i[o],e=t.getVector().clone(),t.setVector(e.add(s));this.mod.updateMeshPosition(s.clone().negate())}}(MOD3),function(t){t.Bend=function(e,i,o){this.diagAngle=this.angle=this.offset=this.force=null,this.constraint=t.ModConstant.NONE,this.m2=this.m1=this.origin=this.height=this.width=this.mid=this.min=this.max=null,this.switchAxes=!1,this.force=e,this.offset=i,this.setAngle(o)},t.Bend.prototype=new t.Modifier,t.Bend.prototype.constructor=t.Bend,t.Bend.prototype.setAngle=function(e){this.angle=e,this.m1=new t.Matrix,this.m1.rotate(e),this.m2=new t.Matrix,this.m2.rotate(-e)},t.Bend.prototype.setModifiable=function(e){t.Modifier.prototype.setModifiable.call(this,e),this.max=this.switchAxes?this.mod.midAxis:this.mod.maxAxis,this.min=this.mod.minAxis,this.mid=this.switchAxes?this.mod.maxAxis:this.mod.midAxis,this.width=this.mod.getSize(this.max),this.height=this.mod.getSize(this.mid),this.origin=this.mod.getMin(this.max),this.diagAngle=Math.atan(this.width/this.height)},t.Bend.prototype.apply=function(){if(0!=this.force)for(var e,i,o,s,n=this.mod.getVertices(),r=n.length,h=this.width,a=this.offset,p=this.origin,c=this.max,u=this.min,l=this.mid,f=this.m1,g=this.m2,d=p+h*a,y=h/Math.PI/this.force,m=t.Constants.doublePI*(h/(y*t.Constants.doublePI)),x=1/h,M=t.Constants.halfPI,v=Math.sin,P=Math.cos;--r>=0;)h=n[r],e=h.getValue(c),i=h.getValue(l),o=h.getValue(u),i=f.transformPoint(new t.Point(e,i)),e=i.x,i=i.y,s=(e-p)*x,this.constraint==t.ModConstant.LEFT&&s<=a||this.constraint==t.ModConstant.RIGHT&&s>=a||(s=M-m*a+m*s,e=v(s)*(y+o),s=P(s)*(y+o),o=e-y,e=d-s),i=g.transformPoint(new t.Point(e,i)),e=i.x,i=i.y,h.setValue(c,e),h.setValue(l,i),h.setValue(u,o)}}(MOD3),function(t){t.Bloat=function(){this.center=t.Vector3.ZERO(),this.radius=0,this.a=.01,this.u=t.Vector3.ZERO()},t.Bloat.prototype=new t.Modifier,t.Bloat.prototype.constructor=t.Bloat,t.Bloat.prototype.setRadius=function(t){this.radius=Math.max(0,t)},t.Bloat.prototype.setA=function(t){this.a=Math.max(0,t)},t.Bloat.prototype.apply=function(){for(var t,e,i=this.mod.getVertices(),o=i.length,s=this.center,n=this.radius,r=this.a;--o>=0;)t=i[o],this.u.x=t.getX()-s.x,this.u.y=t.getY()-s.y,this.u.z=t.getZ()-s.z,e=this.u.getMagnitude(),this.u.setMagnitude(e+n*Math.exp(-e*r)),t.setX(this.u.x+s.x),t.setY(this.u.y+s.y),t.setZ(this.u.z+s.z)}}(MOD3),function(t){t.Twist=function(e){this.vector=new t.Vector3(0,1,0),this.angle=e,this.center=t.Vector3.ZERO()},t.Twist.prototype=new t.Modifier,t.Twist.prototype.constructor=t.Twist,t.Twist.prototype.apply=function(){this.vector.normalize();for(var e,i=(h=this.mod).getVertices(),o=i.length,s=this.vector,n=this.angle,r=this.center,h=1/new t.Vector3(.5*h.maxX,.5*h.maxY,.5*h.maxZ).getMagnitude()*n,r=-t.Vector3.dot(s,r);--o>=0;)n=i[o],e=n.getX()*s.x+n.getY()*s.y+n.getZ()*s.z+r,this.twistPoint(n,e*h)},t.Twist.prototype.twistPoint=function(e,i){var o=(new t.Matrix4).translationMatrix(e.getX(),e.getY(),e.getZ()),o=(new t.Matrix4).multiply((new t.Matrix4).rotationMatrix(this.vector.x,this.vector.y,this.vector.z,i),o);e.setX(o.n14),e.setY(o.n24),e.setZ(o.n34)}}(MOD3),function(t){t.Skew=function(e){this.force=0,this.skewAxis=null,void 0!==e&&(this.force=e),this.offset=.5,this.constraint=t.ModConstant.NONE,this.falloff=this.power=1,this.swapAxes=this.oneSide=this.inverseFalloff=!1},t.Skew.prototype=new t.Modifier,t.Skew.prototype.constructor=t.Skew,t.Skew.prototype.setModifiable=function(e){t.Modifier.prototype.setModifiable.call(this,e),this.skewAxis=this.skewAxis||this.mod.maxAxis},t.Skew.prototype.apply=function(){for(var e,i,o,s=this.mod.getVertices(),n=s.length,r=this.constraint,h=this.skewAxis,a=this.offset,p=this.oneSide,c=this.inverseFalloff,u=this.falloff,l=1-u,f=this.power,g=this.force,d=this.getDisplaceAxis();--n>=0;)e=s[n],!(r==t.ModConstant.LEFT&&e.getRatio(h)<=a)&&!(r==t.ModConstant.RIGHT&&e.getRatio(h)>a)&&(i=e.getRatio(h)-a,p&&(i=Math.abs(i)),o=e.getRatio(d),c&&(o=1-o),o=u+o*l,i=Math.pow(Math.abs(i),f)*t.XMath.sign(i,1),i=e.getValue(d)+g*i*o,e.setValue(d,i))},t.Skew.prototype.getDisplaceAxis=function(){switch(this.skewAxis){case t.ModConstant.X:return this.swapAxes?t.ModConstant.Z:t.ModConstant.Y;case t.ModConstant.Y:return this.swapAxes?t.ModConstant.Z:t.ModConstant.X;case t.ModConstant.Z:return this.swapAxes?t.ModConstant.Y:t.ModConstant.X;default:return 0}}}(MOD3),function(t){t.Taper=function(e){this.power=this.force=null,this.start=0,this.end=1,this.vector=new t.Vector3(1,0,1),this.vector2=new t.Vector3(0,1,0),void 0!==e&&(this.force=e),this.power=1},t.Taper.prototype=new t.Modifier,t.Taper.prototype.constructor=t.Taper,t.Taper.prototype.setFalloff=function(t,e){this.start=0,this.end=1,void 0!==t&&(this.start=t),void 0!==e&&(this.end=e)},t.Taper.prototype.apply=function(){for(var e,i,o,s=this.mod.getVertices(),n=s.length,r=this.vector,h=this.vector2,a=this.force,p=this.power;--n>=0;)e=s[n],i=e.getRatioVector().multiply(h),i=a*Math.pow(i.getMagnitude(),p),i=(new t.Matrix4).scaleMatrix(1+i*r.x,1+i*r.y,1+i*r.z),o=e.getVector(),(new t.Matrix4).multiplyVector(i,o),e.setVector(o)}}(MOD3),function(t){t.Wheel=function(){this.radius=this.roll=this.turn=this.speed=null,this.steerVector=new t.Vector3(0,1,0),this.rollVector=new t.Vector3(0,0,1),this.roll=this.turn=this.speed=0},t.Wheel.prototype=new t.Modifier,t.Wheel.prototype.constructor=t.Wheel,t.Wheel.prototype.setModifiable=function(e){t.Modifier.prototype.setModifiable.call(this,e),this.radius=.5*this.mod.width},t.Wheel.prototype.apply=function(){this.roll+=this.speed;var e,i=this.mod.getVertices(),o=i.length,s=this.steerVector,n=this.turn,r=this.rollVector,h=this.roll;for(0!=n?(e=(new t.Matrix4).rotationMatrix(s.x,s.y,s.z,n),s=r.clone(),(new t.Matrix4).multiplyVector(e,s),h=(new t.Matrix4).rotationMatrix(s.x,s.y,s.z,h)):h=(new t.Matrix4).rotationMatrix(r.x,r.y,r.z,h);--o>=0;)s=i[o],r=s.getVector().clone(),0!=n&&(new t.Matrix4).multiplyVector(e,r),(new t.Matrix4).multiplyVector(h,r),s.setX(r.x),s.setY(r.y),s.setZ(r.z)},t.Wheel.prototype.getStep=function(){return this.radius*this.speed*t.Constants.invPI},t.Wheel.prototype.getPerimeter=function(){return this.radius*t.Constants.doublePI}}(MOD3),function(t){t.Break=function(e,i){this.bv=new t.Vector3(0,1,0),this.angle=this.offset=0,void 0!==e&&(this.offset=e),void 0!==i&&(this.angle=i),this.range=new t.Range(0,1)},t.Break.prototype=new t.Modifier,t.Break.prototype.constructor=t.Break,t.Break.prototype.apply=function(){var e,i,o=this.mod,s=o.getVertices(),n=s.length,r=this.range,h=this.angle,a=this.bv;for(e=(o=new t.Vector3(0,0,-(o.minZ+o.depth*this.offset))).negate(),i=(new t.Matrix4).rotationMatrix(a.x,a.y,a.z,h);--n>=0;)h=s[n],a=h.getVector(),(a=a.add(o)).z>=0&&r.isIn(h.ratioY)&&(new t.Matrix4).multiplyVector(i,a),a=a.add(e),h.setX(a.x),h.setY(a.y),h.setZ(a.z)}}(MOD3),function(t){t.Noise=function(e){this.force=0,this.axc=t.ModConstant.NONE,this.end=this.start=0,void 0!==e&&(this.force=e)},t.Noise.prototype=new t.Modifier,t.Noise.prototype.constructor=t.Noise,t.Noise.prototype.constraintAxes=function(t){this.axc=t},t.Noise.prototype.setFalloff=function(t,e){this.start=0,this.end=1,void 0!==t&&(this.start=t),void 0!==e&&(this.end=e)},t.Noise.prototype.apply=function(){for(var t,e,i,o=this.mod,s=this.axc,n=this.start,r=this.end,h=o.getVertices(),a=h.length,p=this.force,c=.5*p,u=Math.random;--a>=0;)t=h[a],e=u()*p-c,i=t.getRatio(o.maxAxis),n<r?(i<n&&(i=0),i>r&&(i=1)):n>r?((i=1-i)>n&&(i=0),i<r&&(i=1)):i=1,1&s||t.setX(t.getX()+e*i),s>>1&1||t.setY(t.getY()+e*i),s>>2&1||t.setZ(t.getZ()+e*i)}}(MOD3),function(t){t.LibraryThree=function(){this.id="Three.js",this.meshClass=t.MeshThree,this.vertexClass=t.VertexThree},t.LibraryThree.prototype=new t.Library3d,t.LibraryThree.prototype.constructor=t.LibraryThree}(MOD3),function(t){t.VertexThree=function(t){this.mesh=t},t.VertexThree.prototype=new t.VertexProxy,t.VertexThree.prototype.setVertex=function(t){this.vertex=t,this.originalX=t.x,this.originalY=t.y,this.originalZ=t.z},t.VertexThree.prototype.getX=function(){return this.vertex.x},t.VertexThree.prototype.getY=function(){return this.vertex.y},t.VertexThree.prototype.getZ=function(){return this.vertex.z},t.VertexThree.prototype.setX=function(t){this.vertex.x=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0},t.VertexThree.prototype.setY=function(t){this.vertex.y=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0},t.VertexThree.prototype.setZ=function(t){this.vertex.z=t,(t=this.mesh).geometry.verticesNeedUpdate=!0,t.geometry.normalsNeedUpdate=!0,t.geometry.buffersNeedUpdate=!0,t.geometry.dynamic=!0}}(MOD3),function(t){t.MeshThree=function(){},t.MeshThree.prototype=new t.MeshProxy,t.MeshThree.prototype.setMesh=function(e){t.MeshProxy.prototype.setMesh.call(this,e);for(var i,e=[],o=0,s=this.mesh.geometry.vertices,n=s.length,r=this.mesh.geometry.faces,h=r.length,o=0;o<n;)(i=new t.VertexThree(this.mesh)).setVertex(s[o]),this.vertices.push(i),e[s[o]]=i,o++;for(o=0;o<h;)n=new t.FaceProxy,r[o]instanceof THREE.Face3?(n.addVertex(e[s[r[o].a]]),n.addVertex(e[s[r[o].b]]),n.addVertex(e[s[r[o].c]])):r[o]instanceof THREE.Face4&&(n.addVertex(e[s[r[o].a]]),n.addVertex(e[s[r[o].b]]),n.addVertex(e[s[r[o].c]]),n.addVertex(e[s[r[o].d]])),this.faces.push(n),o++;delete lookup},t.MeshThree.prototype.updateMeshPosition=function(t){var e=this.mesh;e.position.x+=t.x,e.position.y+=t.y,e.position.z+=t.z}}(MOD3),function(t){t.LibraryPre3D=function(){this.id="pre3d.js",this.meshClass=t.MeshPre3D,this.vertexClass=t.VertexPre3D},t.LibraryThree.prototype=new t.Library3d,t.LibraryThree.prototype.constructor=t.LibraryPre3D}(MOD3),function(t){t.VertexPre3D=function(){},t.VertexPre3D.prototype=new t.VertexProxy,t.VertexPre3D.prototype.setVertex=function(t){this.vertex=t,this.originalX=t.x,this.originalY=t.y,this.originalZ=t.z},t.VertexPre3D.prototype.getX=function(){return this.vertex.x},t.VertexPre3D.prototype.getY=function(){return this.vertex.y},t.VertexPre3D.prototype.getZ=function(){return this.vertex.z},t.VertexPre3D.prototype.setX=function(t){this.vertex.x=t},t.VertexPre3D.prototype.setY=function(t){this.vertex.y=t},t.VertexPre3D.prototype.setZ=function(t){this.vertex.z=t}}(MOD3),function(t){t.MeshPre3D=function(){},t.MeshPre3D.prototype=new t.MeshProxy,t.MeshPre3D.prototype.setMesh=function(e){t.MeshProxy.prototype.setMesh.call(this,e);for(var e=[],i=this.mesh.vertices,o=this.mesh.quads,s=i.length,n=o.length,r=0;r<s;r++){var h=new t.VertexPre3D;h.setVertex(i[r]),this.vertices.push(h),e[i[r]]=h}for(r=0;r<n;r++)s=new t.FaceProxy,o[r]instanceof Pre3d.QuadFace&&(s.addVertex(e[i[o[r].i0]]),s.addVertex(e[i[o[r].i1]]),s.addVertex(e[i[o[r].i2]]),null!=o[r].i3&&s.addVertex(e[i[o[r].i3]])),this.faces.push(s);delete lookup},t.MeshPre3D.prototype.updateMeshPosition=function(){}}(MOD3),function(t){t.LibraryJ3D=function(){this.id="J3D",this.meshClass=t.MeshJ3D,this.vertexClass=t.VertexJ3D},t.LibraryJ3D.prototype=new t.Library3d,t.LibraryJ3D.prototype.constructor=t.LibraryJ3D}(MOD3),function(t){t.VertexJ3D=function(t){this.geometry=t},t.VertexJ3D.prototype=new t.VertexProxy,t.VertexJ3D.prototype.setVertex=function(t){this.vertex=t;var e=this.geometry;this.originalX=e.vertexPositionBuffer.data[t],this.originalY=e.vertexPositionBuffer.data[t+1],this.originalZ=e.vertexPositionBuffer.data[t+2]},t.VertexJ3D.prototype.getX=function(){return this.geometry.vertexPositionBuffer.data[this.vertex]},t.VertexJ3D.prototype.getY=function(){return this.geometry.vertexPositionBuffer.data[this.vertex+1]},t.VertexJ3D.prototype.getZ=function(){return this.geometry.vertexPositionBuffer.data[this.vertex+2]},t.VertexJ3D.prototype.setX=function(t){var e=this.geometry;e.vertexPositionBuffer.data[this.vertex]=t,e.replaceArray(e.vertexPositionBuffer,e.vertexPositionBuffer.data)},t.VertexJ3D.prototype.setY=function(t){var e=this.geometry;e.vertexPositionBuffer.data[this.vertex+1]=t,e.replaceArray(e.vertexPositionBuffer,e.vertexPositionBuffer.data)},t.VertexJ3D.prototype.setZ=function(t){var e=this.geometry;e.vertexPositionBuffer.data[this.vertex+2]=t,e.replaceArray(e.vertexPositionBuffer,e.vertexPositionBuffer.data)}}(MOD3),function(t){t.MeshJ3D=function(){},t.MeshJ3D.prototype=new t.MeshProxy,t.MeshJ3D.prototype.setMesh=function(e){t.MeshProxy.prototype.setMesh.call(this,e);for(var i,o=0,s=e.geometry.vertexPositionBuffer.data.length,n=e.geometry.vertexPositionBuffer.itemSize,o=0;o<s;)(i=new t.VertexJ3D(e.geometry)).setVertex(o),this.vertices.push(i),o+=n;this.faces=null},t.MeshJ3D.prototype.updateMeshPosition=function(t){var e=this.mesh;e.position.x+=t.x,e.position.y+=t.y,e.position.z+=t.z}}(MOD3),function(t){t.LibraryCopperlicht=function(){this.id="Copperlicht",this.meshClass=t.MeshCopperlicht,this.vertexClass=t.VertexCopperlicht},t.LibraryCopperlicht.prototype=new t.Library3d,t.LibraryCopperlicht.prototype.constructor=t.LibraryCopperlicht}(MOD3),function(t){t.VertexCopperlicht=function(t,e){this.node=t,this.buffer=e},t.VertexCopperlicht.prototype=new t.VertexProxy,t.VertexCopperlicht.prototype.setVertex=function(t){this.vertex=t,this.originalX=this.vertex.Pos.X,this.originalY=this.vertex.Pos.Y,this.originalZ=this.vertex.Pos.Z},t.VertexCopperlicht.prototype.getX=function(){return this.vertex.Pos.X},t.VertexCopperlicht.prototype.getY=function(){return this.vertex.Pos.Y},t.VertexCopperlicht.prototype.getZ=function(){return this.vertex.Pos.Z},t.VertexCopperlicht.prototype.setX=function(t){this.vertex.Pos.X=t,this.buffer.update(!0)},t.VertexCopperlicht.prototype.setY=function(t){this.vertex.Pos.Y=t,this.buffer.update(!0)},t.VertexCopperlicht.prototype.setZ=function(t){this.vertex.Pos.Z=t,this.buffer.update(!0)}}(MOD3),function(t){t.MeshCopperlicht=function(){},t.MeshCopperlicht.prototype=new t.MeshProxy,t.MeshCopperlicht.prototype.setMesh=function(e){t.MeshProxy.prototype.setMesh.call(this,e);for(var e=this.mesh.getMesh().GetMeshBuffers(),i=[],o=0;o<e.length;o++)for(var i=e[o].Vertices,s=i.length,n=0;n<s;n++){var r=new t.VertexCopperlicht(this.mesh,e[o]);r.setVertex(i[n]),this.vertices.push(r)}this.faces=null,delete lookup},t.MeshCopperlicht.prototype.updateMeshPosition=function(t){this.mesh.Pos.X+=t.x,this.mesh.Pos.Y+=t.y,this.mesh.Pos.Z+=t.z}}(MOD3),function(t){if("performance"in t==!1&&(t.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in t.performance==!1){var e=t.performance.timing&&t.performance.timing.navigationStart?performance.timing.navigationStart:Date.now();t.performance.now=function(){return Date.now()-e}}}(this);var TWEEN=TWEEN||function(){var t=[];return{REVISION:"14",getAll:function(){return t},removeAll:function(){t=[]},add:function(e){t.push(e)},remove:function(e){var i=t.indexOf(e);-1!==i&&t.splice(i,1)},update:function(e){if(0===t.length)return!1;var i=0;for(e=void 0!==e?e:window.performance.now();i<t.length;)t[i].update(e)?i++:t.splice(i,1);return!0}}}();TWEEN.Tween=function(t){var e=t,i={},o={},s={},n=1e3,r=0,h=!1,a=!1,p=!1,c=0,u=null,l=TWEEN.Easing.Linear.None,f=TWEEN.Interpolation.Linear,g=[],d=null,y=!1,m=null,x=null,M=null;for(var v in t)i[v]=parseFloat(t[v],10);this.to=function(t,e){return void 0!==e&&(n=e),o=t,this},this.start=function(t){TWEEN.add(this),a=!0,y=!1,u=void 0!==t?t:window.performance.now(),u+=c;for(var n in o){if(o[n]instanceof Array){if(0===o[n].length)continue;o[n]=[e[n]].concat(o[n])}i[n]=e[n],i[n]instanceof Array==!1&&(i[n]*=1),s[n]=i[n]||0}return this},this.stop=function(){return a?(TWEEN.remove(this),a=!1,null!==M&&M.call(e),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var t=0,e=g.length;t<e;t++)g[t].stop()},this.delay=function(t){return c=t,this},this.repeat=function(t){return r=t,this},this.yoyo=function(t){return h=t,this},this.easing=function(t){return l=t,this},this.interpolation=function(t){return f=t,this},this.chain=function(){return g=arguments,this},this.onStart=function(t){return d=t,this},this.onUpdate=function(t){return m=t,this},this.onComplete=function(t){return x=t,this},this.onStop=function(t){return M=t,this},this.update=function(t){var a;if(t<u)return!0;!1===y&&(null!==d&&d.call(e),y=!0);var M=(t-u)/n,v=l(M=M>1?1:M);for(a in o){var P=i[a]||0,b=o[a];b instanceof Array?e[a]=f(b,v):("string"==typeof b&&(b=P+parseFloat(b,10)),"number"==typeof b&&(e[a]=P+(b-P)*v))}if(null!==m&&m.call(e,v),1==M){if(r>0){isFinite(r)&&r--;for(a in s){if("string"==typeof o[a]&&(s[a]=s[a]+parseFloat(o[a],10)),h){var L=s[a];s[a]=o[a],o[a]=L}i[a]=s[a]}return h&&(p=!p),u=t+c,!0}null!==x&&x.call(e);for(var w=0,O=g.length;w<O;w++)g[w].start(t);return!1}return!0}},TWEEN.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},Out:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},InOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-TWEEN.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*TWEEN.Easing.Bounce.In(2*t):.5*TWEEN.Easing.Bounce.Out(2*t-1)+.5}}},TWEEN.Interpolation={Linear:function(t,e){var i=t.length-1,o=i*e,s=Math.floor(o),n=TWEEN.Interpolation.Utils.Linear;return e<0?n(t[0],t[1],o):e>1?n(t[i],t[i-1],i-o):n(t[s],t[s+1>i?i:s+1],o-s)},Bezier:function(t,e){var i,o=0,s=t.length-1,n=Math.pow,r=TWEEN.Interpolation.Utils.Bernstein;for(i=0;i<=s;i++)o+=n(1-e,s-i)*n(e,i)*t[i]*r(s,i);return o},CatmullRom:function(t,e){var i=t.length-1,o=i*e,s=Math.floor(o),n=TWEEN.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(s=Math.floor(o=i*(1+e))),n(t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i],o-s)):e<0?t[0]-(n(t[0],t[0],t[1],t[1],-o)-t[0]):e>1?t[i]-(n(t[i],t[i],t[i-1],t[i-1],o-i)-t[i]):n(t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2],o-s)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=TWEEN.Interpolation.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:function(){var t=[1];return function(e){var i,o=1;if(t[e])return t[e];for(i=e;i>1;i--)o*=i;return t[e]=o}}(),CatmullRom:function(t,e,i,o,s){var n=.5*(i-t),r=.5*(o-e),h=s*s;return(2*e-2*i+n+r)*(s*h)+(-3*e+3*i-2*n-r)*h+n*s+e}}};

Mr. DellatioNx196 GaLers xh3LL Backd00r 1.0, Coded By Mr. DellatioNx196 - Bogor BlackHat