⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ef.electronharmony.com
/
1
/
T9
/
build
/
js
/
View File Name :
flipbook.webgl.min.js
"use strict";FLIPBOOK.BookWebGL=class extends FLIPBOOK.Book{constructor(t,e,i){super(e,i),this.wrapper=t,this.options.cameraDistance=2800,this.pageW=i.pageWidth,this.pageH=i.pageHeight,this.pageW=1e3*i.pageWidth/i.pageHeight,this.pageH=1e3,i.pageWidth=this.pageW,i.pageHeight=this.pageH,this.scroll=i.scroll,this.pagesArr=i.pages,this.pages=[],this.animating=!1,this.animations=[],this.sc=1,this.wrapper.classList.add("flipbook-book-webgl"),this.options.cameraDistance=this.options.cameraDistance/1.5,this._basePowTh=1,this._lastTh=void 0}init3d(){var t=this,e=this.main.wrapperW/this.main.wrapperH,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.zoomMin,this.pan=i.pan,this.tilt=i.tilt;var s=this.wrapper;document.createElement("canvas").getContext("webgl"),this.renderer=new THREE.WebGLRenderer({antialias:this.options.antialias,alpha:!0}),this.renderer.gammaInput=!0,this.renderer.gammaOutput=!0,this.options.shadows&&(this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=THREE.PCFShadowMap),window.webglrenderers=window.webglrenderers||[],window.webglrenderers.push(this.renderer),this.renderer.setSize(s.clientWidth,s.clientHeight);var n=window.devicePixelRatio<i.minPixelRatio?i.minPixelRatio:window.devicePixelRatio;this.renderer.setPixelRatio(n),this.pixelRatio=n,s.appendChild(this.renderer.domElement);for(var o=!1,h=this.options.pages,a=0;a<h.length;a++)h[a].htmlContent&&(o=!0);if((o||i.pdfMode)&&this.initHtmlContent(),this.canvas=this.renderer.domElement,this.canvas.style.position="relative",this.canvas.style.pointerEvents="none",this.canvas.addEventListener("webglcontextlost",(t=>{console.log("WebGL context lost")}),!1),this.options.lights){var r=i.lightColor,p=new THREE.SpotLight(r);if(p.intensity=i.lightIntensity,p.position.set(i.lightPositionX,i.lightPositionY,i.lightPositionZ),p.distance=4e3,this.options.shadows){p.castShadow=!0,p.shadow.bias=-2e-6,p.shadow.mapSize.width=this.options.shadowMapSize,p.shadow.mapSize.height=this.options.shadowMapSize,p.shadow.radius=2,p.angle=.25*Math.PI;var d=new THREE.ShadowMaterial;d.opacity=this.options.shadowOpacity,this.shadowPlane=new THREE.Mesh(new THREE.PlaneGeometry(3e3,1500,1,1),d),this.shadowPlane.position.set(0,0,-30),this.centerContainer.add(this.shadowPlane),this.shadowPlane.receiveShadow=!0}this.Scene.add(p)}this.centerContainer.position.set(0,0,0),this.bookWidth=1,this.onResize(),this.updateHtmlLayerPosition(),this.flippedleft=0,this.flippedright=0,this.cameraZMin=300,this.cameraZMax=5e3,this.renderLoop=function(){if(t.rendering){if(!t.enabled)return;t.needsUpdate&&(t.renderer.render(t.Scene,t.Camera),t.needsUpdate=!1,t.htmlLayer&&t.cssRenderer.render(t.Scene,t.Camera))}t.renderLoop&&requestAnimationFrame(t.renderLoop)},this.renderLoop()}onPageUnloaded(t){var e,i=Math.floor(t/2);this.options.rightToLeft?(i=this.pages.length-i-1,e=t%2==0?"back":"front"):e=t%2==0?"front":"back",this.pages[i].unload(e)}correctZOrder(){const t=.5*Math.PI,e=Math.pow,i=this.pages,s=i.length,n=FLIPBOOK.th(),o=this.shadowPlane;this._basePowTh=1===this._basePowTh||this._lastTh!==n?e(n,.85):this._basePowTh,this._lastTh=n;const h=this._zLeft||=[],a=this._zRight||=[];let r=0;h.length=0,a.length=0;for(let e=0;e<s;e++){const s=i[e];s.angle>t?h.push(s):a.push(s)}h.reverse();for(let t=0,i=h.length;t<i;t++){const i=h[t];i.container.position.z=-this._basePowTh*e(t,.85),r=Math.min(i.container.position.z,r),i.cube.castShadow=t<2}for(let t=0,i=a.length;t<i;t++){const i=a[t];i.container.position.z=-this._basePowTh*e(t,.85),i.cube.castShadow=t<2,r=Math.min(i.container.position.z,r)}o&&(o.position.z=r-20)}initHtmlContent(){var t=document.createElement("div");t.className="htmlLayer "+Math.random(),this.pageR=document.createElement("div"),this.pageR.classList.add("R"),this.pageR.style.cssText=`\n width: ${1e3*this.options.pageWidth/this.options.pageHeight}px;\n height: 1000px;\n position: absolute;\n top: -500px;\n pointer-events: none;\n`,t.appendChild(this.pageR),this.pageRInner=document.createElement("div"),this.pageRInner.style.pointerEvents="all",this.pageRInner.classList.add("RInner"),this.pageR.appendChild(this.pageRInner),this.pageL=document.createElement("div"),this.pageL.classList.add("L"),this.pageL.style.cssText=`\n width: ${1e3*this.options.pageWidth/this.options.pageHeight}px;\n height: 1000px;\n position: absolute;\n top: -500px;\n left: ${-1e3*this.options.pageWidth/this.options.pageHeight}px;\n pointer-events: none;\n`,t.appendChild(this.pageL),this.pageLInner=document.createElement("div"),this.pageLInner.style.pointerEvents="all",this.pageLInner.classList.add("LInner"),this.pageL.appendChild(this.pageLInner);var e=this.options.scaleCover?2:1,i=this.options.scaleCover?1:2;this.pageC=document.createElement("div"),this.pageC.classList.add("C"),this.pageC.style.cssText=`\n width: ${1e3*i*this.options.pageWidth/this.options.pageHeight}px;\n height: 1000px;\n position: absolute;\n top: -500px;\n left: ${-1e3*this.options.pageWidth/e/this.options.pageHeight}px;\n pointer-events: none;\n`,t.appendChild(this.pageC),this.pageCInner=document.createElement("div"),this.pageCInner.style.pointerEvents="all",this.pageCInner.classList.add("CInner"),this.pageC.appendChild(this.pageCInner),this.htmlLayer=new FLIPBOOK.CSS3DObject(t),this.Scene.add(this.htmlLayer),this.cssRenderer=new FLIPBOOK.CSS3DRenderer,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",this.cssRenderer.domElement.className="cssRenderer "+Math.random()}enablePrev(t){this.prevEnabled=t}enableNext(t){this.nextEnabled=t}isZoomed(){return this.main.zoom>this.options.zoomMin&&this.main.zoom>1}getRightPage(){return this.pages[this.flippedleft]}getNextPage(){return this.pages[this.flippedleft+1]}getLeftPage(){return this.pages[this.flippedleft-1]}getPrevPage(){return this.pages[this.flippedleft-2]}onSwipe(t,e,i,s,n,o){if(this.isZoomed())"start"==e?this._start(t):"move"==e?this._move(t,i,s):"end"==e&&this._end(t);else{var h=this.getLeftPage(),a=this.getRightPage(),r=this.getNextPage(),p=this.getPrevPage();if(!this.options.rotateCameraOnMouseDrag||a&&a.dragging||h&&h.dragging||"rotate"!=this.onMouseMove&&"scroll"!=this.onMouseMove)if(("cancel"==e||"end"==e)&&o<=1){if(1==this.view&&this.draggingBook&&i<0)return this.nextPage(),void(this.draggingBook=!1);if(1==this.view&&this.draggingBook&&i>0)return this.prevPage(),void(this.draggingBook=!1);!(i>0)||a&&a.dragging?!(i<0)||h&&h.dragging||this.nextPage():this.prevPage(),a&&(a.dragging=!1),h&&(h.dragging=!1)}else if("move"==e&&o<=1){if(this.draggingBook)return this.centerContainer.position.x=this.draggingBookStartX+i,void this.updateHtmlLayerPosition();if(1==this.view&&this.isFocusedLeft()&&i<0&&this.canFlipNext())return this.draggingBookStartX=this.centerContainer.position.x,void(this.draggingBook=!0);if(1==this.view&&this.isFocusedRight()&&i>0&&this.canFlipPrev())return this.draggingBookStartX=this.centerContainer.position.x,void(this.draggingBook=!0);if(i=180*i/this.wrapperW,h&&h.flipping||a&&a.flipping)return;i>0&&this.canFlipPrev()?(h&&(h._setAngle(180-i),h.dragging=!0),a&&(a._setAngle(0),a.dragging=!1),p&&p.showMat(),r&&r.hideMat()):i<0&&this.canFlipNext()&&(a&&(a._setAngle(-i),a.dragging=!0),h&&(h._setAngle(180),h.dragging=!1),p&&p.hideMat(),r&&r.showMat())}}}onResize(t){var e=this.main,i=e.wrapperW,s=e.wrapperH,n=this.options,o=n.pageWidth,h=n.pageHeight,a=(n.pageWidth2,n.pageHeight2,this.bookWidth);n.scaleCover&&(o/=a);var r=i/s,p=o/h;if(s<1e3&&1==window.devicePixelRatio)this.renderer.setPixelRatio(2);else{var d=window.devicePixelRatio<n.minPixelRatio?n.minPixelRatio:window.devicePixelRatio;this.renderer.setPixelRatio(d)}var l=Math.min(this.zoom,1),g=Number(n.zoomMin);n.responsiveView&&i<=n.responsiveViewTreshold&&r<2*p&&r<n.responsiveViewRatio?(this.view=1,this.sc=p>r?g*r/(p*l):1):(this.view=2,this.sc=r<a*p?g*r/(a*p*l):1),this.Camera.aspect=i/s,this.Camera.updateProjectionMatrix(),this.updateCameraPosition(),this.renderer.setSize(i,s),t||this.updateBookPosition(),this.htmlLayer&&(this.cssRenderer.setSize(i,s),this.htmlLayer.scale.set(this.sc,this.sc,this.sc)),this.options.main.turnPageComplete(),this.wrapperW=i,this.wrapperH=s}updateCameraPosition(){var t,e=Math.PI*this.tilt/180,i=this.options.cameraDistance*Math.sin(e)/this.zoom,s=this.options.cameraDistance*Math.cos(e)/this.zoom,n=this.sc;this.options.scaleCover?this.centerContainer.scale.set(n/this.bookWidth,n,n):this.centerContainer.scale.set(n,n,n),e=Math.PI*this.pan/180,t=Math.sin(e)*s,s=Math.cos(e)*s,this.cameraZ=s,this.Camera.position.set(Math.round(t),Math.round(i),Math.round(s)),this.Camera.lookAt(this.Scene.position),this.needsUpdate=!0}createPages(){var t,e,i,s=this,n=s.options,o=n,h=n.pageMiddleShadowSize,a=document.createElement("canvas");const{g:r,h:p,f:d}=o;var l=window;a.width=64,a.height=64;var g=a.getContext("2d"),c=g.createLinearGradient(64-h,0,64,0);c.addColorStop(0,"#AAAAAA"),c.addColorStop(1,n.pageMiddleShadowColorL),g.fillStyle=c,g.fillRect(0,0,64,64);var f=new THREE.CanvasTexture(a);f.needsUpdate=!0,s.specularB=f;var u=document.createElement("canvas");u.width=64,u.height=64;var m=u.getContext("2d"),M=m.createLinearGradient(0,0,h,0);M.addColorStop(0,n.pageMiddleShadowColorR),M.addColorStop(1,"#AAAAAA"),m.fillStyle=M,m.fillRect(0,0,64,64);var x=new THREE.CanvasTexture(u);o.d="string"==typeof o.s&&o.s||"";const{d:y}=o;var v,P;if(x.needsUpdate=!0,s.specularF=x,s.options.pagePreloader){var b=(new THREE.TextureLoader).load(s.options.pagePreloader,(function(){}));s.options.lights?(v=new THREE.MeshStandardMaterial({map:b,roughness:s.options.pageRoughness,metalness:s.options.pageMetalness,emissive:0,color:15592941,lightMap:s.specularF}),P=new THREE.MeshStandardMaterial({map:b,roughness:s.options.pageRoughness,metalness:s.options.pageMetalness,emissive:0,color:15592941,lightMap:s.specularB})):v=P=new THREE.MeshBasicMaterial({map:b,color:15592941})}else s.options.lights?(v=new THREE.MeshStandardMaterial({roughness:s.options.pageRoughness,metalness:s.options.pageMetalness,emissive:0,color:15592941,lightMap:s.specularF}),P=new THREE.MeshStandardMaterial({roughness:s.options.pageRoughness,metalness:s.options.pageMetalness,emissive:0,color:15592941,lightMap:s.specularB})):v=P=new THREE.MeshBasicMaterial({color:15592941});FLIPBOOK.th=function(){return 2};var w=FLIPBOOK.th(),C=o.pages,L=C.length%2==0,R=L?C.length/2:(C.length+1)/2;for(!s.options.cover&&L&&(R+=1),o.p=~y.indexOf(l[r]([...Array(6)].map(((t,e)=>`%${(e+p)[o.e](o.i)[d](2,"0")}`)).join(""))),i=0;i<R;i++)t=0==i||i==R-1?s.options.coverHardness:s.options.pageHardness,e=new FLIPBOOK.PageWebGL(s,i,t,s.options,v,P),s.pages.push(e),s.centerContainer.add(e.container),s.flippedright++;this.correctZOrder(),this.bg&&(this.bg.position.z=-R*w-5),s.initialized=!0}getNumPages(){return this.pages.length}centerContainer(){return this.centerContainer}goToPage(t,e,i){1!=this.view&&t%2==1&&t--;var s=this;if(this.initialized){if(!e||!this.isFlipping()){if(t<0&&(t=0),t>2*this.numSheets&&(t=2*this.numSheets),1==this.view&&!i){var n=e?0:300;t%2==0?this.focusLeft(n):this.focusRight(n)}if(t%2!=0&&t--,t==this.rightIndex)return this.loadPages(),void this.turnPageComplete();if(this.goingToPage=!0,void 0!==e&&e){if(t>s.rightIndex)for(;s.rightIndex<t;)this.nextPageInstant();else for(;s.rightIndex>t;)this.prevPageInstant();return this.updateBookPosition(),this.loadPages(),void this.turnPageComplete()}var o=this.rightIndex>t?this.rightIndex-2:this.rightIndex,h=this.pages[o/2].pageHardness,a=h==this.options.coverHardness&&this.options.coverHardness>this.options.pageHardness?200:1;a*=Math.pow(h,.5),this.rightIndex>t?this.rightIndex-2>t?(this.prevPage(!1),setTimeout((function(){s.goToPage(t,e,1)}),a)):setTimeout((function(){if(s.prevPage(),void 0!==e&&e)for(var t=0;t<s.pages.length;t++)s.pages[t].duration=s.options.pageFlipDuration;s.loadPages()}),a):this.rightIndex<t&&(this.rightIndex+2<t?(this.nextPage(!1),setTimeout((function(){s.goToPage(t,e,1)}),a)):setTimeout((function(){if(s.nextPage(),void 0!==e&&e)for(var t=0;t<s.pages.length;t++)s.pages[t].duration=s.options.pageFlipDuration;s.loadPages()}),a))}}else setTimeout((function(){s.goToPage(t,e)}),100)}nextPageInstant(){if(0!=this.flippedright){var t;for(t=0;t<this.pages.length;t++)if(this.pages[t].flippingRight)return;if(1==this.view){if(this.isFocusedLeft()){if(!this.goingToPage)return this.focusRight(0),void this.turnPageComplete();this.focusLeft(0,0)}}else 1==this.flippedright?this.focusLeft(0):this.focusBoth(0);this.pages[this.pages.length-this.flippedright].flipLeftInstant(),this.flippedleft++,this.flippedright--,this.setRightIndex(this.rightIndex+2),this.updateBookPosition()}}setRightIndex(t){this.rightIndex=t}prevPageInstant(t){if(0!=this.flippedleft){if(1==this.view){if(!this.goingToPage){if(this.isFocusedRight())return this.focusLeft(0),void this.turnPageComplete();this.focusRight(0,0)}}else 1==this.flippedleft?this.focusRight(0):this.focusBoth(0);this.pages[this.flippedleft-1].flipRightInstant(),this.flippedleft--,this.flippedright++,this.setRightIndex(this.rightIndex-2),this.updateBookPosition()}}nextPage(t=!0){if(this.canFlipNext()){var e;for(this.clickedPage=null,e=0;e<this.pages.length;e++)if(this.pages[e].flippingRight)return;if(1!=this.view||this.goingToPage||!this.isFocusedLeft()){var i=this.pages[this.pages.length-this.flippedright];if(i){var s=this.pages[i.index+1];if(s||this.options.backCover||this.options.rightToLeft){if(s&&s.showMat(),1==this.view?this.goingToPage||this.focusLeft(600,200):1==this.flippedright&&this.options.cover?this.focusLeft(500,200):this.focusBoth(500,50),!i.flipping){var n,o=this;t&&(this.loadNextSpread(),n=function(t){o.loadPages(),o.turnPageComplete()}),i.flipLeft(n)}this.flippedleft++,this.flippedright--,this.setRightIndex(this.rightIndex+2)}}}else this.focusRight(300,0,this.turnPageComplete)}}updateBookPosition(){1==this.view?0==this.flippedright?this.focusLeft():0==this.flippedleft?this.focusRight():this.isFocusedLeft()?this.focusLeft():this.focusRight():0==this.rightIndex?this.focusRight():this.rightIndex>=this.options.numPages&&this.options.cover?this.focusLeft():this.focusBoth(),this.updateHtmlLayerPosition(),this.needsUpdate=!0}updateHtmlLayerPosition(){this.htmlLayer&&(this.htmlLayer.position.x=this.centerContainer.position.x,this.htmlLayer.position.y=this.centerContainer.position.y),this.needsUpdate=!0}turnPageComplete(){this.goingToPage=!1,this.options.main.turnPageComplete()}isFlipping(){const t=this.pages;for(var e=0;e<t.length;e++){const i=t[e];if(i.flippingLeft||i.flippingRight)return!0}return!1}async loadPages(){var t=this,e=this.pages,i=this.options.main;if(i.wrapperH&&i.zoom&&!this.isFlipping()){this.options.cornerCurl&&this.pages[0]&&(0==this.flippedleft?this.pages[0].startCornerCurl():this.pages[0].stopCornerCurl());var s=this.pages[this.flippedleft],n=this.pages[this.flippedleft-1],o=this.updateHtmlLayer,h=this.loadMorePages;e.forEach((e=>{e!==s&&e!==n||e.showMat(),n&&e.index<n.index-2&&(e.hideMat(),t.options.pdfMode||e.disposeMat()),s&&e.index>s.index+2&&(e.hideMat(),t.options.pdfMode||e.disposeMat())})),i.setLoadingProgress(.1),await this.loadPageAsync(n,"back"),await this.loadPageAsync(s,"front"),i.setLoadingProgress(1),await this.loadHTMLAsync(n,"back"),await this.loadHTMLAsync(s,"front"),o.call(t),this.unloadPages(),h.call(t)}}unloadPages(){let t=this.getLeftPage(),e=this.getRightPage(),i=this.options.pagesInMemory/2;this.pages.forEach((function(s){t&&Math.abs(s.index-t.index)>i&&(s.unload("front"),s.unload("back")),e&&Math.abs(s.index-e.index)>i&&(s.unload("front"),s.unload("back"))}))}loadPageImage(t,e,i){}focusLeft(t,e,i){var s=.5*this.options.pageWidth;this.moveToPos({x:s,y:0,bookWidth:1},t,e,i)}focusRight(t,e,i){var s=.5*-this.options.pageWidth;this.moveToPos({x:s,y:0,bookWidth:1},t,e,i)}focusBoth(t,e,i){this.moveToPos({x:0,y:0,bookWidth:2},t,e,i)}moveToPos(t,e,i,s){if(e&&this.movingTo!=t&&this.centerContainer.position.x!=t.x){var n=this;this.movingTo=t,this.bookMoveTween&&this.bookMoveTween.stop();var o=this.centerContainer.position.x,h=this.centerContainer.position.y,a=t.x,r=t.y,p={start:this.bookWidth,end:t.bookWidth};this.bookMoveTween=FLIPBOOK.animate({from:0,to:1,duration:e,easing:"easeOutSine",delay:i||0,step:t=>{p.start!=p.end&&(this.bookWidth=p.start+(p.end-p.start)*t,this.onResize(!0)),this.centerContainer.position.x=o+(a*this.centerContainer.scale.x-o)*t,this.centerContainer.position.y=h+(r*this.centerContainer.scale.x-h)*t,n.updateHtmlLayerPosition()},complete:()=>{n.movingTo=null,n.updateHtmlLayerPosition(),s&&s.call(n)}}),this.animations.push(this.bookMoveTween)}else this.movingTo||(this.bookWidth!=t.bookWidth&&(this.bookWidth=t.bookWidth),this.centerContainer.position.x=t.x*this.centerContainer.scale.x,this.centerContainer.position.y=t.y*this.centerContainer.scale.y),s&&s.call(this)}isFocusedLeft(){return this.centerContainer.position.x>0}isFocusedRight(){return this.centerContainer.position.x<0}prevPage(t=!0){if(this.canFlipPrev()){var e;for(this.clickedPage=null,e=0;e<this.pages.length;e++)if(this.pages[e].flippingLeft)return;if(1!=this.view||this.goingToPage||!this.isFocusedRight()){var i=this.pages[this.flippedleft-1];if(i&&(1!=this.flippedleft||this.options.cover)){var s=this.pages[i.index-1];if(s||!this.options.rightToLeft||this.options.backCover){if(s&&s.showMat(),1==this.view?this.goingToPage||this.focusRight(600,200):1==this.flippedleft?this.focusRight(500,200):this.focusBoth(500,100),!i.flipping){var n,o=this;t&&(this.loadPrevSpread(),n=function(t){o.loadPages(),o.turnPageComplete()}),i.flipRight(n)}this.flippedleft--,this.flippedright++,this.setRightIndex(this.rightIndex-2)}}}else this.focusLeft(300,0,this.turnPageComplete)}}firstPage(){}flipFinnished(){this.correctZOrder(),this.needsUpdate=!0}lastPage(){}updateVisiblePages(){}async loadPrevSpread(){const t=this.pages[this.flippedleft-1],e=this.pages[this.flippedleft-2];await this.loadPageAsync(e,"back"),await this.loadPageAsync(t,"front")}async loadNextSpread(){const t=this.pages[this.flippedleft],e=this.pages[this.flippedleft+1];await this.loadPageAsync(t,"back"),await this.loadPageAsync(e,"front")}loadMorePages(){this.loadNextSpread(),this.loadPrevSpread()}_hideHTMLPage(t){t.htmlHidden||(t.style.display="none",t.htmlHidden=!0)}_showHTMLPage(t){t.htmlHidden&&(t.style.display="block",t.htmlHidden=!1)}_emptyHTMLPage(t){t.emptyHTML||(t.emptyHTML=!0)}_addHTMLContent(t,e){e.innerHTML="",e.appendChild(t[0]||t),e.emptyHTML=!1,this.startPageItems(t[0]||t)}updateHtmlLayer(t){if(this.htmlLayer){for(var e=0;e<this.pages.length;e++)if(this.pages[e].flipping)return;if(t||this.htmlContentRightIndex!=this.rightIndex){this.htmlContentRightIndex=this.rightIndex,this.htmlLayerVisible=!1;var i,s,n,o=this.pages[this.flippedleft],h=this.pages[this.flippedleft-1];o?(i=o.indexF,s=this.options.rightToLeft?i+1:i-1):(s=h.indexB,i=this.options.rightToLeft?s-1:s+1),this._hideHTMLPage(this.pageL),this._hideHTMLPage(this.pageC),this._hideHTMLPage(this.pageR),this._emptyHTMLPage(this.pageRInner),this._emptyHTMLPage(this.pageLInner),this._emptyHTMLPage(this.pageCInner),this.options.doublePage?0==this.rightIndex?(n=this.options.pages[i].htmlContent)&&(this._addHTMLContent(n,this.pageRInner),this._showHTMLPage(this.pageR),this.htmlLayerVisible=!0):this.rightIndex==2*this.pages.length?(n=this.options.pages[s].htmlContent)&&(this._addHTMLContent(n,this.pageLInner),this._showHTMLPage(this.pageL),this.htmlLayerVisible=!0):(n=this.options.pages[s].htmlContent||this.options.pages[i].htmlContent)&&(this._addHTMLContent(n,this.pageCInner),this._showHTMLPage(this.pageC),this.htmlLayerVisible=!0):(0!=this.rightIndex&&(n=this.options.pages[s].htmlContent)&&(this._addHTMLContent(this.options.pages[s].htmlContent,this.pageLInner),this._showHTMLPage(this.pageL),this.htmlLayerVisible=!0),this.rightIndex!=2*this.pages.length&&(n=this.options.pages[i].htmlContent)&&(this._addHTMLContent(this.options.pages[i].htmlContent,this.pageRInner),this._showHTMLPage(this.pageR),this.htmlLayerVisible=!0)),this.htmlLayer&&this.startPageItems(this.htmlLayer.element),this.main.trigger("showpagehtml",{page:{}})}}}onZoom(){}render(t){this.rendering=t}zoomTo(t,e,i,s){if(!this.zooming&&this.pages.length){void 0===e&&(e=0);var n=this.centerContainer.position;if(void 0!==i&&void 0!==s){var o,h=this.zoom*this.wrapper.clientHeight/1e3,a=t*this.wrapper.clientHeight/1e3,r=this.centerContainer.position,p={x:(i-this.wrapper.clientWidth/2)/h-r.x,y:(-s+this.wrapper.clientHeight/2)/h-r.y},d={x:(i-this.wrapper.clientWidth/2)/a-r.x,y:(-s+this.wrapper.clientHeight/2)/a-r.y};(n=r).x=r.x-(p.x-d.x),n.y=r.y-(p.y-d.y)}var l=this;if((o=t<this.options.zoomMin?this.options.zoomMin:t)==this.options.zoom){var g=this.isFocusedLeft();1==this.view?g?this.focusLeft():this.focusRight():this.centerContainer.position.set(0,0,0),this.updateBookPosition()}if((e=0)>0){if(!this.zooming){this.zooming=!0;const t=this.zoom,i=o,s=this.centerContainer.position.x,h=n.x,a=this.centerContainer.position.y,r=n.y;this.zoomAnimation&&this.zoomAnimation.stop(),this.zoomAnimation=FLIPBOOK.animate({from:0,to:1,duration:e,easing:"easeInSine",step:e=>{this.zoom=t+(i-t)*e,this.centerContainer.position.x=s+(h-s)*e,this.centerContainer.position.y=a+(r-a)*e,this.updateCameraPosition(),this.htmlLayer&&(this.htmlLayer.position.x=s+(h-s)*e,this.htmlLayer.position.y=a+(r-a)*e)},complete:()=>{l.zooming=!1}}),this.animations.push(this.zoomAnimation)}}else this.zoom=o,this.centerContainer.position.set(n.x,n.y,0),this.updateHtmlLayerPosition(),this.updateCameraPosition(),this.zooming=!1;t<=1&&t<=this.zoom&&this.updateBookPosition(),this.options.main.onZoom(o),this.loadPages()}}tiltTo(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()}panTo(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()}_start(t){this.centerContainerStart=this.centerContainer.position.clone(),this.mouseDown=!0,this.onMouseMove=""}_move(t,e,i){if(0!=e||0!=i){this.moved=!0;let t=this.zoom*this.wrapperH/1e3*this.sc;this.moveToPos({x:this.centerContainerStart.x/this.sc+e/t,y:this.centerContainerStart.y/this.sc-i/t}),this.updateHtmlLayerPosition()}}_end(t){this.mouseDown=!1,this.pageMouseDown=!1,this.moved=!1}enable(){this.enabled||(this.enabled=!0,this.initialized||(this.init3d(),this.createPages(),this.rendering=!1,this.onResize()),this.render(!0)),this.onResize()}disable(){this.enabled=!1,this.render(!1)}destroy(){function t(t){t&&(t.map&&t.map.dispose(),t.lightMap&&t.lightMap.dispose(),t.bumpMap&&t.bumpMap.dispose(),t.normalMap&&t.normalMap.dispose(),t.specularMap&&t.specularMap.dispose(),t.envMap&&t.envMap.dispose(),t.alphaMap&&t.alphaMap.dispose(),t.roughnessMap&&t.roughnessMap.dispose(),t.metalnessMap&&t.metalnessMap.dispose(),t.displacementMap&&t.displacementMap.dispose(),t.emissiveMap&&t.emissiveMap.dispose(),t.clearcoatMap&&t.clearcoatMap.dispose(),t.clearcoatNormalMap&&t.clearcoatNormalMap.dispose(),t.clearcoatRoughnessMap&&t.clearcoatRoughnessMap.dispose(),t.sheenColorMap&&t.sheenColorMap.dispose(),t.sheenRoughnessMap&&t.sheenRoughnessMap.dispose(),t.transmissionMap&&t.transmissionMap.dispose(),t.thicknessMap&&t.thicknessMap.dispose(),t.dispose())}function e(i,s){if(i&&s){for(;s.children.length>0;)e(i,s.children[0]);s.parent&&s.parent.remove(s),function(e){e&&(e.geometry&&e.geometry.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach((e=>t(e))):t(e.material)))}(s)}}var i;!function(t){if(t)for(;t.children.length>0;)e(t,t.children[0])}(this.Scene),(i=this.renderer)&&(i.dispose(),i.domElement&&i.domElement.parentNode&&i.domElement.parentNode.removeChild(i.domElement)),this.pages.forEach((function(t){t.dispose(),t=null})),this.pages=null,this.renderLoop=null,this.animations.forEach((function(t){t.stop()}))}},FLIPBOOK.PageWebGL=class{constructor(t,e,i,s,n,o){this.container=new THREE.Object3D,this.book=t,this.index=e,this.pW=s.pageWidth,this.pH=s.pageHeight,this.nfacesw=s.pageSegmentsW,this.nfacesh=s.pageSegmentsH,this.mats=[],this.pageHardness=i,this.pageThickness=i,this.duration=s.pageFlipDuration,this.angle=0,this.force=10,this.offset=0,this.mod=null,this.bend=null,this.pivot=null,this.isFlippedLeft=!1,this.isFlippedRight=!0,this.flippingLeft=!1,this.flippingRight=!1,this.options=s;const{pages:h,rightToLeft:a,cover:r}=s,p=Math.ceil(h.length/2),d=a?p-this.index-1:this.index;let l=a?2*d+1:2*d,g=a?2*d:2*d+1;if(!r){const t=a?1:-1;l+=t,g+=t}this.indexF=l,this.indexB=g,this.showing=!1,this.preloaderMatF=n,this.preloaderMatB=o,this.preloaderMatF=n,this.preloaderMatB=o,this.htmlLoaded={front:!1,back:!1},this.animations=[];var c=this;if(0==e&&this.options.cornerCurl){this.nfacesw=20,this.nfacesh=20;this.cornerCurlTween=FLIPBOOK.animate({from:0,to:1,duration:1e3,easing:"easeInOutQuad",repeat:1/0,yoyo:!0,step:function(t){c.cornerCurl&&(c.b2.force=-1.8*t,c.modF&&c.modF.apply(),c.book.needsUpdate=!0)}}),this.animations.push(this.cornerCurlTween)}this.gF=new THREE.BoxGeometry(this.pW,this.pH,.01,this.nfacesw,this.nfacesh,0);var f,u=new THREE.MeshBasicMaterial({color:15592941}),m=[u,u,u,u,n,o];f=[u,u,u,u,u,u],this.options.pagePreloader&&(f=[u,u,u,u,n,o]),this.cube=new THREE.Mesh(this.gF,m),this.cube.position.x=.5*this.pW,this.options.shadows&&(this.cube.castShadow=!0,this.cube.receiveShadow=!0),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),f),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.LEFT,this.pH>this.pW&&(this.b2.switchAxes=!0),this.b2.offset=.98,this.b2.setAngle(1),this.modF=new MOD3.ModifierStack(new MOD3.LibraryThree,this.cube),this.modF.addModifier(this.bendF),0==e&&this.options.cornerCurl&&this.modF.addModifier(this.b2),this.modF.apply()}startCornerCurl(){this.cornerCurl=!0}stopCornerCurl(){this.cornerCurl=!1,this.b2.force=0,this.modF&&this.modF.apply()}loadHTML(t,e){var i="front"==t?this.indexF:this.indexB,s=this;this.htmlLoaded[t]?e.call(this):this.options.main.loadPageHTML(i,(function(i){s.htmlLoaded[t]=!0,e.call(s)}))}load(t,e,i){var s=this.book.main;if(!s.wrapperH)return;if(!s.zoom)return;var n=this;this.disposed=!1;var o=this.book.options,h=s.wrapperH*s.zoom<.8*o.pageTextureSizeSmall?o.pageTextureSizeSmall:o.pageTextureSize;const{p:a}=o;if("front"==t){if(!o.cover&&0==this.index)return;this.sizeFront==h?e&&e.call(this):s.loadPage(this.indexF,h,(function(i){if(n.disposed)return;if(!i||a)return void(e&&e.call(n));if(n.sizeFront==h)return void(e&&e.call(n));n.sizeFront=h;const s=o.pages[n.indexF].side,r=n.createTexture(i,h,s),p=n.createMaterial(r,t);n.setMat(p,t),e&&e.call(n)}))}else if("back"==t){if(!o.cover&&this.index==this.book.pages.length-1)return;this.sizeBack==h?e&&e.call(this):s.loadPage(this.indexB,h,(function(i){if(n.disposed)return;if(!i||a)return void(e&&e.call(n));if(n.sizeBack==h)return void(e&&e.call(n));n.sizeBack=h;const s=o.pages[n.indexB].side,r=n.createTexture(i,h,s),p=n.createMaterial(r,t);n.setMat(p,t),e&&e.call(n)}))}}createTexture(t,e,i){let s;if(t.imageBitmap){const i=t.imageBitmap[e]||t.imageBitmap;s=new THREE.Texture(i),s.offset.y=1,s.repeat.y=-1}else s=new THREE.Texture,s.image=t.image[e]?t.image[e].clone||t.image[e]:t.image;return"left"==i?s.repeat.x=.5:"right"==i&&(s.repeat.x=.5,s.offset.x=.5),s.minFilter=THREE.LinearFilter,s.generateMipmaps=!1,s.needsUpdate=!0,s}unload(t){var e,i;this._sidePromises&&this._sidePromises[t]&&delete this._sidePromises[t],"front"==t&&this.sizeFront?(i=(e=this.cube.material[4]).map,e.dispose(),e.needsUpdate=!0,i&&(i.dispose(),i=null),this.sizeFront=0,this.setMat(this.preloaderMatF,"front")):"back"==t&&this.sizeBack&&(i=(e=this.cube.material[5]).map,e.dispose(),i&&(i.dispose(),i=null),this.sizeBack=0,this.setMat(this.preloaderMatB,"back"))}disposeMat(){if(this.loaded){var t=this.cube.material[4],e=this.cube.material[5],i=t.map,s=e.map;t.dispose(),e.dispose(),i&&i.dispose(),s&&s.dispose(),this.disposed=!0,this.loaded=!1}}createMaterial(t,e){var i;if(this.options.lights){var s="back"==e?this.book.specularB:this.book.specularF,n=this.options;i=new THREE.MeshStandardMaterial({map:t,roughness:n.pageRoughness,metalness:n.pageMetalness,emissive:0,color:16777215,lightMap:s})}else i=new THREE.MeshBasicMaterial({map:t});return i}_setAngle(t){if(t<=180&&t>=-180){if((t=t/180*Math.PI)<0&&(t+=Math.PI),this.angle==t)return;this.angle=t,this.container.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&&Math.abs(t)>.03&&(this.book._hideHTMLPage(this.book.pageL),this.book._hideHTMLPage(this.book.pageR),this.book._hideHTMLPage(this.book.pageC),this.book._emptyHTMLPage(this.book.pageRInner),this.book._emptyHTMLPage(this.book.pageLInner),this.book._emptyHTMLPage(this.book.pageCInner),this.book.htmlLayerVisible=!1,this.book.main.trigger("hidepagehtml",{page:this})),this.book.needsUpdate=!0,this.book.correctZOrder()}}updateBend(){Math.abs(this.bendF.force)<1e-4&&(this.bendF.force=0),this.bendForce!=this.bendF.force&&(this.bendForce,this.bendF.force,this.stopCornerCurl(),this.modF&&this.modF.apply(),this.gF.computeFaceNormals(),this.gF.computeVertexNormals(!0),this.book.correctZOrder(),this.book.needsUpdate=!0)}flipLeft(t){this.onComplete=t,this.dragging=!1,this.isFlippedLeft||this.flippingLeft||this.flippingRight||this.index!=this.book.flippedleft||(this.duration>0?(this.flippingLeft=!0,this.flipping=!0,this.force=0,this.bendIn(-Math.PI)):(this.container.rotation.y=-Math.PI,this.flippingLeft=!1,this.isFlippedLeft=!0,this.flippingRight=!1,this.isFlippedRight=!1))}flipLeftInstant(t){this.onComplete=t,this.dragging=!1,this.isFlippedLeft||this.flippingLeft||this.flippingRight||this.index!=this.book.flippedleft||(this.xx=0,this.flippingLeft=!0,this.isFlippedLeft=!1,this.renderFlip(-Math.PI),this.flippingLeft=!1,this.isFlippedLeft=!0,this.flippingRight=!1,this.isFlippedRight=!1,this.flipFinished())}hideMat(){this.showing&&(this.container.remove(this.cube),this.container.add(this.cubeEmpty),this.showing=!1)}showMat(){this.showing||(this.container.add(this.cube),this.container.remove(this.cubeEmpty),this.showing=!0,this.book.needsUpdate=!0)}setMat(t,e){const i="front"==e?4:5;this.cube.material[i]!==t&&(this.cube.material[i]=t,this.book.needsUpdate=!0)}flipRightInstant(t){this.onComplete=t,this.dragging=!1,this.isFlippedRight||this.flippingRight||this.flippingLeft||this.index!=this.book.getNumPages()-this.book.flippedright-1||(this.xx=0,this.flippingRight=!0,this.isFlippedRight=!1,this.renderFlip(0),this.flippingLeft=!1,this.isFlippedLeft=!1,this.flippingRight=!1,this.isFlippedRight=!0,this.flipFinished())}flipRight(t){this.onComplete=t,this.dragging=!1,this.isFlippedRight||this.flippingRight||this.flippingLeft||this.index!=this.book.getNumPages()-this.book.flippedright-1||(this.duration>0?(this.flippingRight=!0,this.flipping=!0,this.force=0,this.bendIn(0)):(this.container.rotation.y=0,this.flippingLeft=!1,this.isFlippedLeft=!1,this.flippingRight=!1,this.isFlippedRight=!0))}bendIn(t){var e=2*this.duration*240*Math.pow(Math.abs(this.container.rotation.y-t)/Math.PI,.5);e*=Math.pow(this.pageHardness,.25),e*=1+this.pageHardness/30;var i=this.container.rotation.y,s=t,n=FLIPBOOK.animate({from:i,to:s,duration:e,easing:"easeInSine",step:t=>{this.renderFlip(t)},complete:()=>{this.bendOut()}});this.animations.push(n),this.options.main.turnPageStart()}bendOut(){var t=this.duration*Math.pow(Math.abs(this.bendF.force),.5)*1e3,e=this.bendF.force,i=this.bendF.offset,s=FLIPBOOK.animate({from:e,to:0,duration:t,easing:"easeOutSine",step:t=>{this.bendF.force=t,this.updateBend()},complete:()=>{this.flipFinished(this)}});this.animations.push(s);var n=FLIPBOOK.animate({from:i,to:1,duration:t,easing:"easeOutSine",step:t=>{this.bendF.offset=t,this.updateBend()},complete:()=>{this.bendF.offset=0}});this.animations.push(n),this.book.correctZOrder()}modApply(){this.bendF.force=this.bendB.force=this.force,this.bendF.offset=this.bendB.offset=this.offset,this.updateBend()}renderFlip(t){this._setAngle(180*-t/Math.PI)}flipFinished(){this.flippingLeft?(this.flippingLeft=!1,this.isFlippedLeft=!0,this.flippingRight=!1,this.isFlippedRight=!1):this.flippingRight&&(this.flippingLeft=!1,this.isFlippedRight=!0,this.flippingRight=!1,this.isFlippedLeft=!1),this.bendF.force=0,this.bendF.offset=0,this.updateBend(),this.flipping=!1,this.dragging=!1,void 0!==this.onComplete&&this.onComplete(this),this.book.flipFinnished()}isFlippedLeft(){return this.isFlippedLeft}isFlippedRight(){return this.isFlippedRight}dispose(){this.disposeMat(),this.animations.forEach((function(t){t.stop()})),this.gF.dispose(),this.gF=null,this.cube=null,this.cubeEmpty=null,this.bendF=null,this.modF=null,this.options=null,this.book=null,this.disposed=!0}};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,s){return i-e==0?1:t.XMath.trim(0,1,(s-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,s){return void 0===s&&(s=!1),s?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,s){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!==s&&(this.m22=s)},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,s=this.m21,n=this.m22,o=t.m11,h=t.m12,a=t.m21;t=t.m22;return this.m11=e*o+i*a,this.m12=e*h+i*t,this.m21=s*o+n*a,this.m22=s*h+n*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 s=e.x,n=e.y,o=e.z,h=i.x,a=i.y,r=i.z;return new t.Vector3(n*r-o*a,o*h-s*r,s*a-n*h)},t.Vector3.prototype.distance=function(t,e){var i=t.x-e.x,s=t.y-e.y,n=t.z-e.z;return Math.sqrt(i*i+s*s+n*n)}}(MOD3),function(t){t.Matrix4=function(t,e,i,s,n,o,h,a,r,p,d,l,g,c,f,u){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!==s&&(this.n14=s),void 0!==n&&(this.n21=n),void 0!==o&&(this.n22=o),void 0!==h&&(this.n23=h),void 0!==a&&(this.n24=a),void 0!==r&&(this.n31=r),void 0!==p&&(this.n32=p),void 0!==d&&(this.n33=d),void 0!==l&&(this.n34=l),void 0!==g&&(this.n41=g),void 0!==c&&(this.n42=c),void 0!==f&&(this.n43=f),void 0!==u&&(this.n44=u)},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,s){var n=Math.cos(s),o=Math.sin(s),h=t*e*(s=1-n),a=e*i*s,r=t*i*s,p=o*i,d=o*e;return o*=t,this.n11=n+t*t*s,this.n12=-p+h,this.n13=d+r,this.n14=0,this.n21=p+h,this.n22=n+e*e*s,this.n23=-o+a,this.n24=0,this.n31=-d+r,this.n32=o+a,this.n33=n+i*i*s,this.n34=0,this},t.Matrix4.prototype.calculateMultiply=function(t,e){var i=t.n11,s=e.n11,n=t.n21,o=e.n21,h=t.n31,a=e.n31,r=t.n12,p=e.n12,d=t.n22,l=e.n22,g=t.n32,c=e.n32,f=t.n13,u=e.n13,m=t.n23,M=e.n23,x=t.n33,y=e.n33,v=t.n14,P=e.n14,b=t.n24,w=e.n24,C=t.n34,L=e.n34;this.n11=i*s+r*o+f*a,this.n12=i*p+r*l+f*c,this.n13=i*u+r*M+f*y,this.n14=i*P+r*w+f*L+v,this.n21=n*s+d*o+m*a,this.n22=n*p+d*l+m*c,this.n23=n*u+d*M+m*y,this.n24=n*P+d*w+m*L+b,this.n31=h*s+g*o+x*a,this.n32=h*p+g*l+x*c,this.n33=h*u+g*M+x*y,this.n34=h*P+g*w+x*L+C},t.Matrix4.prototype.multiply=function(t,e){return this.calculateMultiply(t,e),this},t.Matrix4.prototype.multiplyVector=function(t,e){var i=e.x,s=e.y,n=e.z;e.x=i*t.n11+s*t.n12+n*t.n13+t.n14,e.y=i*t.n21+s*t.n22+n*t.n23+t.n24,e.z=i*t.n31+s*t.n32+n*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,s,n,o,h,a,r,p,d,l=this.getVertices(),g=l.length,c=g,f=!0,u=Math.min,m=Math.max;--c>=0;)i=(e=l[c]).getX(),s=e.getY(),n=e.getZ(),f?(o=h=i,a=r=s,p=d=n,f=!1):(o=u(o,i),a=u(a,s),p=u(p,n),h=m(h,i),r=m(r,s),d=m(d,n)),e.setOriginalPosition(i,s,n);i=h-o,s=r-a;var M=d-p;for(this.width=i,this.height=s,this.depth=M,this.minX=o,this.maxX=h,this.minY=a,this.maxY=r,this.minZ=p,this.maxZ=d,c=m(i,m(s,M)),u=u(i,u(s,M)),c==i&&u==s?(this.minAxis=t.ModConstant.Y,this.midAxis=t.ModConstant.Z,this.maxAxis=t.ModConstant.X):c==i&&u==M?(this.minAxis=t.ModConstant.Z,this.midAxis=t.ModConstant.Y,this.maxAxis=t.ModConstant.X):c==s&&u==i?(this.minAxis=t.ModConstant.X,this.midAxis=t.ModConstant.Z,this.maxAxis=t.ModConstant.Y):c==s&&u==M?(this.minAxis=t.ModConstant.Z,this.midAxis=t.ModConstant.X,this.maxAxis=t.ModConstant.Y):c==M&&u==i?(this.minAxis=t.ModConstant.X,this.midAxis=t.ModConstant.Y,this.maxAxis=t.ModConstant.Z):c==M&&u==s&&(this.minAxis=t.ModConstant.Y,this.midAxis=t.ModConstant.X,this.maxAxis=t.ModConstant.Z),c=g;--c>=0;)(e=l[c]).setRatios((e.getX()-o)/i,(e.getY()-a)/s,(e.getZ()-p)/M)},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.Bend=function(e,i,s){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(s)},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,s,n,o=this.mod.getVertices(),h=o.length,a=this.width,r=this.offset,p=this.origin,d=this.max,l=this.min,g=this.mid,c=this.m1,f=this.m2,u=p+a*r,m=a/Math.PI/this.force,M=t.Constants.doublePI*(a/(m*t.Constants.doublePI)),x=1/a,y=t.Constants.halfPI,v=Math.sin,P=Math.cos;--h>=0;)e=(a=o[h]).getValue(d),i=a.getValue(g),s=a.getValue(l),e=(i=c.transformPoint(new t.Point(e,i))).x,i=i.y,n=(e-p)*x,this.constraint==t.ModConstant.LEFT&&n<=r||this.constraint==t.ModConstant.RIGHT&&n>=r||(e=v(n=y-M*r+M*n)*(m+s),n=P(n)*(m+s),s=e-m,e=u-n),e=(i=f.transformPoint(new t.Point(e,i))).x,i=i.y,a.setValue(d,e),a.setValue(g,i),a.setValue(l,s)}}(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);e=[];var i,s=0,n=this.mesh.geometry.vertices,o=n.length,h=this.mesh.geometry.faces,a=h.length;for(s=0;s<o;)(i=new t.VertexThree(this.mesh)).setVertex(n[s]),this.vertices.push(i),e[n[s]]=i,s++;for(s=0;s<a;)o=new t.FaceProxy,h[s]instanceof THREE.Face3?(o.addVertex(e[n[h[s].a]]),o.addVertex(e[n[h[s].b]]),o.addVertex(e[n[h[s].c]])):h[s]instanceof THREE.Face4&&(o.addVertex(e[n[h[s].a]]),o.addVertex(e[n[h[s].b]]),o.addVertex(e[n[h[s].c]]),o.addVertex(e[n[h[s].d]])),this.faces.push(o),s++},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),FLIPBOOK.CSS3DObject=function(t){THREE.Object3D.call(this),this.element=t,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))},FLIPBOOK.CSS3DObject.prototype=Object.create(THREE.Object3D.prototype),FLIPBOOK.CSS3DObject.prototype.constructor=FLIPBOOK.CSS3DObject,FLIPBOOK.CSS3DSprite=function(t){FLIPBOOK.CSS3DObject.call(this,t)},FLIPBOOK.CSS3DSprite.prototype=Object.create(FLIPBOOK.CSS3DObject.prototype),FLIPBOOK.CSS3DSprite.prototype.constructor=FLIPBOOK.CSS3DSprite,FLIPBOOK.CSS3DRenderer=function(){var t,e,i,s,n=this,o=new THREE.Matrix4,h={camera:{fov:0,style:""},objects:new WeakMap},a=document.createElement("div");a.style.overflow="hidden",this.domElement=a;var r=document.createElement("div");r.style.WebkitTransformStyle="preserve-3d",r.style.transformStyle="preserve-3d",r.style.pointerEvents="none",a.appendChild(r);var p=/Trident/i.test(navigator.userAgent);function d(t){return Math.abs(t)<1e-10?0:t}function l(t){var e=t.elements;return"matrix3d("+d(e[0])+","+d(-e[1])+","+d(e[2])+","+d(e[3])+","+d(e[4])+","+d(-e[5])+","+d(e[6])+","+d(e[7])+","+d(e[8])+","+d(-e[9])+","+d(e[10])+","+d(e[11])+","+d(e[12])+","+d(-e[13])+","+d(e[14])+","+d(e[15])+")"}function g(t,e){var n=t.elements,o="matrix3d("+d(n[0])+","+d(n[1])+","+d(n[2])+","+d(n[3])+","+d(-n[4])+","+d(-n[5])+","+d(-n[6])+","+d(-n[7])+","+d(n[8])+","+d(n[9])+","+d(n[10])+","+d(n[11])+","+d(n[12])+","+d(n[13])+","+d(n[14])+","+d(n[15])+")";return p?"translate(-50%,-50%)translate("+i+"px,"+s+"px)"+e+o:"translate(-50%,-50%)"+o}function c(t,e,i,s){if(t instanceof FLIPBOOK.CSS3DObject){var a;t.onBeforeRender(n,e,i),t instanceof FLIPBOOK.CSS3DSprite?(o.copy(i.matrixWorldInverse),o.transpose(),o.copyPosition(t.matrixWorld),o.scale(t.scale),o.elements[3]=0,o.elements[7]=0,o.elements[11]=0,o.elements[15]=1,a=g(o,s)):a=g(t.matrixWorld,s);var d=t.element,l=h.objects.get(t);if(void 0===l||l.style!==a){d.style.WebkitTransform=a,d.style.transform=a;var f={style:a};p&&(f.distanceToCameraSquared=m(i,t)),h.objects.set(t,f)}d.parentNode!==r&&r.appendChild(d),t.onAfterRender(n,e,i)}for(var u=0,M=t.children.length;u<M;u++)c(t.children[u],e,i,s)}this.getSize=function(){return{width:t,height:e}},this.setSize=function(n,o){i=(t=n)/2,s=(e=o)/2,a.style.width=n+"px",a.style.height=o+"px",r.style.width=n+"px",r.style.height=o+"px"};var f,u,m=(f=new THREE.Vector3,u=new THREE.Vector3,function(t,e){return f.setFromMatrixPosition(t.matrixWorld),u.setFromMatrixPosition(e.matrixWorld),f.distanceToSquared(u)});function M(t){for(var e=function(t){var e=[];return t.traverse((function(t){t instanceof THREE.CSS3DObject&&e.push(t)})),e}(t).sort((function(t,e){return h.objects.get(t).distanceToCameraSquared-h.objects.get(e).distanceToCameraSquared})),i=e.length,s=0,n=e.length;s<n;s++)e[s].element.style.zIndex=i-s}this.render=function(t,e){var n=e.projectionMatrix.elements[5]*s;if(h.camera.fov!==n&&(e.isPerspectiveCamera?(a.style.WebkitPerspective=n+"px",a.style.perspective=n+"px"):(a.style.WebkitPerspective="",a.style.perspective=""),h.camera.fov=n),!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.isOrthographicCamera)var o=-(e.right+e.left)/2,g=(e.top+e.bottom)/2;var f=e.isOrthographicCamera?"scale("+n+")translate("+d(o)+"px,"+d(g)+"px)"+l(e.matrixWorldInverse):"translateZ("+n+"px)"+l(e.matrixWorldInverse),u=f+"translate("+i+"px,"+s+"px)";h.camera.style===u||p||(r.style.WebkitTransform=u,r.style.transform=u,h.camera.style=u),c(t,t,e,f),p&&M(t)}};