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