(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-723bfbd6"],{2621:function(t,e){e.f=Object.getOwnPropertySymbols},2909:function(t,e,i){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i',prevIcon:'',nextIcon:''}},methods:{move:function(t){var e=0;this.firstOffsetY?(e=t.changedTouches[0].clientY-this.firstOffsetY,this.$store.commit("SET_OFFSETY",e)):this.firstOffsetY=t.changedTouches[0].clientY,t.preventDefault(),t.stopPropagation()},onMouseEnter:function(t){this.mouseMove=1,this.mouseStartTime=t.timeStamp,t.preventDefault(),t.stopPropagation()},onMouseMove:function(t){if(1===this.mouseMove)this.mouseMove=2;else if(2===this.mouseMove){var e=0;this.firstOffsetY?(e=t.clientY-this.firstOffsetY,this.$store.commit("SET_OFFSETY",e)):this.firstOffsetY=t.clientY}t.preventDefault(),t.stopPropagation()},onMouseEnd:function(t){2===this.mouseMove&&(this.$store.dispatch("setOffsetY",0),this.firstOffsetY=0,this.mouseMove=3),this.mouseEndTime=t.timeStamp;var e=this.mouseEndTime-this.mouseStartTime;e<200&&(this.mouseMove=1),t.preventDefault(),t.stopPropagation()},moveEnd:function(t){this.$store.dispatch("setOffsetY",0),this.firstOffsetY=0},onMaskClick:function(t){if(2===this.mouseMove);else if(1===this.mouseMove||4===this.mouseMove){var e=t.offsetX,i=window.innerWidth;e>0&&e<.3*i?this.prevPage():e>0&&e>.7*i?this.nextPage():this.toggleMenuVisible()}this.mouseMove=4},prevPage:function(){this.rendition&&(this.rendition.prev(),this.refreshLocation()),this.hideMenuVisible()},nextPage:function(){this.rendition&&(this.rendition.next(),this.refreshLocation()),this.hideMenuVisible()},addHighLight:function(t,e,i,n){var o=this;this.rendition.annotations.highlight(t,{id:i},(function(){var t=this.getAttribute("data-id");o.updateId=t,o.isUpdate=!0,o.showAnnotate=!0;var i=this.getBoundingClientRect();o.left=i.x;var n=i.height;n<30&&(n=30),o.top=i.y+n+10,o.clickAnnotate=1,window.parent.postMessage({_viewMark:o._viewMark,id:t,annotateType:"epub-highlight",text:e,type:"showMindmapAnnotate"},"*")}),null,{fill:n})},highlight:function(t){var e=this,i=this;if(this.isUpdate){var n,o;if(this.updateId)this.annotations.forEach((function(a,s){a.id==i.updateId&&(o=a.cfiRange,n=s,"delete"!=t&&(t!=a.color&&(e.rendition.annotations.remove(a.cfiRange,"highlight"),e.addHighLight(a.cfiRange,a.text,a.id,t)),a.color=t))})),o&&"delete"==t&&(this.rendition.annotations.remove(o,"highlight"),this.annotations.splice(n,1)),window.parent.postMessage({_viewMark:this._viewMark,annotations:this.annotations,type:"saveAnnotations"},"*");return this.isUpdate=!1,this.updateId="",void(this.showAnnotate=!1)}if(this.selectedCfiRange){var a=h();this.annotations.push({id:a,cfiRange:this.selectedCfiRange,text:this.selectedText,color:t,type:"epub-highlight"}),this.addHighLight(this.selectedCfiRange,this.selectedText,a,t),this.selectedCfiRange="",this.selectedText="",this.showAnnotate=!1,window.parent.postMessage({_viewMark:this._viewMark,annotations:this.annotations,type:"saveAnnotations"},"*")}},removeAnnotations:function(){var t=this;try{this.annotations.forEach((function(e){t.rendition.annotations.remove(e.cfiRange,"highlight")}))}catch(e){console.log(e)}},refreshAnnotations:function(){if(this.rendition){var t=this;this.rendition.views();this.annotations.forEach((function(e){t.rendition.annotations.highlight(e.cfiRange,{id:e.id},(function(){var i=this.getAttribute("data-id");t.updateId=i,t.isUpdate=!0,t.showAnnotate=!0;var n=this.getBoundingClientRect();t.left=n.x;var o=n.height;o<30&&(o=30),t.top=n.y+o+10,t.clickAnnotate=1,window.parent.postMessage({_viewMark:t._viewMark,id:e.id,annotateType:"epub-highlight",text:e.text,type:"showMindmapAnnotate"},"*")}),null,{fill:e.color})}))}},showToAnnotate:function(t){var e=this;this.annotations.length&&this.annotations.forEach((function(i){i.id==t&&e.rendition&&e.rendition.display(i.cfiRange)}))},initGuest:function(){var t=this,e=this,i=null;this.rendition.on("rendered",(function(n,o,a){t.removeAnnotations(),i&&clearTimeout(i),i=setTimeout((function(){t.refreshAnnotations(),e.epubId&&(setTimeout((function(){e.showToAnnotate(id)}),400),e.epubId="")}),600),o.document.addEventListener("click",(function(t){setTimeout((function(){if(e.isUpdate&&1==e.clickAnnotate)e.clickAnnotate++;else{e.isUpdate=!1;var i=o.window.getSelection();if(!i||i.isCollapsed){e.showAnnotate&&(e.showAnnotate=!1);var n=t.pageX,a=window.innerWidth,s=parseInt(n/a);n-=a*s,n>0&&n<.2*a?e.prevPage():n>0&&n>.8*a?e.nextPage():e.toggleMenuVisible()}}}),200)}))})),this.rendition.on("resized",(function(){var e=Object(c["h"])(t.fileName);e?t.display(e):t.display()}))},initTheme:function(){var t=Object(c["j"])(this.fileName);return t||(t=this.themeList[0].name,Object(c["u"])(this.fileName,t)),t},initFontSize:function(){var t=Object(c["d"])(this.fileName);return t||(t=16,Object(c["n"])(this.fileName,t)),t},initFontFamily:function(){var t=Object(c["c"])(this.fileName);return t||(t="Default",Object(c["m"])(this.fileName,t)),t},initRendition:function(){var t=this,e=this;this.rendition=this.book.renderTo("read",{width:window.innerWidth,height:window.innerHeight}),Promise.all([this.setDefaultTheme(this.initTheme()),this.setDefaultFontSize(this.initFontSize()),this.setDefaultFontFamily(this.initFontFamily())]).then((function(){if(t.switchTheme(),t.$route.query.navigation)t.display(t.$route.query.navigation);else{var e=Object(c["h"])(t.fileName);e?t.display(e):t.display()}})),this.rendition.hooks.content.register((function(t){Promise.all([t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/daysOne.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/tangerine.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/montserrat.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/cabin.css"))]).then((function(){}))})),this.rendition.on("selected",(function(i,n){t.selectedCfiRange=i,t.selectedText="",t.book.getRange(i).then((function(t){var i="";if(t){var o=t.getBoundingClientRect(),a=n.window.getSelection(),s=a.getRangeAt(0);if(s){o=s.getBoundingClientRect();for(var r=t.cloneContents(),c=0;c1&&void 0!==arguments[1]?arguments[1]:0,o=i.filter((function(e){return e.id===t.parent}))[0];return t.parent&&o?n(o,++e):e}i.forEach((function(t){t.level=n(t),t.total=0,t.pagelist=[],t.href.match(/^(.*)\.html$/)?t.idhref=t.href.match(/^(.*)\.html$/)[1]:t.href.match(/^(.*)\.xhtml$/)&&(t.idhref=t.href.match(/^(.*)\.xhtml$/)[1])})),t.setNavigation(i)})),this.book.ready.then((function(){return t.setCurrentBook(t.book),t.book.locations.generate(window.innerWidth/375*750*(Object(c["d"])(t.fileName)/16))})).then((function(e){e.forEach((function(e){var i=e.match(/\[(.*)\]!/)[1];t.navigation.forEach((function(t){t.idhref&&t.idhref.indexOf(i)>=0&&t.pagelist.push(e)}));var n=1;t.navigation.forEach((function(t,e){t.page=0===e?1:n,n+=t.pagelist.length+1}))})),t.setPagelist(e),t.setBookAvailable(!0),t.setIsPaginating(!1),t.refreshLocation()}))},initEpub:function(t){this.book=ePub(t),this.setCurrentBook(this.book),this.setIsPaginating(!0),this.setPaginate(this.$t("book.paginating")),this.initRendition(),this.initGuest(),this.parseBook()},resize:function(){var t=this;if(this.book){this.setCurrentBook(this.book),this.rendition.resize(window.innerWidth,window.innerHeight);var e=this.book.locations.generate(window.innerWidth/375*750*(Object(c["d"])(this.fileName)/16));e.then((function(e){e.forEach((function(e){var i=e.match(/\[(.*)\]!/)[1];t.navigation.forEach((function(t){t.idhref&&t.idhref.indexOf(i)>=0&&t.pagelist.push(e)}));var n=1;t.navigation.forEach((function(t,e){t.page=0===e?1:n,n+=t.pagelist.length+1}))})),t.setPagelist(e),t.setBookAvailable(!0),t.setIsPaginating(!1),t.refreshLocation()}))}}},mounted:function(){var t=this;window.addEventListener("message",(function(e){switch(e.data.type){case"showAnnotate":var i=e.data.id;i&&t.showToAnnotate(i);break;case"openEpub":e.data._viewMark&&(t._viewMark=e.data._viewMark),t.isMobile=e.data.isMobile;var n=e.data.language;"zh-cn"==n?Object(r["n"])(t,"cn"):Object(r["n"])(t,"en");var o=e.data.annotations;t.annotations=o;i=e.data.id;i&&(t.epubId=i),t.setFileName(e.data.basename).then((function(){t.initEpub(e.data.data),t.isOnline=!1}));break}}),!1);var e=null;window.addEventListener("resize",(function(){e&&clearTimeout(e),t.removeAnnotations(),e=setTimeout((function(){t.resize()}),1200)}))}},f=l,u=(i("cbdc"),i("2877")),d=Object(u["a"])(f,n,o,!1,null,"412c4c86",null);e["default"]=d.exports},"5df3":function(t,e,i){"use strict";var n=i("02f4")(!0);i("01f9")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},"5eda":function(t,e,i){var n=i("5ca1"),o=i("8378"),a=i("79e5");t.exports=function(t,e){var i=(o.Object||{})[t]||Object[t],s={};s[t]=e(i),n(n.S+n.F*a((function(){i(1)})),"Object",s)}},"6b54":function(t,e,i){"use strict";i("3846");var n=i("cb7c"),o=i("0bfb"),a=i("9e1e"),s="toString",r=/./[s],c=function(t){i("2aba")(RegExp.prototype,s,t,!0)};i("79e5")((function(){return"/a/b"!=r.call({source:"a",flags:"b"})}))?c((function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!a&&t instanceof RegExp?o.call(t):void 0)})):r.name!=s&&c((function(){return r.call(this)}))},"7f7f":function(t,e,i){var n=i("86cc").f,o=Function.prototype,a=/^\s*function ([^ (]*)/,s="name";s in o||i("9e1e")&&n(o,s,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(t){return""}}})},"8e6e":function(t,e,i){var n=i("5ca1"),o=i("990b"),a=i("6821"),s=i("11e9"),r=i("f1ae");n(n.S,"Object",{getOwnPropertyDescriptors:function(t){var e,i,n=a(t),c=s.f,h=o(n),l={},f=0;while(h.length>f)i=c(n,e=h[f++]),void 0!==i&&r(l,e,i);return l}})},"990b":function(t,e,i){var n=i("9093"),o=i("2621"),a=i("cb7c"),s=i("7726").Reflect;t.exports=s&&s.ownKeys||function(t){var e=n.f(a(t)),i=o.f;return i?e.concat(i(t)):e}},aae3:function(t,e,i){var n=i("d3f4"),o=i("2d95"),a=i("2b4c")("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},ac0d:function(t,e,i){"use strict";i.d(e,"b",(function(){return l})),i.d(e,"a",(function(){return f}));i("8e6e"),i("456d"),i("a481"),i("f559"),i("7f7f"),i("ac6a");function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var o=i("2f62"),a=i("5de6"),s=i("fa7d"),r=i("e8ec");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function h(t){for(var e=1;e1&&void 0!==arguments[1]&&arguments[1];t?this.currentBook.rendition.display(t).then((function(){i&&t.startsWith("epubcfi")&&e.currentBook.getRange(t).then((function(i){e.currentBook.rendition.annotations.highlight(t,{},(function(t){}))})),e.refreshLocation()})):this.currentBook.rendition.display().then((function(){e.refreshLocation()})),this.hideMenuVisible()},refreshLocation:function(){var t=this.currentBook.rendition.currentLocation();if(t.start&&t.start.index){this.setSection(t.start.index);var e=this.currentBook.locations.percentageFromCfi(t.start.cfi);this.setProgress(Math.floor(100*e)),this.pagelist?t.start.location<=0?this.setPaginate(""):this.setPaginate(t.start.location+" / "+this.pagelist.length):this.setPaginate("");var i=t.start.cfi,n=r["b"](this.fileName);n&&n.some((function(t){return t.cfi===i}))?this.setIsBookmark(!0):this.setIsBookmark(!1),r["q"](this.fileName,i)}},getReadTime:function(){return this.$t("book.haveRead").replace("$1",Object(a["i"])(this.fileName))}})},f={methods:{showBookDetail:function(t){Object(a["m"])(this,t)}}}},cbdc:function(t,e,i){"use strict";i("3ecc")},d2c8:function(t,e,i){var n=i("aae3"),o=i("be13");t.exports=function(t,e,i){if(n(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(t))}},f1ae:function(t,e,i){"use strict";var n=i("86cc"),o=i("4630");t.exports=function(t,e,i){e in t?n.f(t,e,o(0,i)):t[e]=i}},f559:function(t,e,i){"use strict";var n=i("5ca1"),o=i("9def"),a=i("d2c8"),s="startsWith",r=""[s];n(n.P+n.F*i("5147")(s),"String",{startsWith:function(t){var e=a(this,t,s),i=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return r?r.call(e,n,i):e.slice(i,i+n.length)===n}})}}]);