epubjs
Version:
Parse and Render Epubs
1 lines • 124 kB
JavaScript
(function(s,u){'object'==typeof exports&&'object'==typeof module?module.exports=u(function(){try{return require('JSZip')}catch(f){}}(),require('xmldom')):'function'==typeof define&&define.amd?define(['JSZip','xmldom'],u):'object'==typeof exports?exports.ePub=u(function(){try{return require('JSZip')}catch(f){}}(),require('xmldom')):s.ePub=u(s.JSZip,s.xmldom)})(this,function(t,s){return function(u){function p(v){if(f[v])return f[v].exports;var k=f[v]={i:v,l:!1,exports:{}};return u[v].call(k.exports,k,k.exports,p),k.l=!0,k.exports}var f={};return p.m=u,p.c=f,p.i=function(v){return v},p.d=function(v,k,_){Object.defineProperty(v,k,{configurable:!1,enumerable:!0,get:_})},p.n=function(v){var k=v&&v.__esModule?function(){return v['default']}:function(){return v};return p.d(k,'a',k),k},p.o=function(v,k){return Object.prototype.hasOwnProperty.call(v,k)},p.p='/dist/',p(p.s=49)}([function(u,p,f){'use strict';'use strict';function v(){var T=new Date().getTime(),E='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(z){var R=0|(T+16*Math.random())%16;return T=Math.floor(T/16),('x'==z?R:8|7&R).toString(16)});return E}function k(T){return!isNaN(parseFloat(T))&&isFinite(T)}function _(T,E,z,R,N){var M,B=R||0,O=N||E.length,A=parseInt(B+(O-B)/2);return(z||(z=function(F,D){return F>D?1:F<D?-1:F==D?0:void 0}),0>=O-B)?A:(M=z(E[A],T),1==O-B?0<M?A:A+1:0===M?A:-1===M?_(T,E,z,A,O):_(T,E,z,B,A))}function C(T,E,z,R,N){var M,B=R||0,O=N||E.length,A=parseInt(B+(O-B)/2);return(z||(z=function(F,D){return F>D?1:F<D?-1:F==D?0:void 0}),0>=O-B)?-1:(M=z(E[A],T),1==O-B?0===M?A:-1:0===M?A:-1===M?C(T,E,z,A,O):C(T,E,z,B,A))}function S(T,E){return'undefined'==typeof T.querySelector?T.getElementsByTagName(E):T.querySelectorAll(E)}function L(T,E,z){for(var R=document.createTreeWalker(T,z,null,!1),N=void 0;N=R.nextNode();)E(N)}function P(T,E){if(E(T))return!0;if(T=T.firstChild,T)do{var z=P(T,E);if(z)return!0;T=T.nextSibling}while(T)}Object.defineProperty(p,'__esModule',{value:!0}),p.isElement=function(E){return!!(E&&1==E.nodeType)},p.uuid=v,p.documentHeight=function(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)},p.isNumber=k,p.isFloat=function(E){return k(E)&&Math.floor(E)!==E},p.prefixed=function(E){var z=['Webkit','Moz','O','ms'],R=E[0].toUpperCase()+E.slice(1),N=z.length;if('undefined'==typeof document||'undefined'!=typeof document.body.style[E])return E;for(var B=0;B<N;B++)if('undefined'!=typeof document.body.style[z[B]+R])return z[B]+R;return E},p.defaults=function(E){for(var z=1,R=arguments.length;z<R;z++){var N=arguments[z];for(var B in N)void 0===E[B]&&(E[B]=N[B])}return E},p.extend=function(E){var z=[].slice.call(arguments,1);return z.forEach(function(R){R&&Object.getOwnPropertyNames(R).forEach(function(N){Object.defineProperty(E,N,Object.getOwnPropertyDescriptor(R,N))})}),E},p.insert=function(E,z,R){var N=_(E,z,R);return z.splice(N,0,E),N},p.locationOf=_,p.indexOfSorted=C,p.bounds=function(E){var z=window.getComputedStyle(E),R=0,N=0;return['width','paddingRight','paddingLeft','marginRight','marginLeft','borderRightWidth','borderLeftWidth'].forEach(function(B){R+=parseFloat(z[B])||0}),['height','paddingTop','paddingBottom','marginTop','marginBottom','borderTopWidth','borderBottomWidth'].forEach(function(B){N+=parseFloat(z[B])||0}),{height:N,width:R}},p.borders=function(E){var z=window.getComputedStyle(E),R=0,N=0;return['paddingRight','paddingLeft','marginRight','marginLeft','borderRightWidth','borderLeftWidth'].forEach(function(B){R+=parseFloat(z[B])||0}),['paddingTop','paddingBottom','marginTop','marginBottom','borderTopWidth','borderBottomWidth'].forEach(function(B){N+=parseFloat(z[B])||0}),{height:N,width:R}},p.windowBounds=function(){var E=window.innerWidth,z=window.innerHeight;return{top:0,left:0,right:E,bottom:z,width:E,height:z}},p.cleanStringForXpath=function(E){var z=E.match(/[^'"]+|['"]/g);return z=z.map(function(R){return'\''===R?'"\'"':'"'===R?'\'"\'':'\''+R+'\''}),'concat(\'\','+z.join(',')+')'},p.indexOfTextNode=function(E){var z=E.parentNode,R=z.childNodes,N,B=-1;for(var O=0;O<R.length&&(N=R[O],N.nodeType===Node.TEXT_NODE&&B++,N!=E);O++);return B},p.isXml=function(E){return-1<['xml','opf','ncx'].indexOf(E)},p.createBlob=function(E,z){return new Blob([E],{type:z})},p.createBlobUrl=function(E,z){var N,R=window.URL||window.webkitURL||window.mozURL,B=this.createBlob(E,z);return N=R.createObjectURL(B),N},p.createBase64Url=function(E,z){var R,N;if('string'==typeof E)return R=btoa(E),N='data:'+z+';base64,'+R,N},p.type=function(E){return Object.prototype.toString.call(E).slice(8,-1)},p.parse=function(E,z,R){var N,B;return B='undefined'==typeof DOMParser||R?f(14).DOMParser:DOMParser,N=new B().parseFromString(E,z),N},p.qs=function(E,z){var R;if(!E)throw new Error('No Element Provided');return'undefined'==typeof E.querySelector?(R=E.getElementsByTagName(z),R.length)?R[0]:void 0:E.querySelector(z)},p.qsa=S,p.qsp=function(E,z,R){var N,B;if('undefined'!=typeof E.querySelector){for(var O in z+='[',R)z+=O+'=\''+R[O]+'\'';return z+=']',E.querySelector(z)}return(N=E.getElementsByTagName(z),B=Array.prototype.slice.call(N,0).filter(function(A){for(var M in R)if(A.getAttribute(M)===R[M])return!0;return!1}),B)?B[0]:void 0},p.sprint=function(E,z){var R=E.ownerDocument||E;'undefined'==typeof R.createTreeWalker?P(E,function(N){N&&3===N.nodeType&&z(N)},!0):L(E,z,NodeFilter.SHOW_TEXT)},p.treeWalker=L,p.walk=P,p.blob2base64=function(E,z){var R=new FileReader;R.readAsDataURL(E),R.onloadend=function(){z(R.result)}},p.defer=function(){var E=this;this.resolve=null,this.reject=null,this.id=v(),this.promise=new Promise(function(z,R){E.resolve=z,E.reject=R}),Object.freeze(this)},p.querySelectorByType=function(E,z,R){var N;if('undefined'!=typeof E.querySelector&&(N=E.querySelector(z+'[*|type="'+R+'"]')),!N||0===N.length){N=S(E,z);for(var B=0;B<N.length;B++)if(N[B].getAttributeNS('http://www.idpf.org/2007/ops','type')===R)return N[B]}else return N},p.findChildren=function(E){var z=[],R=E.parentNode.childNodes;for(var N=0;N<R.length;N++){var B=R[N];1===B.nodeType&&z.push(B)}return z},p.requestAnimationFrame='undefined'!=typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame)},function(u,p,f){'use strict';'use strict';function v(T,E){if(!(T instanceof E))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&'function'==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?'symbol':typeof T},_=function(){function T(E,z){for(var R=0;R<z.length;R++){var N=z[R];N.enumerable=N.enumerable||!1,N.configurable=!0,'value'in N&&(N.writable=!0),Object.defineProperty(E,N.key,N)}}return function(E,z,R){return z&&T(E.prototype,z),R&&T(E,R),E}}(),C=f(0),S=1,L=3,P=function(){function T(E,z,R){v(this,T);var N;if(this.str='',this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof T))return new T(E,z,R);if('string'==typeof z?this.base=this.parseComponent(z):'object'===('undefined'==typeof z?'undefined':k(z))&&z.steps&&(this.base=z),N=this.checkType(E),'string'===N)return this.str=E,(0,C.extend)(this,this.parse(E));if('range'===N)return(0,C.extend)(this,this.fromRange(E,this.base,R));if('node'===N)return(0,C.extend)(this,this.fromNode(E,this.base,R));if('EpubCFI'===N&&E.path)return E;if(!E)return this;throw new TypeError('not a valid argument for EpubCFI')}return _(T,[{key:'checkType',value:function(z){return this.isCfiString(z)?'string':'object'===('undefined'==typeof z?'undefined':k(z))&&('Range'===(0,C.type)(z)||'undefined'!=typeof z.startContainer)?'range':'object'===('undefined'==typeof z?'undefined':k(z))&&'undefined'!=typeof z.nodeType?'node':'object'===('undefined'==typeof z?'undefined':k(z))&&z instanceof T&&'EpubCFI'}},{key:'parse',value:function(z){var N,B,O,R={spinePos:-1,range:!1,base:{},path:{},start:null,end:null};return'string'==typeof z?(0===z.indexOf('epubcfi(')&&')'===z[z.length-1]&&(z=z.slice(8,z.length-1)),N=this.getChapterComponent(z),!N)?{spinePos:-1}:(R.base=this.parseComponent(N),B=this.getPathComponent(z),R.path=this.parseComponent(B),O=this.getRange(z),O&&(R.range=!0,R.start=this.parseComponent(O[0]),R.end=this.parseComponent(O[1])),R.spinePos=R.base.steps[1].index,R):{spinePos:-1}}},{key:'parseComponent',value:function(z){var O,R={steps:[],terminal:{offset:null,assertion:null}},N=z.split(':'),B=N[0].split('/');return 1<N.length&&(O=N[1],R.terminal=this.parseTerminal(O)),''===B[0]&&B.shift(),R.steps=B.map(function(A){return this.parseStep(A)}.bind(this)),R}},{key:'parseStep',value:function(z){var R,N,B,O,A;if(O=z.match(/\[(.*)\]/),O&&O[1]&&(A=O[1]),N=parseInt(z),!isNaN(N))return 0==N%2?(R='element',B=N/2-1):(R='text',B=(N-1)/2),{type:R,index:B,id:A||null}}},{key:'parseTerminal',value:function(z){var R,N,B=z.match(/\[(.*)\]/);return B&&B[1]?(R=parseInt(z.split('[')[0])||null,N=B[1]):R=parseInt(z)||null,{offset:R,assertion:N}}},{key:'getChapterComponent',value:function(z){var R=z.split('!');return R[0]}},{key:'getPathComponent',value:function(z){var R=z.split('!');if(R[1]){var N=R[1].split(',');return N[0]}}},{key:'getRange',value:function(z){var R=z.split(',');return 3===R.length&&[R[1],R[2]]}},{key:'getCharecterOffsetComponent',value:function(z){var R=z.split(':');return R[1]||''}},{key:'joinSteps',value:function(z){return z?z.map(function(R){var N='';return'element'===R.type&&(N+=2*(R.index+1)),'text'===R.type&&(N+=1+2*R.index),R.id&&(N+='['+R.id+']'),N}).join('/'):''}},{key:'segmentString',value:function(z){var E='/';return E+=this.joinSteps(z.steps),z.terminal&&null!=z.terminal.offset&&(E+=':'+z.terminal.offset),z.terminal&&null!=z.terminal.assertion&&(E+='['+z.terminal.assertion+']'),E}},{key:'toString',value:function(){var z='epubcfi(';return z+=this.segmentString(this.base),z+='!',z+=this.segmentString(this.path),this.start&&(z+=',',z+=this.segmentString(this.start)),this.end&&(z+=',',z+=this.segmentString(this.end)),z+=')',z}},{key:'compare',value:function(z,R){var N,B,O,A;if('string'==typeof z&&(z=new T(z)),'string'==typeof R&&(R=new T(R)),z.spinePos>R.spinePos)return 1;if(z.spinePos<R.spinePos)return-1;z.range?(N=z.path.steps.concat(z.start.steps),O=z.start.terminal):(N=z.path.steps,O=z.path.terminal),R.range?(B=R.path.steps.concat(R.start.steps),A=R.start.terminal):(B=R.path.steps,A=R.path.terminal);for(var M=0;M<N.length;M++){if(!N[M])return-1;if(!B[M])return 1;if(N[M].index>B[M].index)return 1;if(N[M].index<B[M].index)return-1}return N.length<B.length?1:O.offset>A.offset?1:O.offset<A.offset?-1:0}},{key:'step',value:function(z){var R=z.nodeType===L?'text':'element';return{id:z.id,tagName:z.tagName,type:R,index:this.position(z)}}},{key:'filteredStep',value:function(z,R){var B,N=this.filter(z,R);if(N)return B=N.nodeType===L?'text':'element',{id:N.id,tagName:N.tagName,type:B,index:this.filteredPosition(N,R)}}},{key:'pathTo',value:function(z,R,N){for(var A,B={steps:[],terminal:{offset:null,assertion:null}},O=z;O&&O.parentNode&&9!=O.parentNode.nodeType;)A=N?this.filteredStep(O,N):this.step(O),A&&B.steps.unshift(A),O=O.parentNode;return null!=R&&0<=R&&(B.terminal.offset=R,'text'!=B.steps[B.steps.length-1].type&&B.steps.push({type:'text',index:0})),B}},{key:'equalStep',value:function(z,R){return z&&R&&z.index===R.index&&z.id===R.id&&z.type===R.type}},{key:'fromRange',value:function(z,R,N){var B={range:!1,base:{},path:{},start:null,end:null},O=z.startContainer,A=z.endContainer,M=z.startOffset,W=z.endOffset,F=!1;if(N&&(F=null!=O.ownerDocument.querySelector('.'+N)),'string'==typeof R?(B.base=this.parseComponent(R),B.spinePos=B.base.steps[1].index):'object'===('undefined'==typeof R?'undefined':k(R))&&(B.base=R),z.collapsed)F&&(M=this.patchOffset(O,M,N)),B.path=this.pathTo(O,M,N);else{B.range=!0,F&&(M=this.patchOffset(O,M,N)),B.start=this.pathTo(O,M,N),F&&(W=this.patchOffset(A,W,N)),B.end=this.pathTo(A,W,N),B.path={steps:[],terminal:null};var I,D=B.start.steps.length;for(I=0;I<D&&this.equalStep(B.start.steps[I],B.end.steps[I]);I++)I===D-1?B.start.terminal===B.end.terminal&&(B.path.steps.push(B.start.steps[I]),B.range=!1):B.path.steps.push(B.start.steps[I]);B.start.steps=B.start.steps.slice(B.path.steps.length),B.end.steps=B.end.steps.slice(B.path.steps.length)}return B}},{key:'fromNode',value:function(z,R,N){var B={range:!1,base:{},path:{},start:null,end:null};return'string'==typeof R?(B.base=this.parseComponent(R),B.spinePos=B.base.steps[1].index):'object'===('undefined'==typeof R?'undefined':k(R))&&(B.base=R),B.path=this.pathTo(z,null,N),B}},{key:'filter',value:function(z,R){var N,B,O,A,M,W=!1;return(z.nodeType===L?(W=!0,O=z.parentNode,N=z.parentNode.classList.contains(R)):(W=!1,N=z.classList.contains(R)),N&&W)?(A=O.previousSibling,M=O.nextSibling,A&&A.nodeType===L?B=A:M&&M.nodeType===L&&(B=M),B)?B:z:N&&!W?!1:z}},{key:'patchOffset',value:function(z,R,N){if(z.nodeType!=L)throw new Error('Anchor must be a text node');var B=z,O=R;for(z.parentNode.classList.contains(N)&&(B=z.parentNode);B.previousSibling;){if(B.previousSibling.nodeType!==S)O+=B.previousSibling.textContent.length;else if(B.previousSibling.classList.contains(N))O+=B.previousSibling.textContent.length;else break;B=B.previousSibling}return O}},{key:'normalizedMap',value:function(z,R,N){var A,W,F,B={},O=-1,M=z.length;for(A=0;A<M;A++)W=z[A].nodeType,W===S&&z[A].classList.contains(N)&&(W=L),0<A&&W===L&&F===L?B[A]=O:R===W&&(O=O+1,B[A]=O),F=W;return B}},{key:'position',value:function(z){var R,N;return z.nodeType===S?(R=z.parentNode.children,!R&&(R=(0,C.findChildren)(z.parentNode)),N=Array.prototype.indexOf.call(R,z)):(R=this.textNodes(z.parentNode),N=R.indexOf(z)),N}},{key:'filteredPosition',value:function(z,R){var N,B,O;return z.nodeType===S?(N=z.parentNode.children,O=this.normalizedMap(N,S,R)):(N=z.parentNode.childNodes,z.parentNode.classList.contains(R)&&(z=z.parentNode,N=z.parentNode.childNodes),O=this.normalizedMap(N,L,R)),B=Array.prototype.indexOf.call(N,z),O[B]}},{key:'stepsToXpath',value:function(z){var R=['.','*'];return z.forEach(function(N){var B=N.index+1;N.id?R.push('*[position()='+B+' and @id=\''+N.id+'\']'):'text'===N.type?R.push('text()['+B+']'):R.push('*['+B+']')}),R.join('/')}},{key:'stepsToQuerySelector',value:function(z){var R=['html'];return z.forEach(function(N){var B=N.index+1;N.id?R.push('#'+N.id):'text'!==N.type&&R.push('*:nth-child('+B+')')}),R.join('>')}},{key:'textNodes',value:function(z,R){return Array.prototype.slice.call(z.childNodes).filter(function(N){return N.nodeType===L||R&&N.classList.contains(R)})}},{key:'walkToNode',value:function(z,R,N){var A,W,B=R||document,O=B.documentElement,M=z.length;for(W=0;W<M;W++)A=z[W],'element'===A.type?O=O.children[A.index]:'text'===A.type&&(O=this.textNodes(O,N)[A.index]);return O}},{key:'findNode',value:function(z,R,N){var O,A,B=R||document;return N||'undefined'==typeof B.evaluate?N?O=this.walkToNode(z,B,N):O=this.walkToNode(z,B):(A=this.stepsToXpath(z),O=B.evaluate(A,B,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue),O}},{key:'fixMiss',value:function(z,R,N,B){var W,F,O=this.findNode(z.slice(0,-1),N,B),A=O.childNodes,M=this.normalizedMap(A,L,B),D=z[z.length-1].index;for(var I in M){if(!M.hasOwnProperty(I))return;if(M[I]===D)if(W=A[I],F=W.textContent.length,R>F)R=R-F;else{O=W.nodeType===S?W.childNodes[0]:W;break}}return{container:O,offset:R}}},{key:'toRange',value:function(z,R){var O,A,M,W,D,I,H,N=z||document,B=N.createRange(),F=this,U=!!R&&null!=N.querySelector('.'+R);if(F.range?(O=F.start,D=F.path.steps.concat(O.steps),M=this.findNode(D,N,U?R:null),A=F.end,I=F.path.steps.concat(A.steps),W=this.findNode(I,N,U?R:null)):(O=F.path,D=F.path.steps,M=this.findNode(F.path.steps,N,U?R:null)),M)try{null==O.terminal.offset?B.setStart(M,0):B.setStart(M,O.terminal.offset)}catch(V){H=this.fixMiss(D,O.terminal.offset,N,U?R:null),B.setStart(H.container,H.offset)}else return null;if(W)try{null==A.terminal.offset?B.setEnd(W,0):B.setEnd(W,A.terminal.offset)}catch(V){H=this.fixMiss(I,F.end.terminal.offset,N,U?R:null),B.setEnd(H.container,H.offset)}return B}},{key:'isCfiString',value:function(z){return'string'==typeof z&&0===z.indexOf('epubcfi(')&&')'===z[z.length-1]}},{key:'generateChapterComponent',value:function(z,R,N){var B=parseInt(R),O='/'+(z+1)+'/';return O+=2*(B+1),N&&(O+='['+N+']'),O}}]),T}();p.default=P,u.exports=p['default']},function(u,p,f){'use strict';'use strict';var z,R,N,B,O,A,M,v=f(33),k=f(42),_=Function.prototype.apply,C=Function.prototype.call,S=Object.create,L=Object.defineProperty,P=Object.defineProperties,T=Object.prototype.hasOwnProperty,E={configurable:!0,enumerable:!1,writable:!0};z=function(W,F){var D;return k(F),T.call(this,'__ee__')?D=this.__ee__:(D=E.value=S(null),L(this,'__ee__',E),E.value=null),D[W]?'object'==typeof D[W]?D[W].push(F):D[W]=[D[W],F]:D[W]=F,this},R=function(W,F){var D,I;return k(F),I=this,z.call(this,W,D=function(){N.call(I,W,D),_.call(F,this,arguments)}),D.__eeOnceListener__=F,this},N=function(W,F){var D,I,U,H;if(k(F),!T.call(this,'__ee__'))return this;if(D=this.__ee__,!D[W])return this;if(I=D[W],'object'==typeof I)for(H=0;U=I[H];++H)(U===F||U.__eeOnceListener__===F)&&(2===I.length?D[W]=I[H?0:1]:I.splice(H,1));else(I===F||I.__eeOnceListener__===F)&&delete D[W];return this},B=function(W){var F,D,I,U,H;if(T.call(this,'__ee__')&&(U=this.__ee__[W],U))if('object'==typeof U){for(D=arguments.length,H=Array(D-1),F=1;F<D;++F)H[F-1]=arguments[F];for(U=U.slice(),F=0;I=U[F];++F)_.call(I,this,H)}else switch(arguments.length){case 1:C.call(U,this);break;case 2:C.call(U,this,arguments[1]);break;case 3:C.call(U,this,arguments[1],arguments[2]);break;default:for(D=arguments.length,H=Array(D-1),F=1;F<D;++F)H[F-1]=arguments[F];_.call(U,this,H);}},O={on:z,once:R,off:N,emit:B},A={on:v(z),once:v(R),off:v(N),emit:v(B)},M=P({},A),u.exports=p=function(W){return null==W?S(M):P(Object(W),A)},p.methods=O},function(u,p,f){'use strict';'use strict';function v(L,P){if(!(L instanceof P))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function L(P,T){for(var E=0;E<T.length;E++){var z=T[E];z.enumerable=z.enumerable||!1,z.configurable=!0,'value'in z&&(z.writable=!0),Object.defineProperty(P,z.key,z)}}return function(P,T,E){return T&&L(P.prototype,T),E&&L(P,E),P}}(),_=f(5),C=function(P){return P&&P.__esModule?P:{default:P}}(_),S=function(){function L(P){v(this,L);var T,E;T=P.indexOf('://'),-1<T&&(P=new URL(P).pathname),E=this.parse(P),this.path=P,this.directory=this.isDirectory(P)?P:E.dir+'/',this.filename=E.base,this.extension=E.ext.slice(1)}return k(L,[{key:'parse',value:function(T){return C.default.parse(T)}},{key:'isAbsolute',value:function(T){return C.default.isAbsolute(T||this.path)}},{key:'isDirectory',value:function(T){return'/'===T.charAt(T.length-1)}},{key:'resolve',value:function(T){return C.default.resolve(this.directory,T)}},{key:'relative',value:function(T){return C.default.relative(this.directory,T)}},{key:'splitPath',value:function(T){return this.splitPathRe.exec(T).slice(1)}},{key:'toString',value:function(){return this.path}}]),L}();p.default=S,u.exports=p['default']},function(u,p,f){'use strict';'use strict';Object.defineProperty(p,'__esModule',{value:!0}),p.replaceBase=function(S,L){var P,T;S&&(T=(0,v.qs)(S,'head'),P=(0,v.qs)(T,'base'),!P&&(P=S.createElement('base'),T.insertBefore(P,T.firstChild)),P.setAttribute('href',L.url))},p.replaceCanonical=function(S,L){var P,T,E=L.url;S&&(P=(0,v.qs)(S,'head'),T=(0,v.qs)(P,'link[rel=\'canonical\']'),T?T.setAttribute('href',E):(T=S.createElement('link'),T.setAttribute('rel','canonical'),T.setAttribute('href',E),P.appendChild(T)))},p.replaceLinks=function(S,L){var P=S.querySelectorAll('a[href]'),T=(0,v.qs)(S.ownerDocument,'base'),E=T?T.href:void 0,z=function(N){var B=N.getAttribute('href');if(0!==B.indexOf('mailto:')){var O=-1<B.indexOf('://'),A=new _.default(B,E);O?N.setAttribute('target','_blank'):N.onclick=function(){return A&&A.hash?L(A.Path.path+A.hash):A?L(A.Path.path):L(B),!1}}}.bind(this);for(var R=0;R<P.length;R++)z(P[R])},p.substitute=function(S,L,P){return L.forEach(function(T,E){T&&P[E]&&(S=S.replace(new RegExp(T,'g'),P[E]))}),S};var v=f(0),k=f(11),_=function(S){return S&&S.__esModule?S:{default:S}}(k)},function(u,p,f){'use strict';(function(v){'use strict';function k(L){if('string'!=typeof L)throw new TypeError('Path must be a string. Received '+L)}function _(L,P){var T='',E=-1,z=0,R;for(var N=0;N<=L.length;++N){if(N<L.length)R=L.charCodeAt(N);else if(47===R)break;else R=47;if(47===R){if(E==N-1||1==z);else if(E!=N-1&&2==z){if(2>T.length||46!==T.charCodeAt(T.length-1)||46!==T.charCodeAt(T.length-2))if(2<T.length){for(var B=T.length-1,O=B;0<=O&&47!==T.charCodeAt(O);--O);if(O!==B){T=-1===O?'':T.slice(0,O),E=N,z=0;continue}}else if(2===T.length||1===T.length){T='',E=N,z=0;continue}P&&(0<T.length?T+='/..':T='..')}else 0<T.length?T+='/'+L.slice(E+1,N):T=L.slice(E+1,N);E=N,z=0}else 46===R&&-1!=z?++z:z=-1}return T}function C(L,P){var T=P.dir||P.root,E=P.base||(P.name||'')+(P.ext||'');return T?T===P.root?T+E:T+L+E:E}var S={resolve:function(){var E,P='',T=!1;for(var z=arguments.length-1;-1<=z&&!T;z--){var R;(0<=z?R=arguments[z]:(void 0==E&&(E=v.cwd()),R=E),k(R),0!==R.length)&&(P=R+'/'+P,T=47===R.charCodeAt(0))}return(P=_(P,!T),T)?0<P.length?'/'+P:'/':0<P.length?P:'.'},normalize:function(P){if(k(P),0===P.length)return'.';var T=47===P.charCodeAt(0),E=47===P.charCodeAt(P.length-1);return P=_(P,!T),0!==P.length||T||(P='.'),0<P.length&&E&&(P+='/'),T?'/'+P:P},isAbsolute:function(P){return k(P),0<P.length&&47===P.charCodeAt(0)},join:function(){if(0===arguments.length)return'.';var P;for(var T=0;T<arguments.length;++T){var E=arguments[T];k(E),0<E.length&&(P==void 0?P=E:P+='/'+E)}return void 0===P?'.':S.normalize(P)},relative:function(P,T){if(k(P),k(T),P===T)return'';if(P=S.resolve(P),T=S.resolve(T),P===T)return'';for(var E=1;E<P.length&&47===P.charCodeAt(E);++E);for(var z=P.length,R=z-E,N=1;N<T.length&&47===T.charCodeAt(N);++N);for(var B=T.length,O=B-N,A=R<O?R:O,M=-1,W=0;W<=A;++W){if(W===A){if(O>A){if(47===T.charCodeAt(N+W))return T.slice(N+W+1);if(0==W)return T.slice(N+W)}else R>A&&(47===P.charCodeAt(E+W)?M=W:0===W&&(M=0));break}var F=P.charCodeAt(E+W),D=T.charCodeAt(N+W);if(F!==D)break;else 47===F&&(M=W)}var I='';for(W=E+M+1;W<=z;++W)(W===z||47===P.charCodeAt(W))&&(I+=0===I.length?'..':'/..');return 0<I.length?I+T.slice(N+M):(N+=M,47===T.charCodeAt(N)&&++N,T.slice(N))},_makeLong:function(P){return P},dirname:function(P){if(k(P),0===P.length)return'.';var T=P.charCodeAt(0),E=47===T,z=-1,R=!0;for(var N=P.length-1;1<=N;--N)if(T=P.charCodeAt(N),47!==T)R=!1;else if(!R){z=N;break}return-1===z?E?'/':'.':E&&1===z?'//':P.slice(0,z)},basename:function(P,T){if(T!==void 0&&'string'!=typeof T)throw new TypeError('"ext" argument must be a string');k(P);var E=0,z=-1,R=!0,N;if(void 0!==T&&0<T.length&&T.length<=P.length){if(T.length===P.length&&T===P)return'';var B=T.length-1,O=-1;for(N=P.length-1;0<=N;--N){var A=P.charCodeAt(N);if(47!==A)-1==O&&(R=!1,O=N+1),0<=B&&(A===T.charCodeAt(B)?-1==--B&&(z=N):(B=-1,z=O));else if(!R){E=N+1;break}}return E===z?z=O:-1===z&&(z=P.length),P.slice(E,z)}for(N=P.length-1;0<=N;--N)if(47!==P.charCodeAt(N))-1==z&&(R=!1,z=N+1);else if(!R){E=N+1;break}return-1===z?'':P.slice(E,z)},extname:function(P){k(P);var T=-1,E=0,z=-1,R=!0,N=0;for(var B=P.length-1;0<=B;--B){var O=P.charCodeAt(B);if(47===O){if(!R){E=B+1;break}continue}-1==z&&(R=!1,z=B+1),46===O?-1==T?T=B:1!=N&&(N=1):-1!=T&&(N=-1)}return-1===T||-1===z||0==N||1==N&&T===z-1&&T===E+1?'':P.slice(T,z)},format:function(P){if(null===P||'object'!=typeof P)throw new TypeError('Parameter "pathObject" must be an object, not '+typeof P);return C('/',P)},parse:function(P){k(P);var T={root:'',dir:'',base:'',ext:'',name:''};if(0===P.length)return T;var R,E=P.charCodeAt(0),z=47===E;z?(T.root='/',R=1):R=0;for(var N=-1,B=0,O=-1,A=!0,M=P.length-1,W=0;M>=R;--M){if(E=P.charCodeAt(M),47===E){if(!A){B=M+1;break}continue}-1==O&&(A=!1,O=M+1),46===E?-1==N?N=M:1!=W&&(W=1):-1!=N&&(W=-1)}return-1==N||-1==O||0==W||1==W&&N==O-1&&N==B+1?-1!=O&&(0==B&&z?T.base=T.name=P.slice(1,O):T.base=T.name=P.slice(B,O)):(0==B&&z?(T.name=P.slice(1,N),T.base=P.slice(1,O)):(T.name=P.slice(B,N),T.base=P.slice(B,O)),T.ext=P.slice(N,O)),0<B?T.dir=P.slice(0,B-1):z&&(T.dir='/'),T},sep:'/',delimiter:':',posix:null};u.exports=S}).call(p,f(47))},function(u,p,f){'use strict';'use strict';function v(O){return O&&O.__esModule?O:{default:O}}function k(O,A){if(!(O instanceof A))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function O(A,M){for(var W=0;W<M.length;W++){var F=M[W];F.enumerable=F.enumerable||!1,F.configurable=!0,'value'in F&&(F.writable=!0),Object.defineProperty(A,F.key,F)}}return function(A,M,W){return M&&O(A.prototype,M),W&&O(A,W),A}}(),C=f(2),S=v(C),L=f(0),P=f(1),T=v(P),E=f(7),z=v(E),R=f(4),N=['keydown','keyup','keypressed','mouseup','mousedown','click','touchend','touchstart'],B=function(){function O(A,M,W){k(this,O),this.epubcfi=new T.default,this.document=A,this.documentElement=this.document.documentElement,this.content=M||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.cfiBase=W||'',this.listeners()}return _(O,[{key:'width',value:function(M){var W=this.content;return M&&(0,L.isNumber)(M)&&(M=M+'px'),M&&(W.style.width=M),this.window.getComputedStyle(W).width}},{key:'height',value:function(M){var W=this.content;return M&&(0,L.isNumber)(M)&&(M=M+'px'),M&&(W.style.height=M),this.window.getComputedStyle(W).height}},{key:'contentWidth',value:function(M){var W=this.content||this.document.body;return M&&(0,L.isNumber)(M)&&(M=M+'px'),M&&(W.style.width=M),this.window.getComputedStyle(W).width}},{key:'contentHeight',value:function(M){var W=this.content||this.document.body;return M&&(0,L.isNumber)(M)&&(M=M+'px'),M&&(W.style.height=M),this.window.getComputedStyle(W).height}},{key:'textWidth',value:function(){var M,W=this.document.createRange(),F=this.content||this.document.body;return W.selectNodeContents(F),M=W.getBoundingClientRect().width,M}},{key:'textHeight',value:function(){var M,W=this.document.createRange(),F=this.content||this.document.body;return W.selectNodeContents(F),M=W.getBoundingClientRect().height,M}},{key:'scrollWidth',value:function(){var M=this.documentElement.scrollWidth;return M}},{key:'scrollHeight',value:function(){var M=this.documentElement.scrollHeight;return M}},{key:'overflow',value:function(M){return M&&(this.documentElement.style.overflow=M),this.window.getComputedStyle(this.documentElement).overflow}},{key:'overflowX',value:function(M){return M&&(this.documentElement.style.overflowX=M),this.window.getComputedStyle(this.documentElement).overflowX}},{key:'overflowY',value:function(M){return M&&(this.documentElement.style.overflowY=M),this.window.getComputedStyle(this.documentElement).overflowY}},{key:'css',value:function(M,W){var F=this.content||this.document.body;return W&&(F.style[M]=W),this.window.getComputedStyle(F)[M]}},{key:'viewport',value:function(M){var W,F,D,I,U=this.document.querySelector('meta[name=\'viewport\']'),H='';if(U&&U.hasAttribute('content')){var V=U.getAttribute('content'),X=V.split(/\s*,\s*/);X[0]&&(W=X[0].replace('width=','').trim()),X[1]&&(F=X[1].replace('height=','').trim()),X[2]&&(D=X[2].replace('initial-scale=','').trim()),X[3]&&(I=X[3].replace('user-scalable=','').trim())}return M&&(H+='width='+(M.width||W),H+=', height='+(M.height||F),(M.scale||D)&&(H+=', initial-scale='+(M.scale||D)),(M.scalable||I)&&(H+=', user-scalable='+(M.scalable||I)),!U&&(U=this.document.createElement('meta'),U.setAttribute('name','viewport'),this.document.querySelector('head').appendChild(U)),U.setAttribute('content',H)),{width:parseInt(W),height:parseInt(F)}}},{key:'expand',value:function(){this.emit('expand')}},{key:'listeners',value:function(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),this.resizeListeners(),this.linksHandler()}},{key:'removeListeners',value:function(){this.removeEventListeners(),this.removeSelectionListeners()}},{key:'resizeListeners',value:function(){var M,W;clearTimeout(this.expanding),M=this.scrollWidth(),W=this.scrollHeight(),(M!=this._size.width||W!=this._size.height)&&(this._size={width:M,height:W},this.emit('resize',this._size)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}},{key:'mediaQueryListeners',value:function(){var M=this.document.styleSheets,W=function(H){H.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}.bind(this);for(var F=0;F<M.length;F+=1){var D;try{D=M[F].cssRules}catch(H){return}if(!D)return;for(var I=0;I<D.length;I+=1)if(D[I].media){var U=this.window.matchMedia(D[I].media.mediaText);U.addListener(W)}}}},{key:'observe',value:function(M){var W=this,F=new MutationObserver(function(){W._expanding&&W.expand()});return F.observe(M,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),F}},{key:'imageLoadListeners',value:function(){var W,M=this.document.querySelectorAll('img');for(var F=0;F<M.length;F++)W=M[F],'undefined'!=typeof W.naturalWidth&&0===W.naturalWidth&&(W.onload=this.expand.bind(this))}},{key:'fontLoadListeners',value:function(){this.document&&this.document.fonts&&this.document.fonts.ready.then(function(){this.expand()}.bind(this))}},{key:'root',value:function(){return this.document?this.document.documentElement:null}},{key:'locationOf',value:function(M,W){var F,D={left:0,top:0};if(this.document){if(this.epubcfi.isCfiString(M)){var I=new T.default(M).toRange(this.document,W);I&&(I.startContainer.nodeType===Node.ELEMENT_NODE?(F=I.startContainer.getBoundingClientRect(),D.left=F.left,D.top=F.top):I.collapsed?F=I.getClientRects()[0]:F=I.getBoundingClientRect())}else if('string'==typeof M&&-1<M.indexOf('#')){var U=M.substring(M.indexOf('#')+1),H=this.document.getElementById(U);H&&(F=H.getBoundingClientRect())}return F&&(D.left=F.left,D.top=F.top),D}}},{key:'addStylesheet',value:function(M){return new Promise(function(W){var F,D=!1;return this.document?(F=this.document.querySelector('link[href=\''+M+'\']'),F?void W(!0):void(F=this.document.createElement('link'),F.type='text/css',F.rel='stylesheet',F.href=M,F.onload=F.onreadystatechange=function(){D||this.readyState&&'complete'!=this.readyState||(D=!0,setTimeout(function(){W(!0)},1))},this.document.head.appendChild(F))):void W(!1)}.bind(this))}},{key:'addStylesheetRules',value:function(M){var W,F,D='epubjs-inserted-css';if(this.document){W=this.document.getElementById('#'+D),W||(W=this.document.createElement('style'),W.id=D),this.document.head.appendChild(W),F=W.sheet;for(var I=0,U=M.length;I<U;I++){var H=1,V=M[I],X=M[I][0],Y='';'[object Array]'===Object.prototype.toString.call(V[1][0])&&(V=V[1],H=0);for(var J=V.length;H<J;H++){var Z=V[H];Y+=Z[0]+':'+Z[1]+(Z[2]?' !important':'')+';\n'}F.insertRule(X+'{'+Y+'}',F.cssRules.length)}}}},{key:'addScript',value:function(M){return new Promise(function(W){var F,D=!1;return this.document?void(F=this.document.createElement('script'),F.type='text/javascript',F.async=!0,F.src=M,F.onload=F.onreadystatechange=function(){D||this.readyState&&'complete'!=this.readyState||(D=!0,setTimeout(function(){W(!0)},1))},this.document.head.appendChild(F)):void W(!1)}.bind(this))}},{key:'addClass',value:function(M){var W;this.document&&(W=this.content||this.document.body,W.classList.add(M))}},{key:'removeClass',value:function(M){var W;this.document&&(W=this.content||this.document.body,W.classList.remove(M))}},{key:'addEventListeners',value:function(){this.document&&N.forEach(function(M){this.document.addEventListener(M,this.triggerEvent.bind(this),!1)},this)}},{key:'removeEventListeners',value:function(){this.document&&N.forEach(function(M){this.document.removeEventListener(M,this.triggerEvent,!1)},this)}},{key:'triggerEvent',value:function(M){this.emit(M.type,M)}},{key:'addSelectionListeners',value:function(){this.document&&this.document.addEventListener('selectionchange',this.onSelectionChange.bind(this),!1)}},{key:'removeSelectionListeners',value:function(){this.document&&this.document.removeEventListener('selectionchange',this.onSelectionChange,!1)}},{key:'onSelectionChange',value:function(){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout(function(){var M=this.window.getSelection();this.triggerSelectedEvent(M)}.bind(this),500)}},{key:'triggerSelectedEvent',value:function(M){var W,F;M&&0<M.rangeCount&&(W=M.getRangeAt(0),!W.collapsed&&(F=new T.default(W,this.cfiBase).toString(),this.emit('selected',F),this.emit('selectedRange',W)))}},{key:'range',value:function(M,W){var F=new T.default(M);return F.toRange(this.document,W)}},{key:'map',value:function(M){var A=new z.default(M);return A.section()}},{key:'size',value:function(M,W){0<=M&&this.width(M),0<=W&&this.height(W),this.css('margin','0'),this.css('boxSizing','border-box')}},{key:'columns',value:function(M,W,F,D){var I=(0,L.prefixed)('columnAxis'),U=(0,L.prefixed)('columnGap'),H=(0,L.prefixed)('columnWidth'),V=(0,L.prefixed)('columnFill');this.width(M),this.height(W),this.viewport({width:M,height:W,scale:1}),this.css('overflowY','hidden'),this.css('margin','0'),this.css('boxSizing','border-box'),this.css('maxWidth','inherit'),this.css(I,'horizontal'),this.css(V,'auto'),this.css(U,D+'px'),this.css(H,F+'px')}},{key:'scaler',value:function(M,W,F){var D='';this.css('transformOrigin','top left'),(0<=W||0<=F)&&(D=' translate('+(W||0)+'px, '+(F||0)+'px )'),this.css('transform','scale('+M+')'+D)}},{key:'fit',value:function(M,W){var F=this.viewport(),D=M/F.width,I=W/F.height,U=D<I?D:I,H=(W-F.height*U)/2;this.width(M),this.height(W),this.overflow('hidden'),this.viewport({scale:1}),this.scaler(U,0,H),this.css('backgroundColor','transparent')}},{key:'mapPage',value:function(M,W,F){var D=new z.default;return D.page(this,M,W,F)}},{key:'linksHandler',value:function(){var M=this;(0,R.replaceLinks)(this.content,function(W){M.emit('link',W)})}},{key:'destroy',value:function(){this.observer&&this.observer.disconnect(),this.removeListeners()}}],[{key:'listenedEvents',get:function(){return N}}]),O}();(0,S.default)(B.prototype),p.default=B,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(L,P){if(!(L instanceof P))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function L(P,T){for(var E=0;E<T.length;E++){var z=T[E];z.enumerable=z.enumerable||!1,z.configurable=!0,'value'in z&&(z.writable=!0),Object.defineProperty(P,z.key,z)}}return function(P,T,E){return T&&L(P.prototype,T),E&&L(P,E),P}}(),_=f(1),C=function(P){return P&&P.__esModule?P:{default:P}}(_),S=function(){function L(P){v(this,L),this.layout=P}return k(L,[{key:'section',value:function(T){var E=this.findRanges(T),z=this.rangeListToCfiList(T.section.cfiBase,E);return z}},{key:'page',value:function(T,E,z,R){var N=T&&T.document&&T.document.body;return N?this.rangePairToCfiPair(E,{start:this.findStart(N,z,R),end:this.findEnd(N,z,R)}):void 0}},{key:'walk',value:function(T,E){for(var R,N,z=document.createTreeWalker(T,NodeFilter.SHOW_TEXT,{acceptNode:function(O){return 0<O.data.trim().length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1);(R=z.nextNode())&&(N=E(R),!N););return N}},{key:'findRanges',value:function(T){var O,A,E=[],z=T.contents.scrollWidth(),R=this.layout.count(z),N=this.layout.column,B=this.layout.gap;for(var M=0;M<R.pages;M++)O=(N+B)*M,A=N*(M+1)+B*M,E.push({start:this.findStart(T.document.body,O,A),end:this.findEnd(T.document.body,O,A)});return E}},{key:'findStart',value:function(T,E,z){for(var N,B,R=[T],O=T;R.length;)if(N=R.shift(),B=this.walk(N,function(A){var M,W,F,D;return(A.nodeType==Node.TEXT_NODE?(D=document.createRange(),D.selectNodeContents(A),F=D.getBoundingClientRect()):F=A.getBoundingClientRect(),M=F.left,W=F.right,M>=E&&M<=z)?A:W>E?A:void(O=A,R.push(A))}),B)return this.findTextStartRange(B,E,z);return this.findTextStartRange(O,E,z)}},{key:'findEnd',value:function(T,E,z){for(var N,O,R=[T],B=T;R.length;)if(N=R.shift(),O=this.walk(N,function(A){var M,W,F,D;return(A.nodeType==Node.TEXT_NODE?(D=document.createRange(),D.selectNodeContents(A),F=D.getBoundingClientRect()):F=A.getBoundingClientRect(),M=F.left,W=F.right,M>z&&B)?B:W>z?A:void(B=A,R.push(A))}),O)return this.findTextEndRange(O,E,z);return this.findTextEndRange(B,E,z)}},{key:'findTextStartRange',value:function(T,E){var R,N,z=this.splitTextNodeIntoRanges(T);for(var B=0;B<z.length;B++)if(R=z[B],N=R.getBoundingClientRect(),N.left>=E)return R;return z[0]}},{key:'findTextEndRange',value:function(T,E,z){var N,B,O,R=this.splitTextNodeIntoRanges(T);for(var A=0;A<R.length;A++){if(B=R[A],O=B.getBoundingClientRect(),O.left>z&&N)return N;if(O.right>z)return B;N=B}return R[R.length-1]}},{key:'splitTextNodeIntoRanges',value:function(T,E){var B,z=[],R=T.textContent||'',N=R.trim(),O=T.ownerDocument,A=E||' ',M=N.indexOf(A);if(-1===M||T.nodeType!=Node.TEXT_NODE)return B=O.createRange(),B.selectNodeContents(T),[B];for(B=O.createRange(),B.setStart(T,0),B.setEnd(T,M),z.push(B),B=!1;-1!=M;)M=N.indexOf(A,M+1),0<M&&(B&&(B.setEnd(T,M),z.push(B)),B=O.createRange(),B.setStart(T,M+1));return B&&(B.setEnd(T,N.length),z.push(B)),z}},{key:'rangePairToCfiPair',value:function(T,E){var z=E.start,R=E.end;z.collapse(!0),R.collapse(!0);var N=new C.default(z,T).toString(),B=new C.default(R,T).toString();return{start:N,end:B}}},{key:'rangeListToCfiList',value:function(T,E){var R,z=[];for(var N=0;N<E.length;N++)R=this.rangePairToCfiPair(T,E[N]),z.push(R);return z}}]),L}();p.default=S,u.exports=p['default']},function(u,p){'use strict';'use strict';function f(_,C){if(!(_ instanceof C))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var v=function(){function _(C,S){for(var L=0;L<S.length;L++){var P=S[L];P.enumerable=P.enumerable||!1,P.configurable=!0,'value'in P&&(P.writable=!0),Object.defineProperty(C,P.key,P)}}return function(C,S,L){return S&&_(C.prototype,S),L&&_(C,L),C}}(),k=function(){function _(C){f(this,_),this.context=C||this,this.hooks=[]}return v(_,[{key:'register',value:function(){for(var S=0;S<arguments.length;++S)if('function'==typeof arguments[S])this.hooks.push(arguments[S]);else for(var L=0;L<arguments[S].length;++L)this.hooks.push(arguments[S][L])}},{key:'trigger',value:function(){var S=arguments,L=this.context,P=[];return this.hooks.forEach(function(T){var E=T.apply(L,S);E&&'function'==typeof E.then&&P.push(E)}),Promise.all(P)}},{key:'list',value:function(){return this.hooks}},{key:'clear',value:function(){return this.hooks=[]}}]),_}();p.default=k,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(S,L){if(!(S instanceof L))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0}),p.Task=void 0;var k=function(){function S(L,P){for(var T=0;T<P.length;T++){var E=P[T];E.enumerable=E.enumerable||!1,E.configurable=!0,'value'in E&&(E.writable=!0),Object.defineProperty(L,E.key,E)}}return function(L,P,T){return P&&S(L.prototype,P),T&&S(L,T),L}}(),_=f(0),C=function(){function S(L){v(this,S),this._q=[],this.context=L,this.tick=_.requestAnimationFrame,this.running=!1,this.paused=!1}return k(S,[{key:'enqueue',value:function(){var P,T,E,z=[].shift.call(arguments),R=arguments;if(!z)throw new Error('No Task Provided');return'function'==typeof z?(P=new _.defer,T=P.promise,E={task:z,args:R,deferred:P,promise:T}):E={promise:z},this._q.push(E),!1!=this.paused||this.running||this.run(),E.promise}},{key:'dequeue',value:function(){var P,T,E;if(this._q.length){if(P=this._q.shift(),T=P.task,T)return(E=T.apply(this.context,P.args),E&&'function'==typeof E.then)?E.then(function(){P.deferred.resolve.apply(this.context,arguments)}.bind(this),function(){P.deferred.reject.apply(this.context,arguments)}.bind(this)):(P.deferred.resolve.apply(this.context,E),P.promise);if(P.promise)return P.promise}else return P=new _.defer,P.deferred.resolve(),P.promise}},{key:'dump',value:function(){for(;this._q.length;)this.dequeue()}},{key:'run',value:function(){var P=this;return this.running||(this.running=!0,this.defered=new _.defer),this.tick.call(window,function(){P._q.length?P.dequeue().then(function(){this.run()}.bind(P)):(P.defered.resolve(),P.running=void 0)}),!0==this.paused&&(this.paused=!1),this.defered.promise}},{key:'flush',value:function(){return this.running?this.running:this._q.length?(this.running=this.dequeue().then(function(){return this.running=void 0,this.flush()}.bind(this)),this.running):void 0}},{key:'clear',value:function(){this._q=[],this.running=!1}},{key:'length',value:function(){return this._q.length}},{key:'pause',value:function(){this.paused=!0}}]),S}();p.default=C,p.Task=function S(L,P,T){return v(this,S),function(){var E=this,z=arguments||[];return new Promise(function(R,N){z.push(function(O,A){!O&&A?N(A):R(O)}),L.apply(T||E,z)})}}},function(u,p,f){'use strict';'use strict';Object.defineProperty(p,'__esModule',{value:!0});var v=f(0),k=f(3),_=function(S){return S&&S.__esModule?S:{default:S}}(k);p.default=function(S,L,P,T){var E='undefined'!=typeof window&&window.URL,z=E?'blob':'arraybuffer',R=new v.defer,N=new XMLHttpRequest,B=XMLHttpRequest.prototype;for(var O in'overrideMimeType'in B||Object.defineProperty(B,'overrideMimeType',{value:function(){}}),P&&(N.withCredentials=!0),N.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE){var M=!1;if((''===this.responseType||'document'===this.responseType)&&(M=this.responseXML),200===this.status||M){var W;if(!this.response&&!M)return R.reject({status:this.status,message:'Empty Response',stack:new Error().stack}),R.promise;if(403===this.status)return R.reject({status:this.status,response:this.response,message:'Forbidden',stack:new Error().stack}),R.promise;W=M?this.responseXML:(0,v.isXml)(L)?(0,v.parse)(this.response,'text/xml'):'xhtml'==L?(0,v.parse)(this.response,'application/xhtml+xml'):'html'==L||'htm'==L?(0,v.parse)(this.response,'text/html'):'json'==L?JSON.parse(this.response):'blob'==L?E?this.response:new Blob([this.response]):this.response,R.resolve(W)}else R.reject({status:this.status,message:this.response,stack:new Error().stack})}},N.onerror=function(M){R.reject(M)},N.open('GET',S,!0),T)N.setRequestHeader(O,T[O]);return'json'==L&&N.setRequestHeader('Accept','application/json'),L||(L=new _.default(S).extension),'blob'==L&&(N.responseType=z),(0,v.isXml)(L)&&N.overrideMimeType('text/xml'),'xhtml'==L,'html'!=L&&'htm'!=L,'binary'==L&&(N.responseType='arraybuffer'),N.send(),R.promise},u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(E){return E&&E.__esModule?E:{default:E}}function k(E,z){if(!(E instanceof z))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function E(z,R){for(var N=0;N<R.length;N++){var B=R[N];B.enumerable=B.enumerable||!1,B.configurable=!0,'value'in B&&(B.writable=!0),Object.defineProperty(z,B.key,B)}}return function(z,R,N){return R&&E(z.prototype,R),N&&E(z,N),z}}(),C=f(3),S=v(C),L=f(5),P=v(L),T=function(){function E(z,R){k(this,E);var N=-1<z.indexOf('://'),B=z;if(this.Url=void 0,this.href=z,this.protocol='',this.origin='',this.hash='',this.hash='',this.search='',this.base=R,!N&&!1!==R&&'string'!=typeof R&&window&&window.location&&(this.base=window.location.href),N||this.base)try{this.Url=this.base?new URL(z,this.base):new URL(z),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,B=this.Url.pathname}catch(O){this.Url=void 0}this.Path=new S.default(B),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}return _(E,[{key:'path',value:function(){return this.Path}},{key:'resolve',value:function(R){var B,N=-1<R.indexOf('://');return N?R:(B=P.default.resolve(this.directory,R),this.origin+B)}},{key:'relative',value:function(R){return P.default.relative(R,this.directory)}},{key:'toString',value:function(){return this.href}}]),E}();p.default=T,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(M){return M&&M.__esModule?M:{default:M}}function k(M,W){if(!(M instanceof W))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function M(W,F){for(var D=0;D<F.length;D++){var I=F[D];I.enumerable=I.enumerable||!1,I.configurable=!0,'value'in I&&(I.writable=!0),Object.defineProperty(W,I.key,I)}}return function(W,F,D){return F&&M(W.prototype,F),D&&M(W,D),W}}(),C=f(2),S=v(C),L=f(0),P=f(7),T=v(P),E=f(9),z=v(E),R=f(24),N=v(R),B=f(25),O=v(B),A=function(){function M(W){k(this,M),this.name='default',this.View=W.view,this.request=W.request,this.renditionQueue=W.queue,this.q=new z.default(this),this.settings=(0,L.extend)(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:'vertical',ignoreClass:''}),(0,L.extend)(this.settings,W.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,layout:this.layout,width:0,height:0}}return _(M,[{key:'render',value:function(F,D){this.stage=new N.default({width:D.width,height:D.height,overflow:this.settings.overflow,hidden:this.settings.hidden,axis:this.settings.axis}),this.stage.attachTo(F),this.container=this.stage.getContainer(),this.views=new O.default(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout()}},{key:'addEventListeners',value:function(){window.addEventListener('unload',function(){this.destroy()}.bind(this))}},{key:'destroy',value:function(){}},{key:'onResized',value:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){this.resize()}.bind(this),150)}},{key:'resize',value:function(F,D){this.q.clear(),this._stageSize=this.stage.size(F,D),this._bounds=this.bounds(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.views.each(function(I){I.size(this._stageSize.width,this._stageSize.height)}.bind(this)),this.updateLayout(),this.emit('resized',{width:this.stage.width,height:this.stage.height})}},{key:'createView',value:function(F){return new this.View(F,this.viewSettings)}},{key:'display',value:function(F,D){var I=new L.defer,U=I.promise,H=this.views.find(F);if(H&&D){var V=H.locationOf(D);return this.moveTo(V),I.resolve(),U}return this.views.hide(),this.views.clear(),this.add(F).then(function(X){if(D){var Y=X.locationOf(D);this.moveTo(Y)}}.bind(this)).then(function(){var X;if('pre-paginated'===this.layout.name&&1<this.layout.divisor&&(X=F.next(),X))return this.add(X)}.bind(this)).then(function(){this.views.show(),I.resolve()}.bind(this)),U}},{key:'afterDisplayed',value:function(F){this.emit('added',F)}},{key:'afterResized',value:function(F){this.emit('resize',F.section)}},{key:'moveTo',value:function(F){var D=0,I=0;'vertical'===this.settings.axis?I=F.top:(D=Math.floor(F.left/this.layout.delta)*this.layout.delta,D+this.layout.delta>this.container.scrollWidth&&(D=this.container.scrollWidth-this.layout.delta)),this.scrollTo(D,I)}},{key:'add',value:function(F){var D=this.createView(F);return this.views.append(D),D.onDisplayed=this.afterDisplayed.bind(this),D.onResize=this.afterResized.bind(this),D.display(this.request)}},{key:'append',value:function(F){var D=this.createView(F);return this.views.append(D),D.onDisplayed=this.afterDisplayed.bind(this),D.onResize=this.afterResized.bind(this),D.display(this.request)}},{key:'prepend',value:function(F){var D=this.createView(F);return this.views.prepend(D),D.onDisplayed=this.afterDisplayed.bind(this),D.onResize=this.afterResized.bind(this),D.display(this.request)}},{key:'next',value:function(){var W,F;if(this.views.length&&('horizontal'===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,F=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,F<this.container.scrollWidth?this.scrollBy(this.layout.delta,0):F-this.layout.columnWidth===this.container.scrollWidth?this.scrollTo(this.container.scrollWidth-this.layout.delta,0):W=this.views.last().section.next()):W=this.views.last().section.next(),W))return this.views.clear(),this.append(W).then(function(){var I;if(this.layout.name&&1<this.layout.divisor&&(I=W.next(),I))return this.append(I)}.bind(this)).then(function(){this.views.show()}.bind(this))}},{key:'prev',value:function(){var W,F;if(this.views.length&&('horizontal'===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,F=this.container.scrollLeft,0<F?this.scrollBy(-this.layout.delta,0):W=this.views.first().section.prev()):W=this.views.first().section.prev(),W))return this.views.clear(),this.prepend(W).then(function(){var U;if(this.layout.name&&1<this.layout.divisor&&(U=W.prev(),U))return this.prepend(U)}.bind(this)).then(function(){'horizontal'===this.settings.axis&&this.scrollTo(this.container.scrollWidth-this.layout.delta,0),this.views.show()}.bind(this))}},{key:'current',value:function(){var F=this.visible();return F.length?F[F.length-1]:null}},{key:'currentLocation',value:function(){return this.location='vertical'===this.settings.axis?this.scrolledLocation():this.paginatedLocation(),this.location}},{key:'scrolledLocation',value:function(){var F;if(this.views.length)return F=this.views.first(),this.mapping.page(F,F.section.cfiBase)}},{key:'paginatedLocation',value:function(){var F,D,I;if(this.views.length)return F=this.views.first(),D=this._bounds.left-F.position().left,I=D+this.layout.spreadWidth,this.mapping.page(F,F.section.cfiBase,D,I)}},{key:'isVisible',value:function(F,D,I,U){var H=F.position(),V=U||this.bounds();return'horizontal'===this.settings.axis&&H.right>V.left-D&&H.left<V.right+I||'vertical'===this.settings.axis&&H.bottom>V.top-D&&H.top<V.bottom+I}},{key:'visible',value:function(){var U,H,F=this.bounds(),D=this.views.displayed(),I=D.length,W=[];for(var V=0;V<I;V++)H=D[V],U=this.isVisible(H,0,0,F),!0===U&&W.push(H);return W}},{key:'scrollBy',value:function(F,D,I){I&&(this.ignore=!0),this.settings.height?(F&&(this.container.scrollLeft+=F),D&&(this.container.scrollTop+=D)):window.scrollBy(F,D),this.scrolled=!0,this.onScroll()}},{key:'scrollTo',value:function(F,D,I){I&&(this.ignore=!0),this.settings.height?(this.container.scrollLeft=F,this.container.scrollTop=D):window.scrollTo(F,D),this.scrolled=!0,this.onScroll()}},{key:'onScroll',value:function(){}},{key:'bounds',value:function(){var W=this.stage.bounds();return W}},{key:'applyLayout',value:function(F){this.layout=F,this.updateLayout(),this.mapping=new T.default(this.layout)}},{key:'updateLayout',value:function(){this.stage&&(this._stageSize=this.stage.size(),'vertical'===this.settings.axis?this.layout.calculate(this._stageSize.width,this._stageSize.height):(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta,this.stage.addStyleRules('iframe',[{'margin-right':this.layout.gap+'px'}])),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}},{key:'setLayout',value:function(F){this.viewSettings.layout=F,this.views&&this.views.each(function(D){D.setLayout(F)})}},{key:'updateFlow',value:function(F){var D='paginated'===F?'horizontal':'vertical';this.settings.axis=D,this.viewSettings.axis=D,this.settings.overflow='paginated'===F?'hidden':'auto'}},{key:'getContents',value:function(){var F=[];return this.views.each(function(D){F.push(D.contents)}),F}}]),M}();(0,S.default)(A.prototype),p.default=A,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(V){return V&&V.__esModule?V:{default:V}}function k(V,X){if(!(V instanceof X))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(V){return typeof V}:function(V){return V&&'function'==typeof Symbol&&V.constructor===Symbol&&V!==Symbol.prototype?'symbol':typeof V},C=function(){function V(X,Y){for(var J=0;J<Y.length;J++){var Z=Y[J];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,'value'in Z&&(Z.writable=!0),Object.defineProperty(X,Z.key,Z)}}return function(X,Y,J){return Y&&V(X.prototype,Y),J&&V(X,J),X}}(),S=f(2),L=v(S),P=f(0),T=f(8),E=v(T),z=f(1),R=v(z),N=f(9),B=v(N),O=f(22),A=v(O),M=f(7),W=v(M),F=f(32),D=v(F),I=f(6),U=v(I),H=function(){function V(X,Y){k(this,V),this.settings=(0,P.extend)(this.settings||{},{width:null,height:null,ignoreClass:'',manager:'default',view:'iframe',flow:null,layout:null,spread:null,minSpreadWidth:800}),(0,P.extend)(this.settings,Y),'object'===_(this.settings.manager)&&(this.manager=this.settings.manager),this.viewSettings={ignoreClass:this.settings.ignoreClass},this.book=X,this.views=null,this.hooks={},this.hooks.display=new E.default(this),this.hooks.serialize=new E.default(this),this.hooks.content=new E.default(this),this.hooks.layout=new E.default(this),this.hooks.render=new E.default(this),this.hooks.show=new E.default(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.themes=new D.default(this),this.epubcfi=new R.default,this.q=new B.default(this),this.q.enqueue(this.book.opened),this.starting=new P.defer,this.started=this.starting.promise,this.q.enqueue(this.start)}return C(V,[{key:'setManager',value:function(Y){this.manager=Y}},{key:'requireManager',value:function(Y){var J;return J='string'==typeof Y?'undefined'==typeof ePub?void 0:ePub.ViewManagers[Y]:Y,J}},{key:'requireView',value:function(Y){var J;return J='string'==typeof Y?'undefined'==typeof ePub?void 0:ePub.Views[Y]:Y,J}},{key:'start',value:function(){this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on('added',this.afterDisplayed.bind(this)),this.manager.on('resized',this.onResized.bind(this)),this.manager.on('scroll',this.reportLocation.bind(this)),this.on('displayed',this.reportLocation.bind(this)),this.emit('started'),this.starting.resolve()}},{key:'attachTo',value:function(Y){return this.q.enqueue(function(){this.manager.render(Y,{width:this.settings.width,height:this.settings.height}),this.emit('attached')}.bind(this))}},{key:'display',value:function(Y){return this.q.enqueue(this._display,Y)}},{key:'_display',value:function(Y){var G,K,J=this.epubcfi.isCfiString(Y),Z=new P.defer,Q=Z.promise;return(this.book.locations.length&&(0,P.isFloat)(Y)&&(Y=this.book.locations.cfiFromPercentage(Y)),G=this.book.spine.get(Y),!G)?(Z.reject(new Error('No Section Found')),Q):(!J&&'string'==typeof Y&&-1<Y.indexOf('#')&&(K=Y.substring(Y.indexOf('#')+1)),J&&(K=Y),this.manager.display(G,K).then(function(){}.bind(this)))}},{key:'afterDisplayed',value:function(Y){this.hooks.content.trigger(Y.contents,this),this.emit('rendered',Y.section),this.reportLocation()}},{key:'onResized',value:function(Y){this.location&&this.display(this.location.start),this.emit('resized',{width:Y.width,height:Y.height})}},{key:'moveTo',value:function(Y){this.manager.moveTo(Y)}},{key:'next',value:function(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}},{key:'prev',value:function(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}},{key:'determineLayoutProperties',value:function(Y){var J,Z=this.settings.layout||Y.layout||'reflowable',Q=this.settings.spread||Y.spread||'auto',G=this.settings.orientation||Y.orientation||'auto',K=this.settings.flow||Y.flow||'auto',$=Y.viewport||'',ee=this.settings.minSpreadWidth||Y.minSpreadWidth||800;return 0<=this.settings.width&&0<=this.settings.height&&($='width='+this.settings.width+', height='+this.settings.height+''),J={layout:Z,spread:Q,orientation:G,flow:K,viewport:$,minSpreadWidth:ee},J}},{key:'flow',value:function(Y){var J=Y;('scrolled-doc'===Y||'scrolled-continuous'===Y)&&(J='scrolled'),('auto'===Y||'paginated'===Y)&&(J='paginated'),this._layout&&this._layout.flow(J),this.manager&&this.manager.updateFlow(J)}},{key:'layout',value:function(Y){return Y&&(this._layout=new A.default(Y),this._layout.spread(Y.spread,this.settings.minSpreadWidth),this.mapping=new W.default(this._layout)),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}},{key:'spread',value:function(Y,J){this._layout.spread(Y,J),this.manager.isRendered()&&this.manager.updateLayout()}},{key:'reportLocation',value:function(){return this.q.enqueue(function(){var Y=this.manager.currentLocation();Y&&Y.then&&'function'==typeof Y.then?Y.then(function(J){this.location=J,this.percentage=this.book.locations.percentageFromCfi(J),null!=this.percentage&&(this.location.percentage=this.percentage),this.emit('locationChanged',this.location)}.bind(this)):Y&&(this.location=Y,this.percentage=this.book.locations.percentageFromCfi(Y),null!=this.percentage&&(this.location.percentage=this.percentage),this.emit('locationChanged',this.location))}.bind(this))}},{key:'currentLocation',value:function(){var Y=this.manager.currentLocation();if(Y&&Y.then&&'function'==typeof Y.then)Y.then(function(Z){var Q=this.book.locations.percentageFromCfi(Z);return null!=Q&&(Z.percentage=Q),Z}.bind(this));else if(Y){var J=this.book.locations.percentageFromCfi(Y);return null!=J&&(Y.percentage=J),Y}}},{key:'destroy',value:function(){this.q.clear(),this.manager.destroy()}},{key:'passEvents',value:function(Y){var J=U.default.listenedEvents;J.forEach(function(Z){Y.on(Z,this.triggerViewEvent.bind(this))}.bind(this)),Y.on('selected',this.triggerSelectedEvent.bind(this))}},{key:'triggerViewEvent',value:function(Y){this.emit(Y.type,Y)}},{key:'triggerSelectedEvent',value:function(Y){this.emit('selected',Y)}},{key:'range',value:function(Y,J){var Z=new R.default(Y),Q=this.visible().filter(function(G){if(Z.spinePos===G.index)return!0});if(Q.length)return Q[0].range(Z,J)}},{key:'adjustImages',value:function(Y){return Y.addStylesheetRules([['img',['max-width',this._layout.spreadWidth+'px'],['max-height',this._layout.height+'px']]]),new Promise(function(J){setTimeout(function(){J()},1)})}},{key:'getContents',value:function(){return this.manager?this.manager.getContents():[]}},{key:'handleLinks',value:function(Y){var J=this;Y.on('link',function(Z){var Q=J.book.path.relative(Z);J.display(Q)})}}]),V}();(0,L.default)(H.prototype),p.default=H,u.exports=p['default']},function(u){u.exports=s},function(u,p,f){'use strict';'use strict';function v(ie){return ie&&ie.__esModule?ie:{default:ie}}function k(ie,se){if(!(ie instanceof se))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(ie){return typeof ie}:function(ie){return ie&&'function'==typeof Symbol&&ie.constructor===Symbol&&ie!==Symbol.prototype?'symbol':typeof ie},C=function(){function ie(se,le){for(var re=0;re<le.length;re++){var oe=le[re];oe.enumerable=oe.enumerable||!1,oe.configurable=!0,'value'in oe&&(oe.writable=!0),Object.defineProperty(se,oe.key,oe)}}return function(se,le,re){return le&&ie(se.prototype,le),re&&ie(se,re),se}}(),S=f(2),L=v(S),P=f(0),T=f(11),E=v(T),z=f(3),R=v(z),N=f(31),B=v(N),O=f(23),A=v(O),M=f(21),W=v(M),F=f(27),D=v(F),I=f(26),U=v(I),H=f(29),V=v(H),X=f(28),Y=v(X),J=f(13),Z=v(J),Q=f(20),G=v(Q),K=f(10),$=v(K),ee=f(1),te=v(ee),ne='META-INF/container.xml',ae=function(){function ie(se,le){var re=this;k(this,ie),'undefined'==typeof le&&'object'===('undefined'==typeof se?'undefined':_(se))&&(le=se,se=void 0),this.settings=(0,P.extend)(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:'base64'}),(0,P.extend)(this.settings,le),this.opening=new P.defer,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new P.defer,spine:new P.defer,metadata:new P.defer,cover:new P.defer,navigation:new P.defer,pageList:new P.defer,resources:new P.defer},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources]),this.isRendered=!1,this.request=this.settings.requestMethod||$.default,this.spine=new B.default,this.locations=new A.default(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=new Y.default,this.url=void 0,this.path=void 0,this.archived=!1,se&&this.open(se).catch(function(){var oe=new Error('Cannot load book at '+se);re.emit('openFailed',oe)})}return C(ie,[{key:'open',value:function(le,re){var oe,de=re||this.determineType(le);return'binary'===de?(this.archived=!0,this.url=new E.default('/',''),oe=this.openEpub(le)):'base64'===de?(this.archived=!0,this.url=new E.default('/',''),oe=this.openEpub(le,de)):'epub'===de?(this.archived=!0,this.url=new E.default('/',''),oe=this.request(le,'binary').then(this.openEpub.bind(this))):'opf'==de?(this.url=new E.default(le),oe=this.openPackaging(this.url.Path.toString())):(this.url=new E.default(le),oe=this.openContainer(ne).then(this.openPackaging.bind(this))),oe}},{key:'openEpub',value:function(le,re){var oe=this;return this.unarchive(le,re||this.settings.encoding).then(function(){return oe.openContainer(ne)}).then(function(de){return oe.openPackaging(de)})}},{key:'openContainer',value:function(le){var re=this;return this.load(le).then(function(oe){return re.container=new W.default(oe),re.resolve(re.container.packagePath)})}},{key:'openPackaging',value:function(le){var re=this;return this.path=new R.default(le),this.load(le).then(function(oe){return re.packaging=new D.default(oe),re.unpack(re.packaging)})}},{key:'load',value:function(le){var re;return this.archived?(re=this.resolve(le),this.archive.request(re)):(re=this.resolve(le),this.request(re,null,this.settings.requestCredentials,this.settings.requestHeaders))}},{key:'resolve',value:function(le,re){var oe=le,de=-1<le.indexOf('://');return de?le:(this.path&&(oe=this.path.resolve(le)),!1!=re&&this.url&&(oe=this.url.resolve(oe)),oe)}},{key:'determineType',value:function(le){var re,oe,de;return'base64'===this.settings.encoding?'base64':'string'==typeof le?(re=new E.default(le),oe=re.path(),de=oe.extension,de?'epub'===de?'epub':'opf'===de?'opf':void 0:'directory'):'binary'}},{key:'unpack',value:function(le){var re=this;this.package=le,this.spine.unpack(this.package,this.resolve.bind(this)),this.resources=new V.default(this.package.manifest,{archive:this.archive,resolver:this.resolve.bind(this),replacements:this.settings.replacements}),this.loadNavigation(this.package).then(function(){re.toc=re.navigation.toc,re.loading.navigation.resolve(re.navigation)}),this.package.coverPath&&(this.cover=this.resolve(this.package.coverPath)),this.loading.manifest.resolve(this.package.manifest),this.loading.metadata.resolve(this.package.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived?this.replacements().then(function(){re.opening.resolve(re)}):this.opening.resolve(this)}},{key:'loadNavigation',value:function(le){var re=this,oe=le.navPath||le.ncxPath;return oe?this.load(oe,'xml').then(function(de){return re.navigation=new U.default(de),re.pageList=new Y.default(de),re.navigation}):void 0}},{key:'section',value:function(le){return this.spine.get(le)}},{key:'renderTo',value:function(le,re){return this.rendition=new Z.default(this,re),this.rendition.attachTo(le),this.rendition}},{key:'setRequestCredentials',value:function(le){this.settings.requestCredentials=le}},{key:'setRequestHeaders',value:function(le){this.settings.requestHeaders=le}},{key:'unarchive',value:function(le,re){return this.archive=new G.default,this.archive.open(le,re)}},{key:'coverUrl',value:function(){var le=this,re=this.loaded.cover.then(function(){return le.archived?le.resources.get(le.cover):le.cover});return re}},{key:'replacements',value:function(){var le=this;return this.spine.hooks.serialize.register(function(re,oe){oe.output=le.resources.substitute(re,oe.url)}),this.resources.replacements().then(function(){return le.resources.replaceCss()})}},{key:'range',value:function(le){var re=new te.default(le),oe=this.spine.get(re.spinePos);return oe.load().then(function(){var de=re.toRange(oe.document);return de})}},{key:'key',value:function(le){var re=le||this.package.metadata.identifier||this.url.filename;return'epubjs:0.3:'+re}}]),ie}();(0,L.default)(ae.prototype),p.default=ae,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(E,z){if(!(E instanceof z))throw new TypeError('Cannot call a class as a function')}function k(E,z){if(!E)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return z&&('object'==typeof z||'function'==typeof z)?z:E}function _(E,z){if('function'!=typeof z&&null!==z)throw new TypeError('Super expression must either be null or a function, not '+typeof z);E.prototype=Object.create(z&&z.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(E,z):E.__proto__=z)}Object.defineProperty(p,'__esModule',{value:!0});var C=function(){function E(z,R){for(var N=0;N<R.length;N++){var B=R[N];B.enumerable=B.enumerable||!1,B.configurable=!0,'value'in B&&(B.writable=!0),Object.defineProperty(z,B.key,B)}}return function(z,R,N){return R&&E(z.prototype,R),N&&E(z,N),z}}(),S=f(0),L=f(12),P=function(z){return z&&z.__esModule?z:{default:z}}(L),T=function(E){function z(R){v(this,z);var N=k(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,R));return N.name='continuous',N.settings=(0,S.extend)(N.settings||{},{infinite:!0,overflow:'auto',axis:'vertical',offset:500,offsetDelta:250,width:void 0,height:void 0}),(0,S.extend)(N.settings,R.settings||{}),'undefined'!=R.settings.gap&&0===R.settings.gap&&(N.settings.gap=R.settings.gap),N.viewSettings={ignoreClass:N.settings.ignoreClass,axis:N.settings.axis,layout:N.layout,width:0,height:0},N.scrollTop=0,N.scrollLeft=0,N}return _(z,E),C(z,[{key:'display',value:function(N,B){return P.default.prototype.display.call(this,N,B).then(function(){return this.fill()}.bind(this))}},{key:'fill',value:function(N){var B=N||new S.defer;return this.check().then(function(O){O?this.fill(B):B.resolve()}.bind(this)),B.promise}},{key:'moveTo',value:function(N){var B=0,O=0,A=0,M=0;return'vertical'===this.settings.axis?(O=N.top,M=N.top+this.settings.offset):(B=Math.floor(N.left/this.layout.delta)*this.layout.delta,A=B+this.settings.offset),this.check(A,M).then(function(){this.scrollBy(B,O)}.bind(this))}},{key:'resize',value:function(N,B){this.q.clear(),this._stageSize=this.stage.size(N,B),this._bounds=this.bounds(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.views.each(function(O){O.size(this._stageSize.width,this._stageSize.height)}.bind(this)),this.updateLayout(),this.emit('resized',{width:this.stage.width,height:this.stage.height})}},{key:'onResized',value:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){this.resize()}.bind(this),150)}},{key:'afterResized',value:function(N){this.emit('resize',N.section)}},{key:'removeShownListeners',value:function(N){N.onDisplayed=function(){}}},{key:'append',value:function(N){var B=this.createView(N);return this.views.append(B),B.onDisplayed=this.afterDisplayed.bind(this),B}},{key:'prepend',value:function(N){var B=this.createView(N);return B.on('resized',this.counter.bind(this)),this.views.prepend(B),B.onDisplayed=this.afterDisplayed.bind(this),B}},{key:'counter',value:function(N){'vertical'===this.settings.axis?this.scrollBy(0,N.heightDelta,!0):this.scrollBy(N.widthDelta,0,!0)}},{key:'update',value:function(N){var F,D,B=this.bounds(),O=this.views.all(),A=O.length,M=[],W='undefined'==typeof N?this.settings.offset||0:N,I=new S.defer,U=[];for(var H=0;H<A;H++)D=O[H],F=this.isVisible(D,W,W,B),!0===F?(!D.displayed&&U.push(D.display(this.request).then(function(V){V.show()})),M.push(D)):(this.q.enqueue(D.destroy.bind(D)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout(function(){this.q.enqueue(this.trim.bind(this))}.bind(this),250));return U.length?Promise.all(U):(I.resolve(),I.promise)}},{key:'check',value:function(N,B){var O,A,M,W,F=new S.defer,D=[],I='horizontal'===this.settings.axis,U=this.settings.offset||0;N&&I&&(U=N),B&&!I&&(U=B);var H=this._bounds,V=I?this.scrollLeft:this.scrollTop,X=I?H.width:H.height,Y=I?this.container.scrollWidth:this.container.scrollHeight;return V+X+U>=Y&&(O=this.views.last(),M=O&&O.section.next(),M&&D.push(this.append(M))),0>V-U&&(A=this.views.first(),W=A&&A.section.prev(),W&&D.push(this.prepend(W))),D.length?this.q.enqueue(function(){return this.update(U)}.bind(this)):(F.resolve(!1),F.promise)}},{key:'trim',value:function(){var N=new S.defer,B=this.views.displayed(),O=B[0],A=B[B.length-1],M=this.views.indexOf(O),W=this.views.indexOf(A),F=this.views.slice(0,M),D=this.views.slice(W+1);for(var I=0;I<F.length-1;I++)this.erase(F[I],F);for(var U=1;U<D.length;U++)this.erase(D[U]);return N.resolve(),N.promise}},{key:'erase',value:function(N,B){var O,A;this.settings.height?(O=this.container.scrollTop,A=this.container.scrollLeft):(O=window.scrollY,A=window.scrollX);var M=N.bounds();this.views.remove(N),B&&('vertical'===this.settings.axis?this.scrollTo(0,O-M.height,!0):this.scrollTo(A-M.width,0,!0))}},{key:'addEventListeners',value:function(){window.addEventListener('unload',function(){this.ignore=!0,this.destroy()}.bind(this)),this.addScrollListeners()}},{key:'addScrollListeners',value:function(){var N;this.tick=S.requestAnimationFrame,this.settings.height?(this.prevScrollTop=this.container.scrollTop,this.prevScrollLeft=this.container.scrollLeft):(this.prevScrollTop=window.scrollY,this.prevScrollLeft=window.scrollX),this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.height?(N=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft):(N=window,this.scrollTop=window.scrollY,this.scrollLeft=window.scrollX),N.addEventListener('scroll',this.onScroll.bind(this)),this.scrolled=!1}},{key:'onScroll',value:function(){var N=void 0,B=void 0;this.settings.height?(N=this.container.scrollTop,B=this.container.scrollLeft):(N=window.scrollY,B=window.scrollX),this.scrollTop=N,this.scrollLeft=B,this.ignore?this.ignore=!1:(0===this.scrollDeltaVert&&0===this.scrollDeltaHorz||this.scrollDeltaVert>this.settings.offsetDelta||this.scrollDeltaHorz>this.settings.offsetDelta)&&(this.q.enqueue(function(){this.check()}.bind(this)),this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.emit('scroll',{top:N,left:B}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout(function(){this.emit('scrolled',{top:this.scrollTop,left:this.scrollLeft})}.bind(this))),this.scrollDeltaVert+=Math.abs(N-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(B-this.prevScrollLeft),this.prevScrollTop=N,this.prevScrollLeft=B,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}.bind(this),150),this.scrolled=!1}},{key:'currentLocation',value:function(){return this.location='vertical'===this.settings.axis?this.scrolledLocation():this.paginatedLocation(),this.location}},{key:'scrolledLocation',value:function(){var B,O,N=this.visible();return 1===N.length?this.mapping.page(N[0].contents,N[0].section.cfiBase):1<N.length?(B=this.mapping.page(N[0].contents,N[0].section.cfiBase),O=this.mapping.page(N[N.length-1].contents,N[N.length-1].section.cfiBase),{start:B.start,end:O.end}):void 0}},{key:'paginatedLocation',value:function(){var B,O,A,M,W,F,N=this.visible(),D=this.container.getBoundingClientRect();return 1===N.length?(B=D.left-N[0].position().left,A=B+this.layout.spreadWidth,this.mapping.page(N[0].contents,N[0].section.cfiBase,B,A)):1<N.length?(B=D.left-N[0].position().left,A=B+this.layout.columnWidth,O=D.left+this.layout.spreadWidth-N[N.length-1].position().left,M=O+this.layout.columnWidth,W=this.mapping.page(N[0].contents,N[0].section.cfiBase,B,A),F=this.mapping.page(N[N.length-1].contents,N[N.length-1].section.cfiBase,O,M),{start:W.start,end:F.end}):void 0}},{key:'updateLayout',value:function(){this.stage&&('vertical'===this.settings.axis?this.layout.calculate(this._stageSize.width,this._stageSize.height):(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta,this.stage.addStyleRules('iframe',[{'margin-right':this.layout.gap+'px'}])),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}},{key:'next',value:function(){'horizontal'===this.settings.axis?(this.scrollLeft=this.container.scrollLeft,this.container.scrollLeft+this.container.offsetWidth+this.layout.delta<this.container.scrollWidth?this.scrollBy(this.layout.delta,0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0)):this.scrollBy(0,this.layout.height)}},{key:'prev',value:function(){'horizontal'===this.settings.axis?this.scrollBy(-this.layout.delta,0):this.scrollBy(0,-this.layout.height)}},{key:'updateFlow',value:function(N){var B='paginated'===N?'horizontal':'vertical';this.settings.axis=B,this.viewSettings.axis=B,this.settings.overflow='paginated'===N?'hidden':'auto',this.settings.infinite='vertical'===this.settings.axis}}]),z}(P.default);p.default=T,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(N){return N&&N.__esModule?N:{default:N}}function k(N,B){if(!(N instanceof B))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function N(B,O){for(var A=0;A<O.length;A++){var M=O[A];M.enumerable=M.enumerable||!1,M.configurable=!0,'value'in M&&(M.writable=!0),Object.defineProperty(B,M.key,M)}}return function(B,O,A){return O&&N(B.prototype,O),A&&N(B,A),B}}(),C=f(2),S=v(C),L=f(0),P=f(1),T=v(P),E=f(6),z=v(E),R=function(){function N(B,O){k(this,N),this.settings=(0,L.extend)({ignoreClass:'',axis:'vertical',width:0,height:0,layout:void 0,globalLayoutProperties:{}},O||{}),this.id='epubjs-view-'+(0,L.uuid)(),this.section=B,this.index=B.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.width=this.settings.width,this.height=this.settings.height,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new T.default,this.layout=this.settings.layout}return _(N,[{key:'container',value:function(O){var A=document.createElement('div');return A.classList.add('epub-view'),A.style.height='0px',A.style.width='0px',A.style.overflow='hidden',A.style.display=O&&'horizontal'==O?'inline-block':'block',A}},{key:'create',value:function(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement('iframe'),this.iframe.id=this.id,this.iframe.scrolling='no',this.iframe.style.overflow='hidden',this.iframe.seamless='seamless',this.iframe.style.border='none',this.resizing=!0,this.element.style.visibility='hidden',this.iframe.style.visibility='hidden',this.iframe.style.width='0',this.iframe.style.height='0',this._width=0,this._height=0,this.element.appendChild(this.iframe),this.added=!0,this.elementBounds=(0,L.bounds)(this.element),this.supportsSrcdoc=!('srcdoc'in this.iframe),this.iframe)}},{key:'render',value:function(O,A){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(O)),this.sectionRender.then(function(M){return this.load(M)}.bind(this)).then(function(){}.bind(this)).then(function(){this.settings.layout.format(this.contents),this.expand(),this.addListeners(),!1!==A,this.emit('rendered',this.section)}.bind(this)).catch(function(M){this.emit('loaderror',M)}.bind(this))}},{key:'size',value:function(O,A){var M=O||this.settings.width,W=A||this.settings.height;'pre-paginated'===this.layout.name?this.lock('both',M,W):'horizontal'===this.settings.axis?this.lock('height',M,W):this.lock('width',M,W)}},{key:'lock',value:function(O,A,M){var F,W=(0,L.borders)(this.element);F=this.iframe?(0,L.borders)(this.iframe):{width:0,height:0},'width'==O&&(0,L.isNumber)(A)&&(this.lockedWidth=A-W.width-F.width,this.resize(this.lockedWidth,A)),'height'==O&&(0,L.isNumber)(M)&&(this.lockedHeight=M-W.height-F.height,this.resize(A,this.lockedHeight)),'both'===O&&(0,L.isNumber)(A)&&(0,L.isNumber)(M)&&(this.lockedWidth=A-W.width-F.width,this.lockedHeight=M-W.height-F.height,this.resize(this.lockedWidth,this.lockedHeight)),this.displayed&&this.iframe&&this.expand()}},{key:'expand',value:function(){var M,W,F,O=this.lockedWidth,A=this.lockedHeight;!this.iframe||this._expanding||(this._expanding=!0,'horizontal'===this.settings.axis?(W=this.contents.textWidth(),W==this._textWidth?O=this._contentWidth:(O=this.contentWidth(W),M=Math.ceil(O/(this.settings.layout.columnWidth+this.settings.layout.gap)),1<this.settings.layout.divisor&&'reflowable'===this.settings.layout.name&&0<M%2&&(O+=this.settings.layout.gap+this.settings.layout.columnWidth),this._textWidth=W,this._contentWidth=O)):'vertical'===this.settings.axis&&(F=this.contents.textHeight(),F==this._textHeight?A=this._contentHeight:(A=this.contentHeight(F),this._textHeight=F,this._contentHeight=A)),(this._needsReframe||O!=this._width||A!=this._height)&&this.resize(O,A),this._expanding=!1)}},{key:'contentWidth',value:function(O){var A,M;return A=this.iframe.style.width,this.iframe.style.width=(O||0)+'px',M=this.contents.scrollWidth(),this.iframe.style.width=A,M}},{key:'contentHeight',value:function(O){var A,M;return A=this.iframe.style.height,this.iframe.style.height=(O||0)+'px',M=this.contents.scrollHeight(),this.iframe.style.height=A,M}},{key:'resize',value:function(O,A){this.iframe&&((0,L.isNumber)(O)&&(this.iframe.style.width=O+'px',this._width=O),(0,L.isNumber)(A)&&(this.iframe.style.height=A+'px',this._height=A),this.iframeBounds=(0,L.bounds)(this.iframe),this.reframe(this.iframeBounds.width,this.iframeBounds.height))}},{key:'reframe',value:function(O,A){var M;(0,L.isNumber)(O)&&(this.element.style.width=O+'px'),(0,L.isNumber)(A)&&(this.element.style.height=A+'px'),this.prevBounds=this.elementBounds,this.elementBounds=(0,L.bounds)(this.element),M={width:this.elementBounds.width,height:this.elementBounds.height,widthDelta:this.elementBounds.width-this.prevBounds.width,heightDelta:this.elementBounds.height-this.prevBounds.height},this.onResize(this,M),this.emit('resized',M)}},{key:'load',value:function(O){var A=new L.defer,M=A.promise;if(!this.iframe)return A.reject(new Error('No Iframe Available')),M;if(this.iframe.onload=function(W){this.onLoad(W,A)}.bind(this),this.supportsSrcdoc)this.iframe.srcdoc=O;else{if(this.document=this.iframe.contentDocument,!this.document)return A.reject(new Error('No Document Available')),M;this.iframe.contentDocument.open(),this.iframe.contentDocument.write(O),this.iframe.contentDocument.close()}return M}},{key:'onLoad',value:function(O,A){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new z.default(this.document,this.document.body,this.section.cfiBase),this.rendering=!1;var M=this.document.querySelector('link[rel=\'canonical\']');M?M.setAttribute('href',this.section.url):(M=this.document.createElement('link'),M.setAttribute('rel','canonical'),M.setAttribute('href',this.section.url),this.document.querySelector('head').appendChild(M)),this.contents.on('expand',function(){this.displayed&&this.iframe&&this.expand()}),A.resolve(this.contents)}},{key:'setLayout',value:function(O){this.layout=O}},{key:'setAxis',value:function(O){this.settings.axis=O}},{key:'resizeListenters',value:function(){clearTimeout(this.expanding),this.expanding=setTimeout(this.expand.bind(this),350)}},{key:'addListeners',value:function(){}},{key:'removeListeners',value:function(){}},{key:'display',value:function(O){var A=new L.defer;return this.displayed?A.resolve(this):this.render(O).then(function(){this.emit('displayed',this),this.onDisplayed(this),this.displayed=!0,A.resolve(this)}.bind(this)),A.promise}},{key:'show',value:function(){this.element.style.visibility='visible',this.iframe&&(this.iframe.style.visibility='visible'),this.emit('shown',this)}},{key:'hide',value:function(){this.element.style.visibility='hidden',this.iframe.style.visibility='hidden',this.stopExpanding=!0,this.emit('hidden',this)}},{key:'position',value:function(){return this.element.getBoundingClientRect()}},{key:'locationOf',value:function(O){var A=this.iframe.getBoundingClientRect(),M=this.contents.locationOf(O,this.settings.ignoreClass);return{left:window.scrollX+A.left+M.left,top:window.scrollY+A.top+M.top}}},{key:'onDisplayed',value:function(){}},{key:'onResize',value:function(){}},{key:'bounds',value:function(){return this.elementBounds||(this.elementBounds=(0,L.bounds)(this.element)),this.elementBounds}},{key:'destroy',value:function(){this.displayed&&(this.displayed=!1,this.removeListeners(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.displayed=!1,this.iframe=null,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}}]),N}();(0,S.default)(R.prototype),p.default=R,u.exports=p['default']},function(u){var p=function(){return this}();try{p=p||Function('return this')()||(1,eval)('this')}catch(f){'object'==typeof window&&(p=window)}u.exports=p},function(u){'use strict';'use strict';var p={application:{ecmascript:['es','ecma'],javascript:'js',ogg:'ogx',pdf:'pdf',postscript:['ps','ai','eps','epsi','epsf','eps2','eps3'],'rdf+xml':'rdf',smil:['smi','smil'],'xhtml+xml':['xhtml','xht'],xml:['xml','xsl','xsd','opf','ncx'],zip:'zip','x-httpd-eruby':'rhtml','x-latex':'latex','x-maker':['frm','maker','frame','fm','fb','book','fbdoc'],'x-object':'o','x-shockwave-flash':['swf','swfl'],'x-silverlight':'scr','epub+zip':'epub','font-tdpfr':'pfr','inkml+xml':['ink','inkml'],json:'json','jsonml+json':'jsonml','mathml+xml':'mathml','metalink+xml':'metalink',mp4:'mp4s','omdoc+xml':'omdoc',oxps:'oxps','vnd.amazon.ebook':'azw',widget:'wgt','x-dtbook+xml':'dtb','x-dtbresource+xml':'res','x-font-bdf':'bdf','x-font-ghostscript':'gsf','x-font-linux-psf':'psf','x-font-otf':'otf','x-font-pcf':'pcf','x-font-snf':'snf','x-font-ttf':['ttf','ttc'],'x-font-type1':['pfa','pfb','pfm','afm'],'x-font-woff':'woff','x-mobipocket-ebook':['prc','mobi'],'x-mspublisher':'pub','x-nzb':'nzb','x-tgif':'obj','xaml+xml':'xaml','xml-dtd':'dtd','xproc+xml':'xpl','xslt+xml':'xslt','internet-property-stream':'acx','x-compress':'z','x-compressed':'tgz','x-gzip':'gz'},audio:{flac:'flac',midi:['mid','midi','kar','rmi'],mpeg:['mpga','mpega','mp2','mp3','m4a','mp2a','m2a','m3a'],mpegurl:'m3u',ogg:['oga','ogg','spx'],'x-aiff':['aif','aiff','aifc'],'x-ms-wma':'wma','x-wav':'wav',adpcm:'adp',mp4:'mp4a',webm:'weba','x-aac':'aac','x-caf':'caf','x-matroska':'mka','x-pn-realaudio-plugin':'rmp',xm:'xm',mid:['mid','rmi']},image:{gif:'gif',ief:'ief',jpeg:['jpeg','jpg','jpe'],pcx:'pcx',png:'png','svg+xml':['svg','svgz'],tiff:['tiff','tif'],'x-icon':'ico',bmp:'bmp',webp:'webp','x-pict':['pic','pct'],'x-tga':'tga','cis-cod':'cod'},text:{'cache-manifest':['manifest','appcache'],css:'css',csv:'csv',html:['html','htm','shtml','stm'],mathml:'mml',plain:['txt','text','brf','conf','def','list','log','in','bas'],richtext:'rtx','tab-separated-values':'tsv','x-bibtex':'bib'},video:{mpeg:['mpeg','mpg','mpe','m1v','m2v','mp2','mpa','mpv2'],mp4:['mp4','mp4v','mpg4'],quicktime:['qt','mov'],ogg:'ogv','vnd.mpegurl':['mxu','m4u'],'x-flv':'flv','x-la-asf':['lsf','lsx'],'x-mng':'mng','x-ms-asf':['asf','asx','asr'],'x-ms-wm':'wm','x-ms-wmv':'wmv','x-ms-wmx':'wmx','x-ms-wvx':'wvx','x-msvideo':'avi','x-sgi-movie':'movie','x-matroska':['mpv','mkv','mk3d','mks'],'3gpp2':'3g2',h261:'h261',h263:'h263',h264:'h264',jpeg:'jpgv',jpm:['jpm','jpgm'],mj2:['mj2','mjp2'],'vnd.ms-playready.media.pyv':'pyv','vnd.uvvu.mp4':['uvu','uvvu'],'vnd.vivo':'viv',webm:'webm','x-f4v':'f4v','x-m4v':'m4v','x-ms-vob':'vob','x-smv':'smv'}},f=function(){var v,k,_,C,S={};for(v in p)if(p.hasOwnProperty(v))for(k in p[v])if(p[v].hasOwnProperty(k))if(_=p[v][k],'string'==typeof _)S[_]=v+'/'+k;else for(C=0;C<_.length;C++)S[_[C]]=v+'/'+k;return S}();u.exports={lookup:function(k){return k&&f[k.split('.').pop().toLowerCase()]||'text/plain'}}},function(u,p,f){'use strict';'use strict';function v(N){return N&&N.__esModule?N:{default:N}}function k(N,B){if(!(N instanceof B))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function N(B,O){for(var A=0;A<O.length;A++){var M=O[A];M.enumerable=M.enumerable||!1,M.configurable=!0,'value'in M&&(M.writable=!0),Object.defineProperty(B,M.key,M)}}return function(B,O,A){return O&&N(B.prototype,O),A&&N(B,A),B}}(),C=f(0),S=f(10),L=v(S),P=f(19),T=v(P),E=f(3),z=v(E),R=function(){function N(){k(this,N),this.zip=void 0,this.checkRequirements(),this.urlCache={}}return _(N,[{key:'checkRequirements',value:function(){try{if('undefined'==typeof JSZip){var O=f(48);this.zip=new O}else this.zip=new JSZip}catch(A){throw new Error('JSZip lib not loaded')}}},{key:'open',value:function(O,A){return this.zip.loadAsync(O,{base64:A})}},{key:'openUrl',value:function(O,A){return(0,L.default)(O,'binary').then(function(M){return this.zip.loadAsync(M,{base64:A})}.bind(this))}},{key:'request',value:function(O,A){var W,M=new C.defer,F=new z.default(O);return A||(A=F.extension),W='blob'==A?this.getBlob(O):this.getText(O),W?W.then(function(D){var I=this.handleResponse(D,A);M.resolve(I)}.bind(this)):M.reject({message:'File not found in the epub: '+O,stack:new Error().stack}),M.promise}},{key:'handleResponse',value:function(O,A){var M;return M='json'==A?JSON.parse(O):(0,C.isXml)(A)?(0,C.parse)(O,'text/xml'):'xhtml'==A?(0,C.parse)(O,'application/xhtml+xml'):'html'==A||'htm'==A?(0,C.parse)(O,'text/html'):O,M}},{key:'getBlob',value:function(O,A){var M=window.decodeURIComponent(O.substr(1)),W=this.zip.file(M);if(W)return A=A||T.default.lookup(W.name),W.async('uint8array').then(function(F){return new Blob([F],{type:A})})}},{key:'getText',value:function(O){var A=window.decodeURIComponent(O.substr(1)),M=this.zip.file(A);if(M)return M.async('string').then(function(W){return W})}},{key:'getBase64',value:function(O,A){var M=window.decodeURIComponent(O.substr(1)),W=this.zip.file(M);if(W)return A=A||T.default.lookup(W.name),W.async('base64').then(function(F){return'data:'+A+';base64,'+F})}},{key:'createUrl',value:function(O,A){var F,D,M=new C.defer,W=window.URL||window.webkitURL||window.mozURL,I=A&&A.base64;return O in this.urlCache?(M.resolve(this.urlCache[O]),M.promise):(I?(D=this.getBase64(O),D&&D.then(function(U){this.urlCache[O]=U,M.resolve(U)}.bind(this))):(D=this.getBlob(O),D&&D.then(function(U){F=W.createObjectURL(U),this.urlCache[O]=F,M.resolve(F)}.bind(this))),D||M.reject({message:'File not found in the epub: '+O,stack:new Error().stack}),M.promise)}},{key:'revokeUrl',value:function(O){var A=window.URL||window.webkitURL||window.mozURL,M=this.urlCache[O];M&&A.revokeObjectURL(M)}}]),N}();p.default=R,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(P,T){if(!(P instanceof T))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function P(T,E){for(var z=0;z<E.length;z++){var R=E[z];R.enumerable=R.enumerable||!1,R.configurable=!0,'value'in R&&(R.writable=!0),Object.defineProperty(T,R.key,R)}}return function(T,E,z){return E&&P(T.prototype,E),z&&P(T,z),T}}(),_=f(5),C=function(T){return T&&T.__esModule?T:{default:T}}(_),S=f(0),L=function(){function P(T){v(this,P),T&&this.parse(T)}return k(P,[{key:'parse',value:function(E){var z;if(!E)throw new Error('Container File Not Found');if(z=(0,S.qs)(E,'rootfile'),!z)throw new Error('No RootFile Found');this.packagePath=z.getAttribute('full-path'),this.directory=C.default.dirname(this.packagePath),this.encoding=E.xmlEncoding}}]),P}();p.default=L,u.exports=p['default']},function(u,p){'use strict';'use strict';function f(_,C){if(!(_ instanceof C))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var v=function(){function _(C,S){for(var L=0;L<S.length;L++){var P=S[L];P.enumerable=P.enumerable||!1,P.configurable=!0,'value'in P&&(P.writable=!0),Object.defineProperty(C,P.key,P)}}return function(C,S,L){return S&&_(C.prototype,S),L&&_(C,L),C}}(),k=function(){function _(C){f(this,_),this.name=C.layout||'reflowable',this._spread='none'!==C.spread,this._minSpreadWidth=C.minSpreadWidth||800,this._evenSpreads=C.evenSpreads||!1,this._flow='scrolled-continuous'===C.flow||'scrolled-doc'===C.flow?'scrolled':'paginated',this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1}return v(_,[{key:'flow',value:function(S){this._flow='paginated'===S?'paginated':'scrolled'}},{key:'spread',value:function(S,L){this._spread='none'!==S,0<=L&&(this._minSpreadWidth=L)}},{key:'calculate',value:function(S,L,P){var N,B,O,T=1,E=P||0,z=S,R=Math.floor(z/8);T=this._spread&&z>=this._minSpreadWidth?2:1,'reflowable'!==this.name||'paginated'!==this._flow||0<=P||(E=0==R%2?R:R-1),'pre-paginated'===this.name&&(E=0),N=1<T?(z-E)/T:z,'pre-paginated'===this.name&&1<T&&(z=N),B=N*T,O=(N+E)*T,this.width=z,this.height=L,this.spreadWidth=B,this.delta=O,this.columnWidth=N,this.gap=E,this.divisor=T}},{key:'format',value:function(S){var L;return L='pre-paginated'===this.name?S.fit(this.columnWidth,this.height):'paginated'===this._flow?S.columns(this.width,this.height,this.columnWidth,this.gap):S.size(this.width,null),L}},{key:'count',value:function(S){var L=Math.ceil(S/this.spreadWidth);return{spreads:L,pages:L*this.divisor}}}]),_}();p.default=k,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(N){return N&&N.__esModule?N:{default:N}}function k(N,B){if(!(N instanceof B))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function N(B,O){for(var A=0;A<O.length;A++){var M=O[A];M.enumerable=M.enumerable||!1,M.configurable=!0,'value'in M&&(M.writable=!0),Object.defineProperty(B,M.key,M)}}return function(B,O,A){return O&&N(B.prototype,O),A&&N(B,A),B}}(),C=f(0),S=f(9),L=v(S),P=f(1),T=v(P),E=f(2),z=v(E),R=function(){function N(B,O){k(this,N),this.spine=B,this.request=O,this.q=new L.default(this),this.epubcfi=new T.default,this._locations=[],this.total=0,this.break=150,this._current=0}return _(N,[{key:'generate',value:function(O){return O&&(this.break=O),this.q.pause(),this.spine.each(function(A){this.q.enqueue(this.process.bind(this),A)}.bind(this)),this.q.run().then(function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}.bind(this))}},{key:'createRange',value:function(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}},{key:'process',value:function(O){return O.load(this.request).then(function(A){var M=this.parse(A,O.cfiBase);this._locations=this._locations.concat(M)}.bind(this))}},{key:'parse',value:function(O,A,M){var F,H,W=[],D=O.ownerDocument,I=(0,C.qs)(D,'body'),U=0,V=M||this.break;if((0,C.sprint)(I,function(J){var Q,Z=J.length,G=0;if(0===J.textContent.trim().length)return!1;for(0==U&&(F=this.createRange(),F.startContainer=J,F.startOffset=0),Q=V-U,Q>Z&&(U+=Z,G=Z);G<Z;)if(G+=Q,G>=Z)U=Z-(G-V);else{F.endContainer=J,F.endOffset=G;var K=new T.default(F,A).toString();W.push(K),U=0,G+=1,F=this.createRange(),F.startContainer=J,F.startOffset=G,Q=V}H=J}.bind(this)),F&&F.startContainer&&H){F.endContainer=H,F.endOffset=H.length;var X=new T.default(F,A).toString();W.push(X),U=0}return W}},{key:'locationFromCfi',value:function(O){return 0===this._locations.length?-1:(0,C.locationOf)(O.start,this._locations,this.epubcfi.compare)}},{key:'percentageFromCfi',value:function(O){if(0===this._locations.length)return null;var A=this.locationFromCfi(O);return this.percentageFromLocation(A)}},{key:'percentageFromLocation',value:function(O){return O&&this.total?O/this.total:0}},{key:'cfiFromLocation',value:function(O){var A=-1;return'number'!=typeof O&&(O=parseInt(O)),0<=O&&O<this._locations.length&&(A=this._locations[O]),A}},{key:'cfiFromPercentage',value:function(O){var A=1<O?O/100:O,M=Math.ceil(this.total*A);return this.cfiFromLocation(M)}},{key:'load',value:function(O){return this._locations=JSON.parse(O),this.total=this._locations.length-1,this._locations}},{key:'save',value:function(){return JSON.stringify(this._locations)}},{key:'getCurrent',value:function(){return this._current}},{key:'setCurrent',value:function(O){var A;if('string'==typeof O)this._currentCfi=O;else if('number'==typeof O)this._current=O;else return;0===this._locations.length||('string'==typeof O?(A=this.locationFromCfi(O),this._current=A):A=O,this.emit('changed',{percentage:this.percentageFromLocation(A)}))}},{key:'length',value:function(){return this._locations.length}},{key:'currentLocation',get:function(){return this._current},set:function(O){this.setCurrent(O)}}]),N}();(0,z.default)(R.prototype),p.default=R,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(S,L){if(!(S instanceof L))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function S(L,P){for(var T=0;T<P.length;T++){var E=P[T];E.enumerable=E.enumerable||!1,E.configurable=!0,'value'in E&&(E.writable=!0),Object.defineProperty(L,E.key,E)}}return function(L,P,T){return P&&S(L.prototype,P),T&&S(L,T),L}}(),_=f(0),C=function(){function S(L){v(this,S),this.settings=L||{},this.id='epubjs-container-'+(0,_.uuid)(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}return k(S,[{key:'create',value:function(P){var T=P.height,E=P.width,z=P.overflow||!1,R=P.axis||'vertical';P.height&&(0,_.isNumber)(P.height)&&(T=P.height+'px'),P.width&&(0,_.isNumber)(P.width)&&(E=P.width+'px');var N=document.createElement('div');return N.id=this.id,N.classList.add('epub-container'),N.style.wordSpacing='0',N.style.lineHeight='0',N.style.verticalAlign='top','horizontal'===R&&(N.style.whiteSpace='nowrap'),E&&(N.style.width=E),T&&(N.style.height=T),z&&(N.style.overflow=z),N}},{key:'wrap',value:function(P){var T=document.createElement('div');return T.style.visibility='hidden',T.style.overflow='hidden',T.style.width='0',T.style.height='0',T.appendChild(P),T}},{key:'getElement',value:function(P){var T;if((0,_.isElement)(P)?T=P:'string'==typeof P&&(T=document.getElementById(P)),!T)throw new Error('Not an Element');return T}},{key:'attachTo',value:function(P){var E,T=this.getElement(P);if(T)return E=this.settings.hidden?this.wrapper:this.container,T.appendChild(E),this.element=T,T}},{key:'getContainer',value:function(){return this.container}},{key:'onResize',value:function(P){(0,_.isNumber)(this.settings.width)&&(0,_.isNumber)(this.settings.height)||window.addEventListener('resize',P,!1)}},{key:'size',value:function(P,T){var E;return null===P&&(E=this.element.getBoundingClientRect(),E.width&&(P=E.width,this.container.style.width=E.width+'px')),null===T&&(E=E||this.element.getBoundingClientRect(),E.height&&(T=E.height,this.container.style.height=E.height+'px')),(0,_.isNumber)(P)||(E=this.container.getBoundingClientRect(),P=E.width),(0,_.isNumber)(T)||(E=E||this.container.getBoundingClientRect(),T=E.height),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles['padding-left'])||0,right:parseFloat(this.containerStyles['padding-right'])||0,top:parseFloat(this.containerStyles['padding-top'])||0,bottom:parseFloat(this.containerStyles['padding-bottom'])||0},{width:P-this.containerPadding.left-this.containerPadding.right,height:T-this.containerPadding.top-this.containerPadding.bottom}}},{key:'bounds',value:function(){return this.container?this.container.getBoundingClientRect():(0,_.windowBounds)()}},{key:'getSheet',value:function(){var P=document.createElement('style');return P.appendChild(document.createTextNode('')),document.head.appendChild(P),P.sheet}},{key:'addStyleRules',value:function(P,T){var E='#'+this.id+' ',z='';this.sheet||(this.sheet=this.getSheet()),T.forEach(function(R){for(var N in R)R.hasOwnProperty(N)&&(z+=N+':'+R[N]+';')}),this.sheet.insertRule(E+P+' {'+z+'}',0)}}]),S}();p.default=C,u.exports=p['default']},function(u,p){'use strict';'use strict';function f(_,C){if(!(_ instanceof C))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var v=function(){function _(C,S){for(var L=0;L<S.length;L++){var P=S[L];P.enumerable=P.enumerable||!1,P.configurable=!0,'value'in P&&(P.writable=!0),Object.defineProperty(C,P.key,P)}}return function(C,S,L){return S&&_(C.prototype,S),L&&_(C,L),C}}(),k=function(){function _(C){f(this,_),this.container=C,this._views=[],this.length=0,this.hidden=!1}return v(_,[{key:'all',value:function(){return this._views}},{key:'first',value:function(){return this._views[0]}},{key:'last',value:function(){return this._views[this._views.length-1]}},{key:'indexOf',value:function(S){return this._views.indexOf(S)}},{key:'slice',value:function(){return this._views.slice.apply(this._views,arguments)}},{key:'get',value:function(S){return this._views[S]}},{key:'append',value:function(S){return this._views.push(S),this.container&&this.container.appendChild(S.element),this.length++,S}},{key:'prepend',value:function(S){return this._views.unshift(S),this.container&&this.container.insertBefore(S.element,this.container.firstChild),this.length++,S}},{key:'insert',value:function(S,L){return this._views.splice(L,0,S),this.container&&(L<this.container.children.length?this.container.insertBefore(S.element,this.container.children[L]):this.container.appendChild(S.element)),this.length++,S}},{key:'remove',value:function(S){var L=this._views.indexOf(S);-1<L&&this._views.splice(L,1),this.destroy(S),this.length--}},{key:'destroy',value:function(S){S.displayed&&S.destroy(),this.container&&this.container.removeChild(S.element),S=null}},{key:'each',value:function(){return this._views.forEach.apply(this._views,arguments)}},{key:'clear',value:function(){var S,L=this.length;if(this.length){for(var P=0;P<L;P++)S=this._views[P],this.destroy(S);this._views=[],this.length=0}}},{key:'find',value:function(S){var L,P=this.length;for(var T=0;T<P;T++)if(L=this._views[T],L.displayed&&L.section.index==S.index)return L}},{key:'displayed',value:function(){var S,C=[],L=this.length;for(var P=0;P<L;P++)S=this._views[P],S.displayed&&C.push(S);return C}},{key:'show',value:function(){var S,L=this.length;for(var P=0;P<L;P++)S=this._views[P],S.displayed&&S.show();this.hidden=!1}},{key:'hide',value:function(){var S,L=this.length;for(var P=0;P<L;P++)S=this._views[P],S.displayed&&S.hide();this.hidden=!0}}]),_}();p.default=k,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(S,L){if(!(S instanceof L))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function S(L,P){for(var T=0;T<P.length;T++){var E=P[T];E.enumerable=E.enumerable||!1,E.configurable=!0,'value'in E&&(E.writable=!0),Object.defineProperty(L,E.key,E)}}return function(L,P,T){return P&&S(L.prototype,P),T&&S(L,T),L}}(),_=f(0),C=function(){function S(L){v(this,S),this.toc=[],this.tocByHref={},this.tocById={},L&&this.parse(L)}return k(S,[{key:'parse',value:function(P){var T=(0,_.qs)(P,'html'),E=(0,_.qs)(P,'ncx');T?this.toc=this.parseNav(P):E&&(this.toc=this.parseNcx(P)),this.unpack(this.toc)}},{key:'unpack',value:function(P){var T;for(var E=0;E<P.length;E++)T=P[E],this.tocByHref[T.href]=E,this.tocById[T.id]=E}},{key:'get',value:function(P){var T;return P?(0===P.indexOf('#')?T=this.tocById[P.substring(1)]:P in this.tocByHref&&(T=this.tocByHref[P]),this.toc[T]):this.toc}},{key:'parseNav',value:function(P){var R,O,A,T=(0,_.querySelectorByType)(P,'nav','toc'),E=T?(0,_.qsa)(T,'li'):[],z=E.length,N={},B=[];if(!E||0===z)return B;for(R=0;R<z;++R)O=this.navItem(E[R]),N[O.id]=O,O.parent?(A=N[O.parent],A.subitems.push(O)):B.push(O);return B}},{key:'navItem',value:function(P){var B,T=P.getAttribute('id')||!1,E=(0,_.qs)(P,'a'),z=E.getAttribute('href')||'',R=E.textContent||'',N=P.parentNode;return N&&'navPoint'===N.nodeName&&(B=N.getAttribute('id')),{id:T,href:z,label:R,subitems:[],parent:B}}},{key:'parseNcx',value:function(P){var z,B,O,T=(0,_.qsa)(P,'navPoint'),E=T.length,R={},N=[];if(!T||0===E)return N;for(z=0;z<E;++z)B=this.ncxItem(T[z]),R[B.id]=B,B.parent?(O=R[B.parent],O.subitems.push(B)):N.push(B);return N}},{key:'ncxItem',value:function(P){var O,T=P.getAttribute('id')||!1,E=(0,_.qs)(P,'content'),z=E.getAttribute('src'),R=(0,_.qs)(P,'navLabel'),N=R.textContent?R.textContent:'',B=P.parentNode;return B&&'navPoint'===B.nodeName&&(O=B.getAttribute('id')),{id:T,href:z,label:N,subitems:[],parent:O}}},{key:'forEach',value:function(P){return this.toc.forEach(P)}}]),S}();p.default=C,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(S,L){if(!(S instanceof L))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function S(L,P){for(var T=0;T<P.length;T++){var E=P[T];E.enumerable=E.enumerable||!1,E.configurable=!0,'value'in E&&(E.writable=!0),Object.defineProperty(L,E.key,E)}}return function(L,P,T){return P&&S(L.prototype,P),T&&S(L,T),L}}(),_=f(0),C=function(){function S(L){v(this,S),L&&this.parse(L)}return k(S,[{key:'parse',value:function(P){var T,E,z;if(!P)throw new Error('Package File Not Found');if(T=(0,_.qs)(P,'metadata'),!T)throw new Error('No Metadata Found');if(E=(0,_.qs)(P,'manifest'),!E)throw new Error('No Manifest Found');if(z=(0,_.qs)(P,'spine'),!z)throw new Error('No Spine Found');return this.manifest=this.parseManifest(E),this.navPath=this.findNavPath(E),this.ncxPath=this.findNcxPath(E,z),this.coverPath=this.findCoverPath(P),this.spineNodeIndex=Array.prototype.indexOf.call(z.parentNode.childNodes,z),this.spine=this.parseSpine(z,this.manifest),this.metadata=this.parseMetadata(T),this.metadata.direction=z.getAttribute('page-progression-direction'),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}},{key:'parseMetadata',value:function(P){var T={};return T.title=this.getElementText(P,'title'),T.creator=this.getElementText(P,'creator'),T.description=this.getElementText(P,'description'),T.pubdate=this.getElementText(P,'date'),T.publisher=this.getElementText(P,'publisher'),T.identifier=this.getElementText(P,'identifier'),T.language=this.getElementText(P,'language'),T.rights=this.getElementText(P,'rights'),T.modified_date=this.getPropertyText(P,'dcterms:modified'),T.layout=this.getPropertyText(P,'rendition:layout'),T.orientation=this.getPropertyText(P,'rendition:orientation'),T.flow=this.getPropertyText(P,'rendition:flow'),T.viewport=this.getPropertyText(P,'rendition:viewport'),T}},{key:'parseManifest',value:function(P){var T={},E=(0,_.qsa)(P,'item'),z=Array.prototype.slice.call(E);return z.forEach(function(R){var N=R.getAttribute('id'),B=R.getAttribute('href')||'',O=R.getAttribute('media-type')||'',A=R.getAttribute('properties')||'';T[N]={href:B,type:O,properties:A.length?A.split(' '):[]}}),T}},{key:'parseSpine',value:function(P){var T=[],E=P.getElementsByTagName('itemref'),z=Array.prototype.slice.call(E);return z.forEach(function(R,N){var B=R.getAttribute('idref'),O=R.getAttribute('properties')||'',A=O.length?O.split(' '):[],M={idref:B,linear:R.getAttribute('linear')||'',properties:A,index:N};T.push(M)}),T}},{key:'findNavPath',value:function(P){var T=(0,_.qsp)(P,'item',{properties:'nav'});return!!T&&T.getAttribute('href')}},{key:'findNcxPath',value:function(P,T){var z,E=(0,_.qsp)(P,'item',{'media-type':'application/x-dtbncx+xml'});return E||(z=T.getAttribute('toc'),z&&(E=P.getElementById(z))),!!E&&E.getAttribute('href')}},{key:'findCoverPath',value:function(P){var T=(0,_.qs)(P,'package'),E=T.getAttribute('version');if('2.0'===E){var z=(0,_.qsp)(P,'meta',{name:'cover'});if(z){var R=z.getAttribute('content'),N=P.getElementById(R);return N?N.getAttribute('href'):''}return!1}var B=(0,_.qsp)(P,'item',{properties:'cover-image'});return B?B.getAttribute('href'):''}},{key:'getElementText',value:function(P,T){var z,E=P.getElementsByTagNameNS('http://purl.org/dc/elements/1.1/',T);return E&&0!==E.length?(z=E[0],z.childNodes.length?z.childNodes[0].nodeValue:''):''}},{key:'getPropertyText',value:function(P,T){var E=(0,_.qsp)(P,'meta',{property:T});return E&&E.childNodes.length?E.childNodes[0].nodeValue:''}}]),S}();p.default=C,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(P,T){if(!(P instanceof T))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k=function(){function P(T,E){for(var z=0;z<E.length;z++){var R=E[z];R.enumerable=R.enumerable||!1,R.configurable=!0,'value'in R&&(R.writable=!0),Object.defineProperty(T,R.key,R)}}return function(T,E,z){return E&&P(T.prototype,E),z&&P(T,z),T}}(),_=f(1),C=function(T){return T&&T.__esModule?T:{default:T}}(_),S=f(0),L=function(){function P(T){v(this,P),this.pages=[],this.locations=[],this.epubcfi=new C.default,T&&(this.pageList=this.parse(T)),this.pageList&&this.pageList.length&&this.process(this.pageList)}return k(P,[{key:'parse',value:function(E){var z=(0,S.qs)(E,'html'),R=(0,S.qs)(E,'ncx');z?this.toc=this.parseNav(E):R}},{key:'parseNav',value:function(E){var B,A,z=(0,S.querySelectorByType)(E,'nav','page-list'),R=z?(0,S.qsa)(z,'li'):[],N=R.length,O=[];if(!R||0===N)return O;for(B=0;B<N;++B)A=this.item(R[B]),O.push(A);return O}},{key:'item',value:function(E){var A,M,W,z=(0,S.qs)(E,'a'),R=z.getAttribute('href')||'',N=z.textContent||'',B=parseInt(N),O=R.indexOf('epubcfi');return-1==O?{href:R,page:B}:(A=R.split('#'),M=A[0],W=!!(1<A.length)&&A[1],{cfi:W,href:R,packageUrl:M,page:B})}},{key:'process',value:function(E){E.forEach(function(z){this.pages.push(z.page),z.cfi&&this.locations.push(z.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}},{key:'addCFIs',value:function(){this.pageList.forEach(function(E){!E.cfi})}},{key:'pageFromCfi',value:function(E){var z=-1;if(0===this.locations.length)return-1;var R=(0,S.indexOfSorted)(E,this.locations,this.epubcfi.compare);return-1==R?(R=(0,S.locationOf)(E,this.locations,this.epubcfi.compare),z=0<=R-1?this.pages[R-1]:this.pages[0],void 0===z&&(z=-1)):z=this.pages[R],z}},{key:'cfiFromPage',value:function(E){var z=-1;'number'!=typeof E&&(E=parseInt(E));var R=this.pages.indexOf(E);return-1!=R&&(z=this.locations[R]),z}},{key:'pageFromPercentage',value:function(E){var z=Math.round(this.totalPages*E);return z}},{key:'percentageFromPage',value:function(E){var z=(E-this.firstPage)/this.totalPages;return Math.round(1e3*z)/1e3}},{key:'percentageFromCfi',value:function(E){var z=this.pageFromCfi(E),R=this.percentageFromPage(z);return R}}]),P}();p.default=L,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(R){return R&&R.__esModule?R:{default:R}}function k(R,N){if(!(R instanceof N))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function R(N,B){for(var O=0;O<B.length;O++){var A=B[O];A.enumerable=A.enumerable||!1,A.configurable=!0,'value'in A&&(A.writable=!0),Object.defineProperty(N,A.key,A)}}return function(N,B,O){return B&&R(N.prototype,B),O&&R(N,O),N}}(),C=f(4),S=f(0),L=f(3),P=v(L),T=f(5),E=v(T),z=function(){function R(N,B){k(this,R),this.settings={replacements:B&&B.replacements||'base64',archive:B&&B.archive,resolver:B&&B.resolver},this.manifest=N,this.resources=Object.keys(N).map(function(O){return N[O]}),this.replacementUrls=[],this.split(),this.splitUrls()}return _(R,[{key:'split',value:function(){this.html=this.resources.filter(function(B){if('application/xhtml+xml'===B.type||'text/html'===B.type)return!0}),this.assets=this.resources.filter(function(B){if('application/xhtml+xml'!==B.type&&'text/html'!==B.type)return!0}),this.css=this.resources.filter(function(B){if('text/css'===B.type)return!0})}},{key:'splitUrls',value:function(){this.urls=this.assets.map(function(B){return B.href}.bind(this)),this.cssUrls=this.css.map(function(B){return B.href})}},{key:'replacements',value:function(B,O){var A=this;if(B=B||this.settings.archive,O=O||this.settings.resolver,'none'===this.settings.replacements)return new Promise(function(M){M(this.urls)}.bind(this));var N=this.urls.map(function(M){var W=O(M);return B.createUrl(W,{base64:'base64'===A.settings.replacements})});return Promise.all(N).then(function(M){return A.replacementUrls=M,M})}},{key:'replaceCss',value:function(B,O){var A=[];return B=B||this.settings.archive,O=O||this.settings.resolver,this.cssUrls.forEach(function(M){var W=this.createCssFile(M,B,O).then(function(F){var D=this.urls.indexOf(M);-1<D&&(this.replacementUrls[D]=F)}.bind(this));A.push(W)}.bind(this)),Promise.all(A)}},{key:'createCssFile',value:function(B,O,A){var W,M=this;if(O=O||this.settings.archive,A=A||this.settings.resolver,E.default.isAbsolute(B))return new Promise(function(U){U()});var F=A(B),D=O.getText(F),I=this.urls.map(function(U){var H=A(U),V=new P.default(F).relative(H);return V});return D.then(function(U){return U=(0,C.substitute)(U,I,M.replacementUrls),W='base64'===M.settings.replacements?(0,S.createBase64Url)(U,'text/css'):(0,S.createBlobUrl)(U,'text/css'),W})}},{key:'relativeTo',value:function(B,O){return O=O||this.settings.resolver,this.urls.map(function(A){var M=O(A),W=new P.default(B).relative(M);return W}.bind(this))}},{key:'get',value:function(B){var O=this.urls.indexOf(B);return-1===O?void 0:this.replacementUrls.length?new Promise(function(A){A(this.replacementUrls[O])}.bind(this)):this.archive.createUrl(B,{base64:'base64'===this.settings.replacements})}},{key:'substitute',value:function(B,O){var A;return A=O?this.relativeTo(O):this.urls,(0,C.substitute)(B,A,this.replacementUrls)}}]),R}();p.default=z,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(R){return R&&R.__esModule?R:{default:R}}function k(R,N){if(!(R instanceof N))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function R(N,B){for(var O=0;O<B.length;O++){var A=B[O];A.enumerable=A.enumerable||!1,A.configurable=!0,'value'in A&&(A.writable=!0),Object.defineProperty(N,A.key,A)}}return function(N,B,O){return B&&R(N.prototype,B),O&&R(N,O),N}}(),C=f(0),S=f(1),L=v(S),P=f(8),T=v(P),E=f(4),z=function(){function R(N,B){k(this,R),this.idref=N.idref,this.linear=N.linear,this.properties=N.properties,this.index=N.index,this.href=N.href,this.url=N.url,this.next=N.next,this.prev=N.prev,this.cfiBase=N.cfiBase,B?this.hooks=B:(this.hooks={},this.hooks.serialize=new T.default(this),this.hooks.content=new T.default(this))}return _(R,[{key:'load',value:function(B){var O=B||this.request||f(10),A=new C.defer,M=A.promise;return this.contents?A.resolve(this.contents):O(this.url).then(function(W){return this.document=W,this.contents=W.documentElement,this.hooks.content.trigger(this.document,this)}.bind(this)).then(function(){A.resolve(this.contents)}.bind(this)).catch(function(W){A.reject(W)}),M}},{key:'base',value:function(){return(0,E.replaceBase)(this.document,this)}},{key:'render',value:function(B){var O=new C.defer,A=O.promise;return this.output,this.load(B).then(function(M){var W,F;return F='undefined'==typeof XMLSerializer?f(14).XMLSerializer:XMLSerializer,W=new F,this.output=W.serializeToString(M),this.output}.bind(this)).then(function(){return this.hooks.serialize.trigger(this.output,this)}.bind(this)).then(function(){O.resolve(this.output)}.bind(this)).catch(function(M){O.reject(M)}),A}},{key:'find',value:function(){}},{key:'reconcileLayoutSettings',value:function(B){var O={layout:B.layout,spread:B.spread,orientation:B.orientation};return this.properties.forEach(function(A){var F,D,M=A.replace('rendition:',''),W=M.indexOf('-');-1!=W&&(F=M.slice(0,W),D=M.slice(W+1),O[F]=D)}),O}},{key:'cfiFromRange',value:function(B){return new L.default(B,this.cfiBase).toString()}},{key:'cfiFromElement',value:function(B){return new L.default(B,this.cfiBase).toString()}}]),R}();p.default=z,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(N){return N&&N.__esModule?N:{default:N}}function k(N,B){if(!(N instanceof B))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var _=function(){function N(B,O){for(var A=0;A<O.length;A++){var M=O[A];M.enumerable=M.enumerable||!1,M.configurable=!0,'value'in M&&(M.writable=!0),Object.defineProperty(B,M.key,M)}}return function(B,O,A){return O&&N(B.prototype,O),A&&N(B,A),B}}(),C=f(1),S=v(C),L=f(8),P=v(L),T=f(30),E=v(T),z=f(4),R=function(){function N(){k(this,N),this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new P.default,this.hooks.content=new P.default,this.hooks.content.register(z.replaceBase),this.hooks.content.register(z.replaceCanonical),this.epubcfi=new S.default,this.loaded=!1}return _(N,[{key:'unpack',value:function(O,A){var M=this;this.items=O.spine,this.manifest=O.manifest,this.spineNodeIndex=O.spineNodeIndex,this.baseUrl=O.baseUrl||O.basePath||'',this.length=this.items.length,this.items.forEach(function(W,F){var I,D=M.manifest[W.idref];W.cfiBase=M.epubcfi.generateChapterComponent(M.spineNodeIndex,W.index,W.idref),D&&(W.href=D.href,W.url=A(W.href,!0),D.properties.length&&W.properties.push.apply(W.properties,D.properties)),W.prev=function(){return this.get(F-1)}.bind(M),W.next=function(){return this.get(F+1)}.bind(M),I=new E.default(W,M.hooks),M.append(I)}),this.loaded=!0}},{key:'get',value:function(O){var A=0;if(this.epubcfi.isCfiString(O)){var M=new S.default(O);A=M.spinePos}else O&&('number'==typeof O||!1===isNaN(O))?A=O:O&&0===O.indexOf('#')?A=this.spineById[O.substring(1)]:O&&(O=O.split('#')[0],A=this.spineByHref[O]);return this.spineItems[A]||null}},{key:'append',value:function(O){var A=this.spineItems.length;return O.index=A,this.spineItems.push(O),this.spineByHref[O.href]=A,this.spineById[O.idref]=A,A}},{key:'prepend',value:function(O){return this.spineByHref[O.href]=0,this.spineById[O.idref]=0,this.spineItems.forEach(function(A,M){A.index=M}),0}},{key:'remove',value:function(O){var A=this.spineItems.indexOf(O);if(-1<A)return delete this.spineByHref[O.href],delete this.spineById[O.idref],this.spineItems.splice(A,1)}},{key:'each',value:function(){return this.spineItems.forEach.apply(this.spineItems,arguments)}}]),N}();p.default=R,u.exports=p['default']},function(u,p,f){'use strict';'use strict';function v(P,T){if(!(P instanceof T))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(p,'__esModule',{value:!0});var k='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(P){return typeof P}:function(P){return P&&'function'==typeof Symbol&&P.constructor===Symbol&&P!==Symbol.prototype?'symbol':typeof P},_=function(){function P(T,E){for(var z=0;z<E.length;z++){var R=E[z];R.enumerable=R.enumerable||!1,R.configurable=!0,'value'in R&&(R.writable=!0),Object.defineProperty(T,R.key,R)}}return function(T,E,z){return E&&P(T.prototype,E),z&&P(T,z),T}}(),C=f(11),S=function(T){return T&&T.__esModule?T:{default:T}}(C),L=function(){function P(T){v(this,P),this.rendition=T,this._themes={'default':{rules:[],url:'',serialized:''}},this._overrides={},this._current='default',this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}return _(P,[{key:'register',value:function(){return 0===arguments.length?void 0:1===arguments.length&&'object'===k(arguments[0])?this.registerThemes(arguments[0]):1===arguments.length&&'string'==typeof arguments[0]?this.default(arguments[0]):2===arguments.length&&'string'==typeof arguments[1]?this.registerUrl(arguments[0],arguments[1]):2===arguments.length&&'object'===k(arguments[1])?this.registerRules(arguments[0],arguments[1]):void 0}},{key:'default',value:function(E){return E?'string'==typeof E?this.registerUrl('default',E):'object'===('undefined'==typeof E?'undefined':k(E))?this.registerRules('default',E):void 0:void 0}},{key:'registerThemes',value:function(E){for(var z in E)E.hasOwnProperty(z)&&('string'==typeof E[z]?this.registerUrl(z,E[z]):this.registerRules(z,E[z]))}},{key:'registerUrl',value:function(E,z){var R=new S.default(z);this._themes[E]={url:R.toString()}}},{key:'registerRules',value:function(E,z){this._themes[E]={rules:z}}},{key:'apply',value:function(E){var R,z=this._current;this._current=E,this.update(E),R=this.rendition.getContents(),R.forEach(function(N){N.removeClass(z),N.addClass(E)})}},{key:'update',value:function(E){var z=this,R=this.rendition.getContents();R.forEach(function(N){z.add(E,N)})}},{key:'inject',value:function(E){var N,z=[],R=this._themes;for(var B in R)R.hasOwnProperty(B)&&(N=R[B],(N.rules||N.url&&-1===z.indexOf(N.url))&&this.add(B,E));this._current&&E.addClass(this._current)}},{key:'add',value:function(E,z){var R=this._themes[E];R&&(R.url?z.addStylesheet(R.url):R.serialized||R.rules&&R.rules.length&&(z.addStylesheetRules(R.rules),R.injected=!0))}},{key:'override',value:function(E,z){var R=this,N=this.rendition.getContents();this._overrides[E]=z,N.forEach(function(B){B.css(E,R._overrides[E])})}},{key:'overrides',value:function(E){var T=this._overrides;for(var z in T)T.hasOwnProperty(z)&&E.css(z,T[z])}},{key:'fontSize',value:function(E){this.override('font-size',E)}}]),P}();p.default=L,u.exports=p['default']},function(u,p,f){'use strict';'use strict';var S,v=f(34),k=f(41),_=f(37),C=f(44);S=u.exports=function(L,P){var T,E,z,R,N;return 2>arguments.length||'string'!=typeof L?(R=P,P=L,L=null):R=arguments[2],null==L?(T=z=!0,E=!1):(T=C.call(L,'c'),E=C.call(L,'e'),z=C.call(L,'w')),N={value:P,configurable:T,enumerable:E,writable:z},R?v(k(R),N):N},S.gs=function(L,P,T){var E,z,R,N;return'string'==typeof L?R=arguments[3]:(R=T,T=P,P=L,L=null),null==P?P=void 0:_(P)?null==T?T=void 0:!_(T)&&(R=T,T=void 0):(R=P,P=T=void 0),null==L?(E=!0,z=!1):(E=C.call(L,'c'),z=C.call(L,'e')),N={get:P,set:T,configurable:E,enumerable:z},R?v(k(R),N):N}},function(u,p,f){'use strict';'use strict';u.exports=f(35)()?Object.assign:f(36)},function(u){'use strict';'use strict';u.exports=function(){var f,p=Object.assign;return!('function'!=typeof p)&&(f={foo:'raz'},p(f,{bar:'dwa'},{trzy:'trzy'}),'razdwatrzy'===f.foo+f.bar+f.trzy)}},function(u,p,f){'use strict';'use strict';var v=f(38),k=f(43),_=Math.max;u.exports=function(C,S){var L,P,E,T=_(arguments.length,2);for(C=Object(k(C)),E=function(z){try{C[z]=S[z]}catch(R){L||(L=R)}},P=1;P<T;++P)S=arguments[P],v(S).forEach(E);if(L!==void 0)throw L;return C}},function(u){'use strict';'use strict';u.exports=function(p){return'function'==typeof p}},function(u,p,f){'use strict';'use strict';u.exports=f(39)()?Object.keys:f(40)},function(u){'use strict';'use strict';u.exports=function(){try{return Object.keys('primitive'),!0}catch(p){return!1}}},function(u){'use strict';'use strict';var p=Object.keys;u.exports=function(f){return p(null==f?f:Object(f))}},function(u){'use strict';'use strict';var p=Array.prototype.forEach,f=Object.create,v=function(k,_){for(var C in k)_[C]=k[C]};u.exports=function(){var k=f(null);return p.call(arguments,function(_){null==_||v(Object(_),k)}),k}},function(u){'use strict';'use strict';u.exports=function(p){if('function'!=typeof p)throw new TypeError(p+' is not a function');return p}},function(u){'use strict';'use strict';u.exports=function(p){if(null==p)throw new TypeError('Cannot use null or undefined');return p}},function(u,p,f){'use strict';'use strict';u.exports=f(45)()?String.prototype.contains:f(46)},function(u){'use strict';'use strict';var p='razdwatrzy';u.exports=function(){return!('function'!=typeof p.contains)&&!0===p.contains('dwa')&&!1===p.contains('foo')}},function(u){'use strict';'use strict';var p=String.prototype.indexOf;u.exports=function(f){return-1<p.call(this,f,arguments[1])}},function(u){function p(){throw new Error('setTimeout has not been defined')}function f(){throw new Error('clearTimeout has not been defined')}function v(O){if(T===setTimeout)return setTimeout(O,0);if((T===p||!T)&&setTimeout)return T=setTimeout,setTimeout(O,0);try{return T(O,0)}catch(A){try{return T.call(null,O,0)}catch(M){return T.call(this,O,0)}}}function k(O){if(E===clearTimeout)return clearTimeout(O);if((E===f||!E)&&clearTimeout)return E=clearTimeout,clearTimeout(O);try{return E(O)}catch(A){try{return E.call(null,O)}catch(M){return E.call(this,O)}}}function _(){R&&N&&(R=!1,N.length?z=N.concat(z):B=-1,z.length&&C())}function C(){if(!R){var O=v(_);R=!0;for(var A=z.length;A;){for(N=z,z=[];++B<A;)N&&N[B].run();B=-1,A=z.length}N=null,R=!1,k(O)}}function S(O,A){this.fun=O,this.array=A}function L(){}var P=u.exports={},T,E;(function(){try{T='function'==typeof setTimeout?setTimeout:p}catch(O){T=p}try{E='function'==typeof clearTimeout?clearTimeout:f}catch(O){E=f}})();var z=[],R=!1,N,B=-1;P.nextTick=function(O){var A=Array(arguments.length-1);if(1<arguments.length)for(var M=1;M<arguments.length;M++)A[M-1]=arguments[M];z.push(new S(O,A)),1!==z.length||R||v(C)},S.prototype.run=function(){this.fun.apply(null,this.array)},P.title='browser',P.browser=!0,P.env={},P.argv=[],P.version='',P.versions={},P.on=L,P.addListener=L,P.once=L,P.off=L,P.removeListener=L,P.removeAllListeners=L,P.emit=L,P.binding=function(){throw new Error('process.binding is not supported')},P.cwd=function(){return'/'},P.chdir=function(){throw new Error('process.chdir is not supported')},P.umask=function(){return 0}},function(u){if('undefined'==typeof t){var p=new Error('Cannot find module "JSZip"');throw p.code='MODULE_NOT_FOUND',p}u.exports=t},function(u,p,f){'use strict';(function(v){'use strict';function k(N){return N&&N.__esModule?N:{default:N}}function _(N,B){return new S.default(N,B)}Object.defineProperty(p,'__esModule',{value:!0});var C=f(15),S=k(C),L=f(1),P=k(L),T=f(13),E=k(T),z=f(6),R=k(z);_.VERSION='0.3','undefined'!=typeof v&&(v.EPUBJS_VERSION=_.VERSION),_.CFI=P.default,_.Rendition=E.default,_.Contents=R.default,_.ViewManagers={},_.Views={},_.register={manager:function(B,O){return _.ViewManagers[B]=O},view:function(B,O){return _.Views[B]=O}},_.register.view('iframe',f(17)),_.register.manager('default',f(12)),_.register.manager('continuous',f(16)),p.default=_,u.exports=p['default']}).call(p,f(18))}])});